diff options
Diffstat (limited to 'crypto/perlasm')
-rwxr-xr-x | crypto/perlasm/x86_64-xlate.pl | 15 | ||||
-rw-r--r-- | crypto/perlasm/x86asm.pl | 8 |
2 files changed, 22 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 diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index efa7b61ce8..b7ddb8137f 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -123,6 +123,14 @@ sub ::pclmulqdq { &::generic("pclmulqdq",@_); } } +sub ::rdrand +{ my ($dst)=@_; + if ($dst =~ /(e[a-dsd][ixp])/) + { &::data_byte(0x0f,0xc7,0xf0|$regrm{$dst}); } + else + { &::generic("rdrand",@_); } +} + # label management $lbdecor="L"; # local label decoration, set by package $label="000"; |