diff options
author | lloyd <[email protected]> | 2006-08-13 08:27:05 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-08-13 08:27:05 +0000 |
commit | 444e4004275dff3706d4956b6063f0d09ac409a3 (patch) | |
tree | f66b494e654848c6756ab6786199bd3ccb579b9a /modules | |
parent | 7668bc4c22e12b95048222ebefa21d4990c7abad (diff) |
Convert another set of asm instructions to macros
Diffstat (limited to 'modules')
-rw-r--r-- | modules/sha_x86/asm_macr.h | 1 | ||||
-rw-r--r-- | modules/sha_x86/sha1core.S | 36 |
2 files changed, 19 insertions, 18 deletions
diff --git a/modules/sha_x86/asm_macr.h b/modules/sha_x86/asm_macr.h index d5dcfd238..fb51cdbb5 100644 --- a/modules/sha_x86/asm_macr.h +++ b/modules/sha_x86/asm_macr.h @@ -37,6 +37,7 @@ func_name: #define ESI %esi #define PUSH(REG) pushl REG +#define POP(REG) popl REG #define MOV(FROM, TO) movl FROM, TO diff --git a/modules/sha_x86/sha1core.S b/modules/sha_x86/sha1core.S index 77128ffa1..7c6d1b938 100644 --- a/modules/sha_x86/sha1core.S +++ b/modules/sha_x86/sha1core.S @@ -81,12 +81,12 @@ START_LOOP(.EXPANSION) ADD(IMM(16), EBP) LOOP_UNTIL(ESI, IMM(80), .EXPANSION) - movl 20(%esp), EBP - movl 0(EBP), EAX - movl 4(EBP), EBX - movl 8(EBP), ECX - movl 12(EBP), EDX - movl 16(EBP), ESI + MOV(ARG(1), EBP) + MOV(ARRAY(EBP, 0), EAX) + MOV(ARRAY(EBP, 1), EBX) + MOV(ARRAY(EBP, 2), ECX) + MOV(ARRAY(EBP, 3), EDX) + MOV(ARRAY(EBP, 4), ESI) #define MAGIC1 0x5A827999 #define MAGIC2 0x6ED9EBA1 @@ -163,15 +163,15 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION) F_BLOCK(F4, 70) F_BLOCK(F4, 75) - movl 20(%esp), EBP - addl EAX, 0(EBP) - addl EBX, 4(EBP) - addl ECX, 8(EBP) - addl EDX, 12(EBP) - addl ESI, 16(EBP) - - popl EBX - popl ESI - popl EDI - popl EBP - ret + MOV(ARG(1), EBP) + ADD(EAX, ARRAY(EBP, 0)) + ADD(EBX, ARRAY(EBP, 1)) + ADD(ECX, ARRAY(EBP, 2)) + ADD(EDX, ARRAY(EBP, 3)) + ADD(ESI, ARRAY(EBP, 4)) + + POP(EBX) + POP(ESI) + POP(EDI) + POP(EBP) + ret |