aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-08-13 09:05:42 +0000
committerlloyd <[email protected]>2006-08-13 09:05:42 +0000
commitcec6047cc9f5ba4cc56072d61cc74c2be7fa4015 (patch)
treedafcdce4dad4106f958f7e47c7943d666f02fa91 /modules
parent3407bb3f171af14585ce16a344e3e224f2ecb3d4 (diff)
Switch the destination and source arguments of ADD()
Diffstat (limited to 'modules')
-rw-r--r--modules/sha_x86/asm_macr.h4
-rw-r--r--modules/sha_x86/sha1core.S22
2 files changed, 13 insertions, 13 deletions
diff --git a/modules/sha_x86/asm_macr.h b/modules/sha_x86/asm_macr.h
index 3d19b5f4c..92f9973a0 100644
--- a/modules/sha_x86/asm_macr.h
+++ b/modules/sha_x86/asm_macr.h
@@ -45,8 +45,8 @@ func_name:
#define ARRAY(REG, NUM) 4*NUM(REG)
#define ARG(NUM) 4*PUSHED + ARRAY(ESP, NUM)
-#define ADD(FROM, TO) addl FROM, TO
-#define ADD_IMM(REG, NUM) addl IMM(NUM), REG
+#define ADD(TO, FROM) addl FROM, TO
+#define ADD_IMM(TO, NUM) addl IMM(NUM), TO
#define ADD2_IMM(TO, FROM, NUM) leal NUM(FROM), TO
#define XOR(FROM, TO) xorl FROM, TO
diff --git a/modules/sha_x86/sha1core.S b/modules/sha_x86/sha1core.S
index 8e1bc1368..adb65fce1 100644
--- a/modules/sha_x86/sha1core.S
+++ b/modules/sha_x86/sha1core.S
@@ -94,11 +94,11 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION)
#define MAGIC4 0xCA62C1D6
#define F1(A, B, C, D, E, TEMP, MSG) \
- ADD(ARRAY(EDI, MSG), E) ; \
+ ADD(E, ARRAY(EDI, MSG)) ; \
ASSIGN(TEMP, C) ; \
ROTL_IMM(A, 5) ; \
XOR(D, TEMP) ; \
- ADD(A, E) ; \
+ ADD(E, A) ; \
AND(B, TEMP) ; \
ROTR_IMM(B, 2) ; \
XOR(D, TEMP) ; \
@@ -106,18 +106,18 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION)
ROTR_IMM(A, 5) ;
#define F2_OR_F4(A, B, C, D, E, TEMP, MSG, MAGIC) \
- ADD(ARRAY(EDI, MSG), E) ; \
+ ADD(E, ARRAY(EDI, MSG)) ; \
ASSIGN(TEMP, B) ; \
ROTL_IMM(A, 5) ; \
XOR(D, TEMP) ; \
- ADD(A, E) ; \
+ ADD(E, A) ; \
XOR(C, TEMP) ; \
ROTR_IMM(B, 2) ; \
leal MAGIC(E,TEMP,1), E ; \
ROTR_IMM(A, 5) ;
#define F3(A, B, C, D, E, TEMP, MSG) \
- ADD(ARRAY(EDI, MSG), E) ; \
+ ADD(E, ARRAY(EDI, MSG)) ; \
ASSIGN(TEMP, B) ; \
ROTL_IMM(A, 5) ; \
OR(C, TEMP) ; \
@@ -125,7 +125,7 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION)
AND(D, TEMP) ; \
AND(C, ARRAY(EDI, MSG)) ; \
OR(ARRAY(EDI, MSG), TEMP) ; \
- ADD(A, E) ; \
+ ADD(E, A) ; \
leal MAGIC3(E,TEMP,1), E ; \
ROTR_IMM(B, 2) ; \
ROTR_IMM(A, 5) ;
@@ -164,11 +164,11 @@ LOOP_UNTIL(ESI, IMM(80), .EXPANSION)
F_BLOCK(F4, 75)
ASSIGN(EBP, ARG(1))
- 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))
+ ADD(ARRAY(EBP, 0), EAX)
+ ADD(ARRAY(EBP, 1), EBX)
+ ADD(ARRAY(EBP, 2), ECX)
+ ADD(ARRAY(EBP, 3), EDX)
+ ADD(ARRAY(EBP, 4), ESI)
POP(EBX)
POP(ESI)