diff options
author | lloyd <[email protected]> | 2006-09-26 16:27:07 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-09-26 16:27:07 +0000 |
commit | e7a1b1e72db56a1449d39e4ab27b7ecf4d6b9397 (patch) | |
tree | d71dc295c7d79cd611ffb73154edf3a47f6c083c /modules/alg_ia32/mp_muladd.S | |
parent | 753ee7322a58940a5ca14166fbfe795805638341 (diff) |
Improve readability a bit with some additional macros
Diffstat (limited to 'modules/alg_ia32/mp_muladd.S')
-rw-r--r-- | modules/alg_ia32/mp_muladd.S | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/modules/alg_ia32/mp_muladd.S b/modules/alg_ia32/mp_muladd.S index cba82a23c..53b210d25 100644 --- a/modules/alg_ia32/mp_muladd.S +++ b/modules/alg_ia32/mp_muladd.S @@ -11,11 +11,13 @@ START_FUNCTION(bigint_mul_add_words) SPILL_REGS() #define PUSHED 4 - ASSIGN(EBX, ARG(2)) /* x[] */ +#define LOOP_CTR ESI + ASSIGN(LOOP_CTR, ARG(3)) /* x_size */ + ZEROIZE(EDI) + ASSIGN(ECX, ARG(1)) /* z[] */ - ASSIGN(ESI, ARG(3)) /* x_size */ + ASSIGN(EBX, ARG(2)) /* x[] */ ASSIGN(EBP, ARG(4)) /* y */ - ZEROIZE(EDI) #define MULADD_OP(N) \ ASSIGN(EAX, ARRAY4(EBX, N)) ; \ @@ -24,8 +26,8 @@ START_FUNCTION(bigint_mul_add_words) ASSIGN(EDI, EDX) ; \ ADD_W_CARRY(ARRAY4(ECX, N), EDI, EAX) ; - JUMP_IF_ZERO(ESI, .MUL_ADD_DONE) - JUMP_IF_LT(ESI, 8, .MULADD1_LOOP) + JUMP_IF_ZERO(LOOP_CTR, .MUL_ADD_DONE) + JUMP_IF_LT(LOOP_CTR, 8, .MULADD1_LOOP) START_LOOP(.MULADD8) MULADD_OP(0) @@ -37,20 +39,20 @@ START_LOOP(.MULADD8) MULADD_OP(6) MULADD_OP(7) - SUB_IMM(ESI, 8) + SUB_IMM(LOOP_CTR, 8) ADD_IMM(EBX, 32) ADD_IMM(ECX, 32) -LOOP_UNTIL_LT(ESI, 8, .MULADD8) +LOOP_UNTIL_LT(LOOP_CTR, 8, .MULADD8) - JUMP_IF_ZERO(ESI, .MUL_ADD_DONE) + JUMP_IF_ZERO(LOOP_CTR, .MUL_ADD_DONE) START_LOOP(.MULADD1) MULADD_OP(0) - SUB_IMM(ESI, 1) + SUB_IMM(LOOP_CTR, 1) ADD_IMM(EBX, 4) ADD_IMM(ECX, 4) -LOOP_UNTIL_EQ(ESI, 0, .MULADD1) +LOOP_UNTIL_EQ(LOOP_CTR, 0, .MULADD1) .MUL_ADD_DONE: |