diff options
author | Andy Polyakov <appro@openssl.org> | 2016-05-15 17:01:15 +0200 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2016-05-19 22:33:00 +0200 |
commit | e33826f01bd78af76e0135c8dfab3387927a82bb (patch) | |
tree | a44459e3859610fe7ce35bc4923d8af6d6110e09 /crypto/pariscid.pl | |
parent | 2e6d7799ffc47604d06e0465afeb84b91aff8006 (diff) |
Add assembly CRYPTO_memcmp.
GH: #102
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/pariscid.pl')
-rw-r--r-- | crypto/pariscid.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/crypto/pariscid.pl b/crypto/pariscid.pl index 03895d5cf3..f82e27ac4c 100644 --- a/crypto/pariscid.pl +++ b/crypto/pariscid.pl @@ -138,6 +138,37 @@ L\$done ___ } { +my ($in1,$in2,$len)=("%r26","%r25","%r24"); + +$code.=<<___; + .EXPORT CRYPTO_memcmp,ENTRY,ARGW0=GR,ARGW1=GR,ARGW1=GR + .ALIGN 8 +CRYPTO_memcmp + .PROC + .CALLINFO NO_CALLS + .ENTRY + cmpib,*= 0,$len,L\$no_data + xor $rv,$rv,$rv + +L\$oop_cmp + ldb 0($in1),%r19 + ldb 0($in2),%r20 + ldo 1($in1),$in1 + ldo 1($in2),$in2 + xor %r19,%r20,%r29 + addib,*<> -1,$len,L\$oop_cmp + or %r29,$rv,$rv + + sub %r0,$rv,%r29 + extru %r29,31,1,$rv +L\$no_data + bv ($rp) + .EXIT + nop + .PROCEND +___ +} +{ my ($out,$cnt,$max)=("%r26","%r25","%r24"); my ($tick,$lasttick)=("%r23","%r22"); my ($diff,$lastdiff)=("%r21","%r20"); |