Skip to content

Commit

Permalink
perlasm/ppc-xlate.pl: Fix build on OS X
Browse files Browse the repository at this point in the history
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: openssl#16995

Signed-off-by: Martin Schwenke <martin@meltin.net>
  • Loading branch information
martin-schwenke committed Nov 14, 2021
1 parent 293e251 commit 5e002f8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crypto/perlasm/ppc-xlate.pl
Expand Up @@ -153,13 +153,14 @@
# vs<N> -> v<N-32> if N > 32
sub vsr2vr1 {
my $in = shift;
my ($prefix, $reg) = ($in =~ m/(\D*)(\d+)/);

my $n = int($in);
my $n = int($reg);
if ($n >= 32) {
$n -= 32;
}

return "$n";
return "${prefix}${n}";
}
# As above for first $num register args, returns list
sub _vsr2vr {
Expand Down

0 comments on commit 5e002f8

Please sign in to comment.