mirror of https://github.com/openssl/openssl.git
perlasm/ppc-xlate.pl: Fix build on OS X
vsr2vr1() fails on OS X because the main loop doesn't strip the non-numeric register prefixes for OS X. Strip any non-numeric prefix (likely just "v") from registers before doing numeric calculation, then put the prefix back on the result. Fixes: #16995 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17026)
This commit is contained in:
parent
af16097feb
commit
e67edf60f2
|
@ -153,13 +153,14 @@ my $quad = sub {
|
||||||
# vs<N> -> v<N-32> if N > 32
|
# vs<N> -> v<N-32> if N > 32
|
||||||
sub vsr2vr1 {
|
sub vsr2vr1 {
|
||||||
my $in = shift;
|
my $in = shift;
|
||||||
|
my ($prefix, $reg) = ($in =~ m/(\D*)(\d+)/);
|
||||||
|
|
||||||
my $n = int($in);
|
my $n = int($reg);
|
||||||
if ($n >= 32) {
|
if ($n >= 32) {
|
||||||
$n -= 32;
|
$n -= 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
return "$n";
|
return "${prefix}${n}";
|
||||||
}
|
}
|
||||||
# As above for first $num register args, returns list
|
# As above for first $num register args, returns list
|
||||||
sub _vsr2vr {
|
sub _vsr2vr {
|
||||||
|
|
Loading…
Reference in New Issue