From: Martin Schwenke Date: Tue, 9 Nov 2021 11:07:54 +0000 (+1100) Subject: perlasm/ppc-xlate.pl: Fix build on OS X X-Git-Tag: openssl-3.2.0-alpha1~3319 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e67edf60f2e9be6e5f5465b52d01aa26bf715280;p=thirdparty%2Fopenssl.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 Reviewed-by: Matt Caswell Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/17026) --- diff --git a/crypto/perlasm/ppc-xlate.pl b/crypto/perlasm/ppc-xlate.pl index 47ca9b8afa9..2ee444045ff 100755 --- a/crypto/perlasm/ppc-xlate.pl +++ b/crypto/perlasm/ppc-xlate.pl @@ -153,13 +153,14 @@ my $quad = sub { # vs -> v 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 {