summaryrefslogtreecommitdiffstats
path: root/crypto/perlasm
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2013-10-31 11:08:51 +0100
committerAndy Polyakov <appro@openssl.org>2013-10-31 11:08:51 +0100
commit8ff8a829b053274124c3f2231570af3ae96806c0 (patch)
treee3b0eeed6cc608845b69cfd6b815a4d2d33d3ff8 /crypto/perlasm
parent3f9562a669b116a4cdd62922563b8d45a1cbf60d (diff)
perlasm/ppc-xlate.pl: add .quad directive
sha/asm/sha512-ppc.pl: add little-endian support. Submitted by: Marcelo Cerri
Diffstat (limited to 'crypto/perlasm')
-rwxr-xr-xcrypto/perlasm/ppc-xlate.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl
index 3ed7bd9665..cab368c49b 100755
--- a/crypto/perlasm/ppc-xlate.pl
+++ b/crypto/perlasm/ppc-xlate.pl
@@ -79,6 +79,25 @@ my $asciz = sub {
else
{ ""; }
};
+my $quad = sub {
+ shift;
+ my @ret;
+ my ($hi,$lo);
+ for (@_) {
+ if (/^0x([0-9a-f]*?)([0-9a-f]{1,8})$/io)
+ { $hi=$1?"0x$1":"0"; $lo="0x$2"; }
+ elsif (/^([0-9]+)$/o)
+ { $hi=$1>>32; $lo=$1&0xffffffff; } # error-prone with 32-bit perl
+ else
+ { $hi=undef; $lo=$_; }
+
+ if (defined($hi))
+ { push(@ret,$flavour=~/lei$/o?".long\t$lo,$hi":".long\t$hi,$lo"); }
+ else
+ { push(@ret,".quad $lo"); }
+ }
+ join("\n",@ret);
+};
################################################################
# simplified mnemonics not handled by at least one assembler