summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2011-12-15 22:20:05 +0000
committerAndy Polyakov <appro@openssl.org>2011-12-15 22:20:05 +0000
commit0e1467a64c2368d267b0eebb4190f95a7196c9c9 (patch)
tree577e22c3045fb3892afcda22ff097fbc373a8d59
parentf2fc30751e60f5877607eeef3ad1ad1c0fdfc430 (diff)
vpaes-x86.pl: revert previous commit and solve the problem through x86masm.pl.
PR: 2657
-rw-r--r--crypto/aes/asm/vpaes-x86.pl10
-rw-r--r--crypto/perlasm/x86masm.pl4
2 files changed, 8 insertions, 6 deletions
diff --git a/crypto/aes/asm/vpaes-x86.pl b/crypto/aes/asm/vpaes-x86.pl
index 30446e60db..84a6f6d336 100644
--- a/crypto/aes/asm/vpaes-x86.pl
+++ b/crypto/aes/asm/vpaes-x86.pl
@@ -762,7 +762,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
&mov ($magic,0x30);
&mov ($out,0);
- &mov ($const,&label("_vpaes_consts")."+0x30-".&label("pic_point"));
+ &lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
&call ("_vpaes_schedule_core");
&set_label("pic_point");
@@ -792,7 +792,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
&and ($magic,32);
&xor ($magic,32); # nbist==192?0:32;
- &mov ($const,&label("_vpaes_consts")."+0x30-".&label("pic_point"));
+ &lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
&call ("_vpaes_schedule_core");
&set_label("pic_point");
@@ -801,7 +801,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
&function_end("${PREFIX}_set_decrypt_key");
&function_begin("${PREFIX}_encrypt");
- &mov ($const,&label("_vpaes_consts")."+0x30-".&label("pic_point"));
+ &lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
&call ("_vpaes_preheat");
&set_label("pic_point");
&mov ($inp,&wparam(0)); # inp
@@ -820,7 +820,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
&function_end("${PREFIX}_encrypt");
&function_begin("${PREFIX}_decrypt");
- &mov ($const,&label("_vpaes_consts")."+0x30-".&label("pic_point"));
+ &lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
&call ("_vpaes_preheat");
&set_label("pic_point");
&mov ($inp,&wparam(0)); # inp
@@ -858,7 +858,7 @@ $k_dsbo=0x2c0; # decryption sbox final output
&mov (&DWP(8,"esp"),$const); # save ivp
&mov ($out,$round); # $out works as $len
- &mov ($const,&label("_vpaes_consts")."+0x30-".&label("pic_point"));
+ &lea ($const,&DWP(&label("_vpaes_consts")."+0x30-".&label("pic_point")));
&call ("_vpaes_preheat");
&set_label("pic_point");
&cmp ($magic,0);
diff --git a/crypto/perlasm/x86masm.pl b/crypto/perlasm/x86masm.pl
index ee446de5c1..328ca2e23f 100644
--- a/crypto/perlasm/x86masm.pl
+++ b/crypto/perlasm/x86masm.pl
@@ -16,7 +16,9 @@ sub ::generic
# fix hexadecimal constants
for (@arg) { s/(?<![\w\$\.])0x([0-9a-f]+)/0$1h/oi; }
- if ($opcode !~ /movq/)
+ if ($opcode =~ /lea/ && @arg[1] =~ s/.*PTR\s+([^\[]+)$/$1/) # no []
+ { $opcode="mov"; }
+ elsif ($opcode !~ /movq/)
{ # fix xmm references
$arg[0] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[1]=~/\bxmm[0-7]\b/i);
$arg[1] =~ s/\b[A-Z]+WORD\s+PTR/XMMWORD PTR/i if ($arg[0]=~/\bxmm[0-7]\b/i);