aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/perlasm
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-06-30 15:57:57 +0200
committerAndy Polyakov <appro@openssl.org>2016-07-01 14:25:08 +0200
commitf198cc43a0eca4bf1a8e7f60c51af560f4346dc8 (patch)
tree358cd4d520381d787c70c7db7ac0858d6c473be5 /crypto/perlasm
parent0685b15a68db1cd24678432f38b88f217495cbb9 (diff)
downloadopenssl-f198cc43a0eca4bf1a8e7f60c51af560f4346dc8.tar.gz
SPARC assembly pack: enforce V8+ ABI constraints.
Even though it's hard to imagine, it turned out that upper half of arguments passed to V8+ subroutine can be non-zero. ["n" pseudo-instructions, such as srln being srl in 32-bit case and srlx in 64-bit one, were implemented in binutils 2.10. It's assumed that Solaris assembler implemented it around same time, i.e. 2000.] Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/perlasm')
-rw-r--r--crypto/perlasm/sparcv9_modes.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/perlasm/sparcv9_modes.pl b/crypto/perlasm/sparcv9_modes.pl
index 47c2e53b99..bfdada8540 100644
--- a/crypto/perlasm/sparcv9_modes.pl
+++ b/crypto/perlasm/sparcv9_modes.pl
@@ -48,6 +48,7 @@ ${alg}${bits}_t4_cbc_encrypt:
save %sp, -$::frame, %sp
cmp $len, 0
be,pn $::size_t_cc, .L${bits}_cbc_enc_abort
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
sub $inp, $out, $blk_init ! $inp!=$out
___
$::code.=<<___ if (!$::evp);
@@ -265,6 +266,7 @@ ${alg}${bits}_t4_cbc_decrypt:
save %sp, -$::frame, %sp
cmp $len, 0
be,pn $::size_t_cc, .L${bits}_cbc_dec_abort
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
sub $inp, $out, $blk_init ! $inp!=$out
___
$::code.=<<___ if (!$::evp);
@@ -624,6 +626,7 @@ $::code.=<<___;
.align 32
${alg}${bits}_t4_ctr32_encrypt:
save %sp, -$::frame, %sp
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
prefetch [$inp], 20
prefetch [$inp + 63], 20
@@ -927,6 +930,7 @@ $::code.=<<___;
.align 32
${alg}${bits}_t4_xts_${dir}crypt:
save %sp, -$::frame-16, %sp
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
mov $ivec, %o0
add %fp, $::bias-16, %o1