aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/perlasm/x86_64-xlate.pl
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-06-04 12:20:45 +0000
committerAndy Polyakov <appro@openssl.org>2011-06-04 12:20:45 +0000
commit301799b803fc9f3e2adaad32b1ccace736bbe7cc (patch)
tree0edc73d8425ac47b5124104760cb0294c53b214f /crypto/perlasm/x86_64-xlate.pl
parent8d515259e2a4631a5b42f1a072b0ff6f8eba189c (diff)
downloadopenssl-301799b803fc9f3e2adaad32b1ccace736bbe7cc.tar.gz
x86[_64]cpuid.pl: add function accessing rdrand instruction.
Diffstat (limited to 'crypto/perlasm/x86_64-xlate.pl')
-rwxr-xr-xcrypto/perlasm/x86_64-xlate.pl15
1 files changed, 14 insertions, 1 deletions
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl
index 91017c69f3..a6b718b5e8 100755
--- a/crypto/perlasm/x86_64-xlate.pl
+++ b/crypto/perlasm/x86_64-xlate.pl
@@ -625,7 +625,7 @@ my %globals;
/\.comm/ && do { my @str=split(/,\s*/,$line);
my $v=undef;
if ($nasm) {
- $v.="common $prefix@str[0] @str[1]:near";
+ $v.="common $prefix@str[0] @str[1]";
} else {
$v="$current_segment\tENDS\n" if ($current_segment);
$current_segment = ".data";
@@ -757,6 +757,19 @@ my $pclmulqdq = sub {
}
};
+my $rdrand = 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,0xf0|($dst&7);
+ @opcode;
+ } else {
+ ();
+ }
+};
+
if ($nasm) {
print <<___;
default rel