diff options
author | Andy Polyakov <appro@openssl.org> | 2014-02-14 17:24:12 +0100 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2014-02-14 17:24:12 +0100 |
commit | f4d456408d9d7bca31f34765d1a05fbd9fa55826 (patch) | |
tree | e52d1370e39be0b3d428d0b34b5a0c281a589e85 /crypto/perlasm | |
parent | 5599c7331b90d9d29c9914c2a95c16d91485415a (diff) | |
download | openssl-f4d456408d9d7bca31f34765d1a05fbd9fa55826.tar.gz |
x86[_64]cpuid.pl: add low-level RDSEED.
Diffstat (limited to 'crypto/perlasm')
-rwxr-xr-x | crypto/perlasm/x86_64-xlate.pl | 13 | ||||
-rw-r--r-- | crypto/perlasm/x86asm.pl | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index ed74b85ac9..4dd7f5252d 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -778,6 +778,19 @@ my $rdrand = sub { } }; +my $rdseed = sub { + if (shift =~ /%[er](\w+)/) { + my @opcode=(); + my $dst=$1; + if ($dst !~ /[0-9]+/) { $dst = $regrm{"%e$dst"}; } + rex(\@opcode,0,$1,8); + push @opcode,0x0f,0xc7,0xf8|($dst&7); + @opcode; + } else { + (); + } +}; + sub rxb { local *opcode=shift; my ($dst,$src1,$src2,$rxb)=@_; diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index 17abf92297..dcbc738516 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -131,6 +131,14 @@ sub ::rdrand { &::generic("rdrand",@_); } } +sub ::rdseed +{ my ($dst)=@_; + if ($dst =~ /(e[a-dsd][ixp])/) + { &::data_byte(0x0f,0xc7,0xf8|$regrm{$dst}); } + else + { &::generic("rdrand",@_); } +} + sub rxb { local *opcode=shift; my ($dst,$src1,$src2,$rxb)=@_; |