[Gmp-commit] /var/hg/gmp: Rewrite.
mercurial at gmplib.org
mercurial at gmplib.org
Mon Jul 15 23:43:52 CEST 2013
details: /var/hg/gmp/rev/13b6df6a8028
changeset: 15872:13b6df6a8028
user: Torbjorn Granlund <tege at gmplib.org>
date: Mon Jul 15 21:36:51 2013 +0200
description:
Rewrite.
diffstat:
mpn/x86_64/core2/aors_n.asm | 84 +++++++++++++++++++++-----------------------
1 files changed, 41 insertions(+), 43 deletions(-)
diffs (145 lines):
diff -r 78b8732e93ae -r 13b6df6a8028 mpn/x86_64/core2/aors_n.asm
--- a/mpn/x86_64/core2/aors_n.asm Mon Jul 15 13:08:07 2013 +0200
+++ b/mpn/x86_64/core2/aors_n.asm Mon Jul 15 21:36:51 2013 +0200
@@ -1,6 +1,6 @@
-dnl Intel P6-15 mpn_add_n/mpn_sub_n -- mpn add or subtract.
+dnl Intel mpn_add_n/mpn_sub_n optimised for Conroe, Nehalem.
-dnl Copyright 2006, 2007, 2011, 2012 Free Software Foundation, Inc.
+dnl Copyright 2006, 2007, 2011, 2012, 2013 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
@@ -21,14 +21,14 @@
C cycles/limb
-C AMD K8,K9 2.25
+C AMD K8,K9 2
C AMD K10 2
C Intel P4 10
-C Intel core2 2.05
-C Intel NHM 2.3
-C Intel SBR 1.9
-C Intel atom ?
-C VIA nano ?
+C Intel core2 2
+C Intel NHM 2
+C Intel SBR 2
+C Intel atom 9
+C VIA nano 3
C INPUT PARAMETERS
define(`rp', `%rdi')
@@ -54,12 +54,6 @@
ASM_START()
TEXT
ALIGN(16)
-PROLOGUE(func_nc)
- FUNC_ENTRY(4)
-IFDOS(` mov 56(%rsp), %r8 ')
- jmp L(start)
-EPILOGUE()
-
PROLOGUE(func)
FUNC_ENTRY(4)
xor %r8, %r8
@@ -67,10 +61,10 @@
mov (up), %r10
mov (vp), %r11
- lea -8(up,n,8), up
- lea -8(vp,n,8), vp
- lea -16(rp,n,8), rp
- mov R32(%rcx), R32(%rax)
+ lea (up,n,8), up
+ lea (vp,n,8), vp
+ lea (rp,n,8), rp
+ mov R32(n), R32(%rax)
neg n
and $3, R32(%rax)
je L(b00)
@@ -79,54 +73,58 @@
jl L(b01)
je L(b10)
-L(b11): shr %r8 C set cy
+L(b11): neg %r8 C set cy
jmp L(e11)
-L(b00): shr %r8 C set cy
+L(b00): neg %r8 C set cy
mov %r10, %r8
mov %r11, %r9
lea 4(n), n
jmp L(e00)
-L(b01): shr %r8 C set cy
- jmp L(e01)
+ nop
+ nop
+ nop
+L(b01): neg %r8 C set cy
+ jmp L(top)
-L(b10): shr %r8 C set cy
+L(b10): neg %r8 C set cy
mov %r10, %r8
mov %r11, %r9
jmp L(e10)
L(end): ADCSBB %r11, %r10
- mov %r10, 8(rp)
+ mov %r10, -8(rp)
mov R32(%rcx), R32(%rax) C clear eax, ecx contains 0
adc R32(%rax), R32(%rax)
FUNC_EXIT()
ret
ALIGN(16)
-L(top):
- mov -24(up,n,8), %r8
- mov -24(vp,n,8), %r9
+L(top): jrcxz L(end)
+ mov (up,n,8), %r8
+ mov (vp,n,8), %r9
+ lea 4(n), n
+ ADCSBB %r11, %r10
+ mov %r10, -40(rp,n,8)
+L(e00): mov -24(up,n,8), %r10
+ mov -24(vp,n,8), %r11
+ ADCSBB %r9, %r8
+ mov %r8, -32(rp,n,8)
+L(e11): mov -16(up,n,8), %r8
+ mov -16(vp,n,8), %r9
ADCSBB %r11, %r10
mov %r10, -24(rp,n,8)
-L(e00):
- mov -16(up,n,8), %r10
- mov -16(vp,n,8), %r11
+L(e10): mov -8(up,n,8), %r10
+ mov -8(vp,n,8), %r11
ADCSBB %r9, %r8
mov %r8, -16(rp,n,8)
-L(e11):
- mov -8(up,n,8), %r8
- mov -8(vp,n,8), %r9
- ADCSBB %r11, %r10
- mov %r10, -8(rp,n,8)
-L(e10):
- mov (up,n,8), %r10
- mov (vp,n,8), %r11
- ADCSBB %r9, %r8
- mov %r8, (rp,n,8)
-L(e01):
- jrcxz L(end)
- lea 4(n), n
jmp L(top)
+EPILOGUE()
+PROLOGUE(func_nc)
+ FUNC_ENTRY(4)
+IFDOS(` mov 56(%rsp), %r8 ')
+ jmp L(start)
EPILOGUE()
+
More information about the gmp-commit
mailing list