diff options
author | Martin Schwenke <martin@meltin.net> | 2021-06-16 16:54:26 +1000 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2021-06-22 18:30:17 +1000 |
commit | 3f55ff6af5dde97c6cda53bd735606f21b5707a5 (patch) | |
tree | ae0dabafd82aa43a75df0a2b48ef58b3c473af72 /crypto/bn/asm | |
parent | 5b7f986457d2ae181de9475a3d303e6ba4a3b16c (diff) |
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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15798)
Diffstat (limited to 'crypto/bn/asm')
-rwxr-xr-x | crypto/bn/asm/ppc64-mont-fixed.pl | 8 |
1 files changed, 4 insertions, 4 deletions
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) ___ } |