aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-03-09 02:53:59 +0000
committerlloyd <[email protected]>2008-03-09 02:53:59 +0000
commit9f63fc79701df7e6b659908f5f8ae7efba7c7720 (patch)
tree79e75981643e1a2aa7e1985820e3b45c47693bb0 /modules
parentc6629040068af67dbd9648eb64cc47b1923287cd (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')
-rw-r--r--modules/mp_amd64/mp_asm.h12
-rw-r--r--modules/mp_ia32/mp_asm.h12
2 files changed, 12 insertions, 12 deletions
diff --git a/modules/mp_amd64/mp_asm.h b/modules/mp_amd64/mp_asm.h
index 745f62fdb..f24f030bd 100644
--- a/modules/mp_amd64/mp_asm.h
+++ b/modules/mp_amd64/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("mulq %[b]")
ASM("addq %[c],%[a]")
ASM("adcq $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("mulq %[b]")
@@ -51,8 +51,8 @@ inline word word_madd3(word a, word b, word c, word d, word* carry)
ASM("addq %[d],%[a]")
ASM("adcq $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;
}
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;
}