Changeset View
Changeset View
Standalone View
Standalone View
crypto/openssl/crypto/perlasm/ppc-xlate.pl
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | /aix/ && do { if (!$$type) { | ||||
if ($$type =~ /function/) { | if ($$type =~ /function/) { | ||||
$name = ".$name"; | $name = ".$name"; | ||||
} | } | ||||
last; | last; | ||||
}; | }; | ||||
/osx/ && do { $name = "_$name"; | /osx/ && do { $name = "_$name"; | ||||
last; | last; | ||||
}; | }; | ||||
/linux.*(32|64le)/ | /linux.*(32|64(le|v2))/ | ||||
&& do { $ret .= ".globl $name"; | && do { $ret .= ".globl $name"; | ||||
if (!$$type) { | if (!$$type) { | ||||
$ret .= "\n.type $name,\@function"; | $ret .= "\n.type $name,\@function"; | ||||
$$type = "\@function"; | $$type = "\@function"; | ||||
} | } | ||||
last; | last; | ||||
}; | }; | ||||
/linux.*64/ && do { $ret .= ".globl $name"; | /linux.*64/ && do { $ret .= ".globl $name"; | ||||
Show All 14 Lines | /linux.*64/ && do { $ret .= ".globl $name"; | ||||
} | } | ||||
$ret = ".globl $name" if (!$ret); | $ret = ".globl $name" if (!$ret); | ||||
$$global = $name; | $$global = $name; | ||||
$ret; | $ret; | ||||
}; | }; | ||||
my $text = sub { | my $text = sub { | ||||
my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text"; | my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text"; | ||||
$ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64le/); | $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64(le|v2)/); | ||||
$ret; | $ret; | ||||
}; | }; | ||||
my $machine = sub { | my $machine = sub { | ||||
my $junk = shift; | my $junk = shift; | ||||
my $arch = shift; | my $arch = shift; | ||||
if ($flavour =~ /osx/) | if ($flavour =~ /osx/) | ||||
{ $arch =~ s/\"//g; | { $arch =~ s/\"//g; | ||||
$arch = ($flavour=~/64/) ? "ppc970-64" : "ppc970" if ($arch eq "any"); | $arch = ($flavour=~/64/) ? "ppc970-64" : "ppc970" if ($arch eq "any"); | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
my $vmr = sub { | my $vmr = sub { | ||||
my ($f,$vx,$vy) = @_; | my ($f,$vx,$vy) = @_; | ||||
" vor $vx,$vy,$vy"; | " vor $vx,$vy,$vy"; | ||||
}; | }; | ||||
# Some ABIs specify vrsave, special-purpose register #256, as reserved | # Some ABIs specify vrsave, special-purpose register #256, as reserved | ||||
# for system use. | # for system use. | ||||
my $no_vrsave = ($flavour =~ /aix|linux64le/); | my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/); | ||||
my $mtspr = sub { | my $mtspr = sub { | ||||
my ($f,$idx,$ra) = @_; | my ($f,$idx,$ra) = @_; | ||||
if ($idx == 256 && $no_vrsave) { | if ($idx == 256 && $no_vrsave) { | ||||
" or $ra,$ra,$ra"; | " or $ra,$ra,$ra"; | ||||
} else { | } else { | ||||
" mtspr $idx,$ra"; | " mtspr $idx,$ra"; | ||||
} | } | ||||
}; | }; | ||||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | $line =~ s|\bL(\w+)|\.L$1|g if ($dotinlocallabels); | ||||
} | } | ||||
{ | { | ||||
$line =~ s|(^[\.\w]+)\:\s*||; | $line =~ s|(^[\.\w]+)\:\s*||; | ||||
my $label = $1; | my $label = $1; | ||||
if ($label) { | if ($label) { | ||||
my $xlated = ($GLOBALS{$label} or $label); | my $xlated = ($GLOBALS{$label} or $label); | ||||
print "$xlated:"; | print "$xlated:"; | ||||
if ($flavour =~ /linux.*64le/) { | if ($flavour =~ /linux.*64(le|v2)/) { | ||||
if ($TYPES{$label} =~ /function/) { | if ($TYPES{$label} =~ /function/) { | ||||
printf "\n.localentry %s,0\n",$xlated; | printf "\n.localentry %s,0\n",$xlated; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
{ | { | ||||
Show All 15 Lines |