From 3f55ff6af5dde97c6cda53bd735606f21b5707a5 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 16 Jun 2021 16:54:26 +1000 Subject: bn: save/restore registers to/from stack mtvsrd/mfvsrd are ISA >= 2.07 only, so this won't work for older CPUs. It would be possible to use this scheme only in the ISA >= 3.0 implementation. However, in the future it may be possible for newer ISAs to allow CPU implementations without a vector unit, so don't bother. The performance improvement versus using the stack was small anyway. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/15798) --- crypto/bn/asm/ppc64-mont-fixed.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crypto/bn/asm') diff --git a/crypto/bn/asm/ppc64-mont-fixed.pl b/crypto/bn/asm/ppc64-mont-fixed.pl index bb4290182d..da4967a730 100755 --- a/crypto/bn/asm/ppc64-mont-fixed.pl +++ b/crypto/bn/asm/ppc64-mont-fixed.pl @@ -345,12 +345,12 @@ sub save_registers($) my $n = $self->{n}; $self->add_code(<<___); - mtvsrd $vsrs[0],$lo + std $lo,-8($sp) ___ for (my $j = 0; $j <= $n+1; $j++) { $self->{code}.=<<___; - mtvsrd $vsrs[$j+1],$tp[$j] + std $tp[$j],-`($j+2)*8`($sp) ___ } @@ -366,12 +366,12 @@ sub restore_registers($) my $n = $self->{n}; $self->add_code(<<___); - mfvsrd $lo,$vsrs[0] + ld $lo,-8($sp) ___ for (my $j = 0; $j <= $n+1; $j++) { $self->{code}.=<<___; - mfvsrd $tp[$j],$vsrs[$j+1] + ld $tp[$j],-`($j+2)*8`($sp) ___ } -- cgit v1.2.3