From 9f63fc79701df7e6b659908f5f8ae7efba7c7720 Mon Sep 17 00:00:00 2001 From: lloyd Date: Sun, 9 Mar 2008 02:53:59 +0000 Subject: 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. --- modules/mp_ia32/mp_asm.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/mp_ia32') 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; } -- cgit v1.2.3