diff options
author | Andy Polyakov <appro@openssl.org> | 2011-06-28 12:33:58 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2011-06-28 12:33:58 +0000 |
commit | 2036c9a59a6cb6e085d675d7ab26eb41bcbacdba (patch) | |
tree | 21de3e2bbbd369271a3af233ba9842ec7b252d8b | |
parent | b247f7387fbfca39d3b117c2d35ddd75cf47d436 (diff) |
md5-x86_86.pl: remove redundant instructions.
-rwxr-xr-x | crypto/md5/asm/md5-x86_64.pl | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/crypto/md5/asm/md5-x86_64.pl b/crypto/md5/asm/md5-x86_64.pl index 867885435e..bc46f19387 100755 --- a/crypto/md5/asm/md5-x86_64.pl +++ b/crypto/md5/asm/md5-x86_64.pl @@ -25,8 +25,8 @@ sub round1_step xor $y, %r11d /* y ^ ... */ lea $T_i($dst,%r10d),$dst /* Const + dst + ... */ and $x, %r11d /* x & ... */ - xor $z, %r11d /* z ^ ... */ mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */ + xor $z, %r11d /* z ^ ... */ add %r11d, $dst /* dst += ... */ rol \$$s, $dst /* dst <<< s */ mov $y, %r11d /* (NEXT STEP) z' = $y */ @@ -43,7 +43,6 @@ EOF sub round2_step { my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_; - $code .= " mov 1*4(%rsi), %r10d /* (NEXT STEP) X[1] */\n" if ($pos == -1); $code .= " mov %edx, %r11d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1); $code .= " mov %edx, %r12d /* (NEXT STEP) z' = %edx */\n" if ($pos == -1); $code .= <<EOF; @@ -69,12 +68,11 @@ EOF sub round3_step { my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_; - $code .= " mov 5*4(%rsi), %r10d /* (NEXT STEP) X[5] */\n" if ($pos == -1); $code .= " mov %ecx, %r11d /* (NEXT STEP) y' = %ecx */\n" if ($pos == -1); $code .= <<EOF; lea $T_i($dst,%r10d),$dst /* Const + dst + ... */ - mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */ xor $z, %r11d /* z ^ ... */ + mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */ xor $x, %r11d /* x ^ ... */ add %r11d, $dst /* dst += ... */ rol \$$s, $dst /* dst <<< s */ @@ -91,16 +89,15 @@ EOF sub round4_step { my ($pos, $dst, $x, $y, $z, $k_next, $T_i, $s) = @_; - $code .= " mov 0*4(%rsi), %r10d /* (NEXT STEP) X[0] */\n" if ($pos == -1); $code .= " mov \$0xffffffff, %r11d\n" if ($pos == -1); $code .= " xor %edx, %r11d /* (NEXT STEP) not z' = not %edx*/\n" if ($pos == -1); $code .= <<EOF; lea $T_i($dst,%r10d),$dst /* Const + dst + ... */ or $x, %r11d /* x | ... */ + mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */ xor $y, %r11d /* y ^ ... */ add %r11d, $dst /* dst += ... */ - mov $k_next*4(%rsi),%r10d /* (NEXT STEP) X[$k_next] */ mov \$0xffffffff, %r11d rol \$$s, $dst /* dst <<< s */ xor $y, %r11d /* (NEXT STEP) not z' = not $y */ @@ -178,7 +175,7 @@ round1_step( 0,'%ebx','%ecx','%edx','%eax','12','0x895cd7be','22'); round1_step( 0,'%eax','%ebx','%ecx','%edx','13','0x6b901122', '7'); round1_step( 0,'%edx','%eax','%ebx','%ecx','14','0xfd987193','12'); round1_step( 0,'%ecx','%edx','%eax','%ebx','15','0xa679438e','17'); -round1_step( 1,'%ebx','%ecx','%edx','%eax', '0','0x49b40821','22'); +round1_step( 1,'%ebx','%ecx','%edx','%eax', '1','0x49b40821','22'); round2_step(-1,'%eax','%ebx','%ecx','%edx', '6','0xf61e2562', '5'); round2_step( 0,'%edx','%eax','%ebx','%ecx','11','0xc040b340', '9'); @@ -195,7 +192,7 @@ round2_step( 0,'%ebx','%ecx','%edx','%eax','13','0x455a14ed','20'); round2_step( 0,'%eax','%ebx','%ecx','%edx', '2','0xa9e3e905', '5'); round2_step( 0,'%edx','%eax','%ebx','%ecx', '7','0xfcefa3f8', '9'); round2_step( 0,'%ecx','%edx','%eax','%ebx','12','0x676f02d9','14'); -round2_step( 1,'%ebx','%ecx','%edx','%eax', '0','0x8d2a4c8a','20'); +round2_step( 1,'%ebx','%ecx','%edx','%eax', '5','0x8d2a4c8a','20'); round3_step(-1,'%eax','%ebx','%ecx','%edx', '8','0xfffa3942', '4'); round3_step( 0,'%edx','%eax','%ebx','%ecx','11','0x8771f681','11'); |