x86[_64]cpuid.pl: add low-level RDSEED.

(cherry picked from commit f4d456408d)
This commit is contained in:
Andy Polyakov
2014-02-14 17:24:12 +01:00
parent b347341c75
commit 104c032b7b
4 changed files with 48 additions and 0 deletions

View File

@@ -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)=@_;

View File

@@ -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)=@_;