summaryrefslogtreecommitdiffstats
path: root/crypto/alphacpuid.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-05-15 17:01:15 +0200
committerAndy Polyakov <appro@openssl.org>2016-05-19 22:33:00 +0200
commite33826f01bd78af76e0135c8dfab3387927a82bb (patch)
treea44459e3859610fe7ce35bc4923d8af6d6110e09 /crypto/alphacpuid.pl
parent2e6d7799ffc47604d06e0465afeb84b91aff8006 (diff)
Add assembly CRYPTO_memcmp.
GH: #102 Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/alphacpuid.pl')
-rw-r--r--crypto/alphacpuid.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/crypto/alphacpuid.pl b/crypto/alphacpuid.pl
index 6356b00f94..6c7fd4c9dd 100644
--- a/crypto/alphacpuid.pl
+++ b/crypto/alphacpuid.pl
@@ -134,6 +134,34 @@ OPENSSL_cleanse:
bne $17,.Little
.Ldone: ret ($26)
.end OPENSSL_cleanse
+
+.globl CRYPTO_memcmp
+.ent CRYPTO_memcmp
+CRYPTO_memcmp:
+ .frame $30,0,$26
+ .prologue 0
+ xor $0,$0,$0
+ beq $18,.Lno_data
+
+ xor $1,$1,$1
+ nop
+.Loop_cmp:
+ ldq_u $2,0($16)
+ subq $18,1,$18
+ ldq_u $3,0($17)
+ extbl $2,$16,$2
+ lda $16,1($16)
+ extbl $3,$17,$3
+ lda $17,1($17)
+ xor $3,$2,$2
+ or $2,$0,$0
+ bne $18,.Loop_cmp
+
+ subq $31,$0,$0
+ srl $0,63,$0
+.Lno_data:
+ ret ($26)
+.end CRYPTO_memcmp
___
{
my ($out,$cnt,$max)=("\$16","\$17","\$18");