diff options
author | Adam Langley <agl@chromium.org> | 2014-06-20 23:00:00 +0400 |
---|---|---|
committer | Adam Langley <agl@chromium.org> | 2014-06-21 00:17:42 +0400 |
commit | 956665b32b548c32fd02240173dd79f7dd9ff290 (patch) | |
tree | f0295fbb0fbdb7feca5b54c471be34aba86f5465 /crypto | |
parent | 8241005bfa9b49ebe3c60c85a6b30b97eeb3884e (diff) |
sha1-x86_64.pl: add missing rex prefix in shaext.
PR: 3405
(Imported from upstream's 1f6d2076256761b44e7336b496ab0887f90cea69)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/sha/asm/sha1-x86_64.pl | 6 |
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 01010cfb..272dcfa5 100644 --- 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); |