summaryrefslogtreecommitdiffstats
path: root/crypto/chacha/asm/chacha-x86.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-05-01 14:09:15 +0200
committerAndy Polyakov <appro@openssl.org>2016-05-02 12:34:42 +0200
commit8e9f1bb99e035e30450c85595150408dc1ac3d82 (patch)
tree7bb949ad90ac5181c273c299a84a0f968454245d /crypto/chacha/asm/chacha-x86.pl
parent24c2cd3967ed23acc0bd31a3781c4525e2e42a2c (diff)
chacha/asm/chacha-x86.pl: make it compile on legacy systems.
Usage of $ymm variable is a bit misleading here, it doesn't refer to %ymm register bank, but rather to VEX instruction encoding, which AMD XOP code path depends on. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/chacha/asm/chacha-x86.pl')
-rwxr-xr-xcrypto/chacha/asm/chacha-x86.pl4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/chacha/asm/chacha-x86.pl b/crypto/chacha/asm/chacha-x86.pl
index 8b9696ff02..d18663badd 100755
--- a/crypto/chacha/asm/chacha-x86.pl
+++ b/crypto/chacha/asm/chacha-x86.pl
@@ -437,8 +437,10 @@ my ($ap,$bp,$cp,$dp)=map(($_&~3)+(($_-1)&3),($ai,$bi,$ci,$di)); # previous
&function_begin("ChaCha20_ssse3");
&set_label("ssse3_shortcut");
+if ($ymm) {
&test (&DWP(4,"ebp"),1<<11); # test XOP bit
&jnz (&label("xop_shortcut"));
+}
&mov ($out,&wparam(0));
&mov ($inp,&wparam(1));
@@ -770,7 +772,7 @@ sub SSSE3ROUND { # critical path is 20 "SIMD ticks" per round
}
&asciz ("ChaCha20 for x86, CRYPTOGAMS by <appro\@openssl.org>");
-if ($xmm) {
+if ($ymm) {
my ($xa,$xa_,$xb,$xb_,$xc,$xc_,$xd,$xd_)=map("xmm$_",(0..7));
my ($out,$inp,$len)=("edi","esi","ecx");