From ea7239cf15b7eeb8555db5b7801e6da7406566ea Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Thu, 13 May 2010 15:28:07 +0000 Subject: x86asm.pl: consistency imrovements. --- crypto/perlasm/x86asm.pl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'crypto/perlasm') diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl index f09152adb6..d39bc28b22 100644 --- a/crypto/perlasm/x86asm.pl +++ b/crypto/perlasm/x86asm.pl @@ -86,31 +86,37 @@ my %regrm = ( "eax"=>0, "ecx"=>1, "edx"=>2, "ebx"=>3, sub ::pextrd { my($dst,$src,$imm)=@_; if ("$dst:$src" =~ /(e[a-dsd][ixp]):xmm([0-7])/) - { &data_byte(0x66,0x0f,0x3a,0x16,0xc0|($2<<3)|$regrm{$1},$imm); } + { &::data_byte(0x66,0x0f,0x3a,0x16,0xc0|($2<<3)|$regrm{$1},$imm); } + else + { &::generic("pextrd",@_); } } sub ::pinsrd { my($dst,$src,$imm)=@_; if ("$dst:$src" =~ /xmm([0-7]):(e[a-dsd][ixp])/) - { &data_byte(0x66,0x0f,0x3a,0x22,0xc0|($1<<3)|$regrm{$2},$imm); } + { &::data_byte(0x66,0x0f,0x3a,0x22,0xc0|($1<<3)|$regrm{$2},$imm); } + else + { &::generic("pinsrd",@_); } } sub ::pshufb { my($dst,$src)=@_; if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) { &data_byte(0x66,0x0f,0x38,0x00,0xc0|($1<<3)|$2); } + else + { &::generic("pshufb",@_); } } # AESNI extenstion sub ::aeskeygenassist { my($dst,$src,$imm)=@_; if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) - { &data_byte(0x66,0x0f,0x3a,0xdf,0xc0|($1<<3)|$2,$imm); } + { &::data_byte(0x66,0x0f,0x3a,0xdf,0xc0|($1<<3)|$2,$imm); } } sub ::aescommon { my($opcodelet,$dst,$src)=@_; if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) - { &data_byte(0x66,0x0f,0x38,$opcodelet,0xc0|($1<<3)|$2); } + { &::data_byte(0x66,0x0f,0x38,$opcodelet,0xc0|($1<<3)|$2);} } sub ::aesimc { ::aescommon(0xdb,@_); } sub ::aesenc { ::aescommon(0xdc,@_); } @@ -121,7 +127,9 @@ sub ::aesdeclast { ::aescommon(0xdf,@_); } sub ::pclmulqdq { my($dst,$src,$imm)=@_; if ("$dst:$src" =~ /xmm([0-7]):xmm([0-7])/) - { &data_byte(0x66,0x0f,0x3a,0x44,0xc0|($1<<3)|$2,$imm); } + { &::data_byte(0x66,0x0f,0x3a,0x44,0xc0|($1<<3)|$2,$imm); } + else + { &::generic("pclmulqdq",@_); } } # label management -- cgit v1.2.3