diff options
author | lloyd <[email protected]> | 2006-06-08 04:55:36 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2006-06-08 04:55:36 +0000 |
commit | fada227a69d66ec1bafe026092642b67634bcb4f (patch) | |
tree | c74ac1254b3f83852fddadd813ff4d532d7fa612 /modules | |
parent | 1803a342b3d8617695a231c3c189eda871debb17 (diff) |
Move word3_muladd* in the x86 and amd64 assembly modules.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mp_amd64/mp_asm.h | 38 | ||||
-rw-r--r-- | modules/mp_amd64/mp_asmi.h | 38 | ||||
-rw-r--r-- | modules/mp_ia32/mp_asm.h | 38 | ||||
-rw-r--r-- | modules/mp_ia32/mp_asmi.h | 38 |
4 files changed, 76 insertions, 76 deletions
diff --git a/modules/mp_amd64/mp_asm.h b/modules/mp_amd64/mp_asm.h index b8f678bbb..f67935936 100644 --- a/modules/mp_amd64/mp_asm.h +++ b/modules/mp_amd64/mp_asm.h @@ -57,44 +57,6 @@ inline word word_madd3(word a, word b, word c, word d, word* carry) return a; } -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ -inline void word3_muladd(word* w2, word* w1, word* w0, word x, word y) - { - asm( - ASM("mulq %[y]") - - ASM("addq %[x],%[w0]") - ASM("adcq %[y],%[w1]") - ASM("adcq $0,%[w2]") - - : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) - : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) - : "cc"); - } - -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ -inline void word3_muladd_2(word* w2, word* w1, word* w0, word x, word y) - { - asm( - ASM("mulq %[y]") - - ASM("addq %[x],%[w0]") - ASM("adcq %[y],%[w1]") - ASM("adcq $0,%[w2]") - - ASM("addq %[x],%[w0]") - ASM("adcq %[y],%[w1]") - ASM("adcq $0,%[w2]") - - : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) - : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) - : "cc"); - } - } } diff --git a/modules/mp_amd64/mp_asmi.h b/modules/mp_amd64/mp_asmi.h index cb606cfe3..5366e6d50 100644 --- a/modules/mp_amd64/mp_asmi.h +++ b/modules/mp_amd64/mp_asmi.h @@ -171,6 +171,44 @@ inline word word8_madd3(word z[8], const word x[8], word y, word carry) return carry; } +/************************************************* +* Multiply-Add Accumulator * +*************************************************/ +inline void word3_muladd(word* w2, word* w1, word* w0, word x, word y) + { + asm( + ASM("mulq %[y]") + + ASM("addq %[x],%[w0]") + ASM("adcq %[y],%[w1]") + ASM("adcq $0,%[w2]") + + : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) + : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) + : "cc"); + } + +/************************************************* +* Multiply-Add Accumulator * +*************************************************/ +inline void word3_muladd_2(word* w2, word* w1, word* w0, word x, word y) + { + asm( + ASM("mulq %[y]") + + ASM("addq %[x],%[w0]") + ASM("adcq %[y],%[w1]") + ASM("adcq $0,%[w2]") + + ASM("addq %[x],%[w0]") + ASM("adcq %[y],%[w1]") + ASM("adcq $0,%[w2]") + + : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) + : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) + : "cc"); + } + } #endif diff --git a/modules/mp_ia32/mp_asm.h b/modules/mp_ia32/mp_asm.h index 374fd506b..4c2c74472 100644 --- a/modules/mp_ia32/mp_asm.h +++ b/modules/mp_ia32/mp_asm.h @@ -57,44 +57,6 @@ inline word word_madd3(word a, word b, word c, word d, word* carry) return a; } -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ -inline void word3_muladd(word* w2, word* w1, word* w0, word x, word y) - { - asm( - ASM("mull %[y]") - - ASM("addl %[x],%[w0]") - ASM("adcl %[y],%[w1]") - ASM("adcl $0,%[w2]") - - : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) - : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) - : "cc"); - } - -/************************************************* -* Multiply-Add Accumulator * -*************************************************/ -inline void word3_muladd_2(word* w2, word* w1, word* w0, word x, word y) - { - asm( - ASM("mull %[y]") - - ASM("addl %[x],%[w0]") - ASM("adcl %[y],%[w1]") - ASM("adcl $0,%[w2]") - - ASM("addl %[x],%[w0]") - ASM("adcl %[y],%[w1]") - ASM("adcl $0,%[w2]") - - : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) - : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) - : "cc"); - } - } } diff --git a/modules/mp_ia32/mp_asmi.h b/modules/mp_ia32/mp_asmi.h index 979ae6ca7..6d458a315 100644 --- a/modules/mp_ia32/mp_asmi.h +++ b/modules/mp_ia32/mp_asmi.h @@ -177,6 +177,44 @@ inline word word8_madd3(word z[8], const word x[8], word y, word carry) return carry; } +/************************************************* +* Multiply-Add Accumulator * +*************************************************/ +inline void word3_muladd(word* w2, word* w1, word* w0, word x, word y) + { + asm( + ASM("mull %[y]") + + ASM("addl %[x],%[w0]") + ASM("adcl %[y],%[w1]") + ASM("adcl $0,%[w2]") + + : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) + : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) + : "cc"); + } + +/************************************************* +* Multiply-Add Accumulator * +*************************************************/ +inline void word3_muladd_2(word* w2, word* w1, word* w0, word x, word y) + { + asm( + ASM("mull %[y]") + + ASM("addl %[x],%[w0]") + ASM("adcl %[y],%[w1]") + ASM("adcl $0,%[w2]") + + ASM("addl %[x],%[w0]") + ASM("adcl %[y],%[w1]") + ASM("adcl $0,%[w2]") + + : [w0]"=r"(*w0), [w1]"=r"(*w1), [w2]"=r"(*w2) + : [x]"a"(x), [y]"d"(y), "0"(*w0), "1"(*w1), "2"(*w2) + : "cc"); + } + } #endif |