diff options
author | Andy Polyakov <appro@openssl.org> | 2012-08-13 12:34:36 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2012-08-13 12:34:36 +0000 |
commit | f6ff1aa8e0520c7cb9e63e31cc313062b16be859 (patch) | |
tree | 38382791d6d7ae8e67f972f1b1d94dfbda6b6d3d /crypto/perlasm | |
parent | 3a5485a9f88a674f5966a430db4fbd6d0b531bb7 (diff) | |
download | openssl-f6ff1aa8e0520c7cb9e63e31cc313062b16be859.tar.gz |
sha512-x86_64.pl: revert previous change and solve the problem through
perlasm/x86_64-xlate.pl instead.
Diffstat (limited to 'crypto/perlasm')
-rwxr-xr-x | crypto/perlasm/x86_64-xlate.pl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 56d9b64b6f..444a1f6177 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -772,6 +772,45 @@ my $rdrand = sub { } }; +sub rxb { + local *opcode=shift; + my ($dst,$src1,$src2,$rxb)=@_; + + $rxb|=0x7<<5; + $rxb&=~(0x04<<5) if($dst>=8); + $rxb&=~(0x01<<5) if($src1>=8); + $rxb&=~(0x02<<5) if($src2>=8); + push @opcode,$rxb; +} + +my $vprotd = sub { + if (shift =~ /\$([x0-9a-f]+),\s*%xmm([0-9]+),\s*%xmm([0-9]+)/) { + my @opcode=(0x8f); + rxb(\@opcode,$3,$2,-1,0x08); + push @opcode,0x78,0xc2; + push @opcode,0xc0|($2&7)|(($3&7)<<3); # ModR/M + my $c=$1; + push @opcode,$c=~/^0/?oct($c):$c; + @opcode; + } else { + (); + } +}; + +my $vprotq = sub { + if (shift =~ /\$([x0-9a-f]+),\s*%xmm([0-9]+),\s*%xmm([0-9]+)/) { + my @opcode=(0x8f); + rxb(\@opcode,$3,$2,-1,0x08); + push @opcode,0x78,0xc3; + push @opcode,0xc0|($2&7)|(($3&7)<<3); # ModR/M + my $c=$1; + push @opcode,$c=~/^0/?oct($c):$c; + @opcode; + } else { + (); + } +}; + if ($nasm) { print <<___; default rel |