[openssl-commits] [openssl] master update
Andy Polyakov
appro at openssl.org
Fri Jul 1 12:26:46 UTC 2016
The branch master has been updated
via 2c12f22c3364a1e562a19415f9929359945a7c21 (commit)
via f198cc43a0eca4bf1a8e7f60c51af560f4346dc8 (commit)
from 0685b15a68db1cd24678432f38b88f217495cbb9 (commit)
- Log -----------------------------------------------------------------
commit 2c12f22c3364a1e562a19415f9929359945a7c21
Author: Andy Polyakov <appro at openssl.org>
Date: Thu Jun 30 16:06:48 2016 +0200
SPARC assembly pack: enforce V8+ ABI constraints.
Reviewed-by: Richard Levitte <levitte at openssl.org>
commit f198cc43a0eca4bf1a8e7f60c51af560f4346dc8
Author: Andy Polyakov <appro at openssl.org>
Date: Thu Jun 30 15:57:57 2016 +0200
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 at openssl.org>
-----------------------------------------------------------------------
Summary of changes:
crypto/des/asm/dest4-sparcv9.pl | 8 ++++----
crypto/modes/asm/ghash-sparcv9.pl | 2 ++
crypto/perlasm/sparcv9_modes.pl | 4 ++++
crypto/poly1305/asm/poly1305-sparcv9.pl | 10 +++++-----
4 files changed, 15 insertions(+), 9 deletions(-)
diff --git a/crypto/des/asm/dest4-sparcv9.pl b/crypto/des/asm/dest4-sparcv9.pl
index 1d4f0d1..4a6e29f 100644
--- a/crypto/des/asm/dest4-sparcv9.pl
+++ b/crypto/des/asm/dest4-sparcv9.pl
@@ -106,7 +106,7 @@ $code.=<<___;
des_t4_cbc_encrypt:
cmp $len, 0
be,pn $::size_t_cc, .Lcbc_abort
- nop
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
ld [$ivec + 0], %f0 ! load ivec
ld [$ivec + 4], %f1
@@ -207,7 +207,7 @@ des_t4_cbc_encrypt:
des_t4_cbc_decrypt:
cmp $len, 0
be,pn $::size_t_cc, .Lcbc_abort
- nop
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
ld [$ivec + 0], %f2 ! load ivec
ld [$ivec + 4], %f3
@@ -315,7 +315,7 @@ $code.=<<___;
des_t4_ede3_cbc_encrypt:
cmp $len, 0
be,pn $::size_t_cc, .Lcbc_abort
- nop
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
ld [$ivec + 0], %f0 ! load ivec
ld [$ivec + 4], %f1
@@ -467,7 +467,7 @@ des_t4_ede3_cbc_encrypt:
des_t4_ede3_cbc_decrypt:
cmp $len, 0
be,pn $::size_t_cc, .Lcbc_abort
- nop
+ srln $len, 0, $len ! needed on v8+, "nop" on v9
ld [$ivec + 0], %f2 ! load ivec
ld [$ivec + 4], %f3
diff --git a/crypto/modes/asm/ghash-sparcv9.pl b/crypto/modes/asm/ghash-sparcv9.pl
index 6ca3a9b..c4eb3b1 100644
--- a/crypto/modes/asm/ghash-sparcv9.pl
+++ b/crypto/modes/asm/ghash-sparcv9.pl
@@ -453,6 +453,8 @@ gcm_gmult_vis3:
.align 32
gcm_ghash_vis3:
save %sp,-$frame,%sp
+ nop
+ srln $len,0,$len ! needed on v8+, "nop" on v9
ldx [$Xip+8],$C2 ! load Xi
ldx [$Xip+0],$C3
diff --git a/crypto/perlasm/sparcv9_modes.pl b/crypto/perlasm/sparcv9_modes.pl
index 47c2e53..bfdada8 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
diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl
index c22735a..0bdd048 100755
--- a/crypto/poly1305/asm/poly1305-sparcv9.pl
+++ b/crypto/poly1305/asm/poly1305-sparcv9.pl
@@ -146,7 +146,7 @@ poly1305_init:
.align 32
poly1305_blocks:
save %sp,-STACK_FRAME,%sp
- andn $len,15,$len
+ srln $len,4,$len
brz,pn $len,.Lno_data
nop
@@ -202,7 +202,7 @@ poly1305_blocks:
umul $r1,$h0,$d1
umul $r2,$h0,$d2
umul $r3,$h0,$d3
- sub $len,16,$len
+ sub $len,1,$len
add $inp,16,$inp
umul $s3,$h1,$t0
@@ -285,7 +285,7 @@ $code.=<<___;
.align 32
poly1305_blocks_vis3:
save %sp,-STACK_FRAME,%sp
- andn $len,15,$len
+ srln $len,4,$len
brz,pn $len,.Lno_data
nop
@@ -323,7 +323,7 @@ poly1305_blocks_vis3:
.Linp_aligned_vis3:
addcc $D0,$H0,$H0 ! accumulate input
- sub $len,16,$len
+ sub $len,1,$len
addxccc $D1,$H1,$H1
add $inp,16,$inp
@@ -608,7 +608,7 @@ poly1305_init_fma:
.align 32
poly1305_blocks_fma:
save %sp,-STACK_FRAME-48,%sp
- srlx $len,4,$len
+ srln $len,4,$len
brz,pn $len,.Labort
sub $len,1,$len
More information about the openssl-commits
mailing list