summaryrefslogtreecommitdiff
path: root/devel/perlasm/ppc-xlate.pl
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-26 23:19:01 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2013-11-26 23:20:56 +0100
commitc61d244ee65b40cbf8e8a8dbf83f92ada6eb430a (patch)
treefcd06f998a52f354924a3fb4840d0b08a8e5c71f /devel/perlasm/ppc-xlate.pl
parent11c6e66f570a6d6ed3baabe3c7924ef29fe47ad0 (diff)
downloadgnutls-c61d244ee65b40cbf8e8a8dbf83f92ada6eb430a.tar.gz
updated perlasm files
Diffstat (limited to 'devel/perlasm/ppc-xlate.pl')
-rwxr-xr-xdevel/perlasm/ppc-xlate.pl27
1 files changed, 24 insertions, 3 deletions
diff --git a/devel/perlasm/ppc-xlate.pl b/devel/perlasm/ppc-xlate.pl
index a3edd982b6..c075d5fce0 100755
--- a/devel/perlasm/ppc-xlate.pl
+++ b/devel/perlasm/ppc-xlate.pl
@@ -37,7 +37,6 @@ my $globl = sub {
$ret .= ".align 3\n";
$ret .= "$name:\n";
$ret .= ".quad .$name,.TOC.\@tocbase,0\n";
- $ret .= ".size $name,24\n";
$ret .= ".previous\n";
$name = ".$name";
@@ -62,9 +61,12 @@ my $machine = sub {
".machine $arch";
};
my $size = sub {
- if ($flavour =~ /linux.*32/)
+ if ($flavour =~ /linux/)
{ shift;
- ".size " . join(",",@_);
+ my $name = shift; $name =~ s|^[\.\_]||;
+ my $ret = ".size $name,.-".($flavour=~/64/?".":"").$name;
+ $ret .= "\n.size .$name,.-.$name" if ($flavour=~/64/);
+ $ret;
}
else
{ ""; }
@@ -77,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=~/le$/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