[Gmp-commit] /var/hg/gmp: core2/aorsmul_1.asm: Added mpn_addmul_1c and mpn_su...
mercurial at gmplib.org
mercurial at gmplib.org
Fri Feb 24 10:32:06 CET 2012
details: /var/hg/gmp/rev/c61e22c8e042
changeset: 14669:c61e22c8e042
user: Niels M?ller <nisse at lysator.liu.se>
date: Fri Feb 24 10:31:01 2012 +0100
description:
core2/aorsmul_1.asm: Added mpn_addmul_1c and mpn_submul_1c entry points.
diffstat:
ChangeLog | 5 +++++
mpn/x86_64/core2/aorsmul_1.asm | 31 ++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletions(-)
diffs (73 lines):
diff -r a96b5b4c7ef2 -r c61e22c8e042 ChangeLog
--- a/ChangeLog Fri Feb 24 10:06:38 2012 +0100
+++ b/ChangeLog Fri Feb 24 10:31:01 2012 +0100
@@ -1,3 +1,8 @@
+2012-02-24 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/x86_64/core2/aorsmul_1.asm: Added mpn_addmul_1c and
+ mpn_submul_1c entry points.
+
2012-02-24 Marco Bodrato <bodrato at mail.dm.unipi.it>
* mpz/invert.c: Use ABSIZ, MPZ_EQUAL_1_P.
diff -r a96b5b4c7ef2 -r c61e22c8e042 mpn/x86_64/core2/aorsmul_1.asm
--- a/mpn/x86_64/core2/aorsmul_1.asm Fri Feb 24 10:06:38 2012 +0100
+++ b/mpn/x86_64/core2/aorsmul_1.asm Fri Feb 24 10:31:01 2012 +0100
@@ -41,20 +41,48 @@
ifdef(`OPERATION_addmul_1',`
define(`ADDSUB', `add')
define(`func', `mpn_addmul_1')
+ define(`func_1c', `mpn_addmul_1c')
')
ifdef(`OPERATION_submul_1',`
define(`ADDSUB', `sub')
define(`func', `mpn_submul_1')
+ define(`func_1c', `mpn_submul_1c')
')
-MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_addmul_1c mpn_submul_1 mpn_submul_1c)
ABI_SUPPORT(DOS64)
ABI_SUPPORT(STD64)
+ C For DOS, on the stack we have four saved registers, return
+ C address, space for four register arguments, and finally the
+ C carry input.
+
+IFDOS(` define(`carry_in', `72(%rsp)')') dnl
+IFSTD(` define(`carry_in', `%r8')') dnl
+
ASM_START()
TEXT
ALIGN(16)
+PROLOGUE(func_1c)
+ DOS64_ENTRY(4)
+ push %rbx
+ push %rbp
+ lea (%rdx), %rbx
+ neg %rbx
+
+ mov (up), %rax
+ mov (rp), %r10
+
+ lea -16(rp,%rdx,8), rp
+ lea (up,%rdx,8), up
+ mul %rcx
+ add carry_in, %rax
+ adc $0, %rdx
+ jmp L(start_nc)
+EPILOGUE()
+
+ ALIGN(16)
PROLOGUE(func)
DOS64_ENTRY(4)
push %rbx
@@ -69,6 +97,7 @@
lea (up,%rdx,8), up
mul %rcx
+L(start_nc):
bt $0, R32(%rbx)
jc L(odd)
More information about the gmp-commit
mailing list