summaryrefslogtreecommitdiffstats
path: root/crypto/sha
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2014-06-14 15:26:14 +0200
committerAndy Polyakov <appro@openssl.org>2014-06-14 15:28:38 +0200
commit1f6d2076256761b44e7336b496ab0887f90cea69 (patch)
treee6c079d0d5c2e59a5b5c1ec6857c72ec560d7199 /crypto/sha
parent561ba124632d158469cd44775ab0a89a807ed727 (diff)
sha1-x86_64.pl: add missing rex prefix in shaext.
PR: 3405 (cherry picked from commit c9cf29cca22d4d724a1e772bc5fdc201b2822f1d)
Diffstat (limited to 'crypto/sha')
-rwxr-xr-xcrypto/sha/asm/sha1-x86_64.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl
index 6dc64a2ead..9aa128ed3a 100755
--- a/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/sha/asm/sha1-x86_64.pl
@@ -2030,8 +2030,12 @@ sub sha1op38 {
"sha1msg1" => 0xc9,
"sha1msg2" => 0xca );
- if (defined($opcodelet{$instr}) && @_[0] =~ /%xmm([0-7]),\s*%xmm([0-7])/) {
+ if (defined($opcodelet{$instr}) && @_[0] =~ /%xmm([0-9]+),\s*%xmm([0-9]+)/) {
my @opcode=(0x0f,0x38);
+ my $rex=0;
+ $rex|=0x04 if ($2>=8);
+ $rex|=0x01 if ($1>=8);
+ unshift @opcode,0x40|$rex if ($rex);
push @opcode,$opcodelet{$instr};
push @opcode,0xc0|($1&7)|(($2&7)<<3); # ModR/M
return ".byte\t".join(',',@opcode);