diff options
author | lloyd <[email protected]> | 2008-03-09 02:53:59 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-03-09 02:53:59 +0000 |
commit | 9f63fc79701df7e6b659908f5f8ae7efba7c7720 (patch) | |
tree | 79e75981643e1a2aa7e1985820e3b45c47693bb0 /modules/mp_ia32 | |
parent | c6629040068af67dbd9648eb64cc47b1923287cd (diff) |
Alter bigint_madd2 and bigint_madd3 to take only 3 (4, resp) arguments,
with the last one being both one of the input values and the output carry
register, since almost always they were in fact the same variable.
Also update the x86 and x86-64 modules.
Diffstat (limited to 'modules/mp_ia32')
-rw-r--r-- | modules/mp_ia32/mp_asm.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/mp_ia32/mp_asm.h b/modules/mp_ia32/mp_asm.h index 937aee598..873b88f46 100644 --- a/modules/mp_ia32/mp_asm.h +++ b/modules/mp_ia32/mp_asm.h @@ -24,15 +24,15 @@ extern "C" { /************************************************* * Word Multiply * *************************************************/ -inline word word_madd2(word a, word b, word c, word* carry) +inline word word_madd2(word a, word b, word* c) { asm( ASM("mull %[b]") ASM("addl %[c],%[a]") ASM("adcl $0,%[carry]") - : [a]"=a"(a), [b]"=rm"(b), [carry]"=&d"(*carry) - : "0"(a), "1"(b), [c]"g"(c) : "cc"); + : [a]"=a"(a), [b]"=rm"(b), [carry]"=&d"(*c) + : "0"(a), "1"(b), [c]"g"(*c) : "cc"); return a; } @@ -40,7 +40,7 @@ inline word word_madd2(word a, word b, word c, word* carry) /************************************************* * Word Multiply/Add * *************************************************/ -inline word word_madd3(word a, word b, word c, word d, word* carry) +inline word word_madd3(word a, word b, word c, word* d) { asm( ASM("mull %[b]") @@ -51,8 +51,8 @@ inline word word_madd3(word a, word b, word c, word d, word* carry) ASM("addl %[d],%[a]") ASM("adcl $0,%[carry]") - : [a]"=a"(a), [b]"=rm"(b), [carry]"=&d"(*carry) - : "0"(a), "1"(b), [c]"g"(c), [d]"g"(d) : "cc"); + : [a]"=a"(a), [b]"=rm"(b), [carry]"=&d"(*d) + : "0"(a), "1"(b), [c]"g"(c), [d]"g"(*d) : "cc"); return a; } |