[Gmp-commit] /var/hg/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Tue Nov 29 21:59:55 CET 2011


details:   /var/hg/gmp/rev/561ce870c111
changeset: 14493:561ce870c111
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Nov 29 21:46:37 2011 +0100
description:
Retune.

details:   /var/hg/gmp/rev/580248e75887
changeset: 14494:580248e75887
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Nov 29 21:59:39 2011 +0100
description:
Add DOS64 ABI support to most files.

diffstat:

 ChangeLog                         |   4 +
 configure.in                      |   1 -
 mpn/x86_64/addmul_2.asm           |   7 ++-
 mpn/x86_64/aorrlsh1_n.asm         |   8 ++-
 mpn/x86_64/aorrlsh2_n.asm         |   5 +-
 mpn/x86_64/aorrlshC_n.asm         |   7 ++-
 mpn/x86_64/aorrlsh_n.asm          |  14 +++++
 mpn/x86_64/aors_n.asm             |  34 +++++++++++---
 mpn/x86_64/aorscnd_n.asm          |  14 +++++
 mpn/x86_64/bdiv_dbm1c.asm         |  16 ++++++-
 mpn/x86_64/bdiv_q_1.asm           |  21 ++++++++-
 mpn/x86_64/com.asm                |   8 ++-
 mpn/x86_64/copyd.asm              |   9 ++-
 mpn/x86_64/copyi.asm              |   9 ++-
 mpn/x86_64/core2/aorrlsh1_n.asm   |   5 +-
 mpn/x86_64/core2/aorrlsh2_n.asm   |   5 +-
 mpn/x86_64/core2/aorrlsh_n.asm    |   4 +
 mpn/x86_64/core2/aors_n.asm       |  19 ++++++-
 mpn/x86_64/core2/aorsmul_1.asm    |   8 ++-
 mpn/x86_64/core2/lshift.asm       |  39 +++++++++------
 mpn/x86_64/core2/lshiftc.asm      |  39 +++++++++------
 mpn/x86_64/core2/rsh1aors_n.asm   |  17 ++++++-
 mpn/x86_64/core2/rshift.asm       |  39 +++++++++------
 mpn/x86_64/core2/sublsh1_n.asm    |   5 +-
 mpn/x86_64/core2/sublsh2_n.asm    |   5 +-
 mpn/x86_64/core2/sublshC_n.asm    |   4 +-
 mpn/x86_64/coreinhm/aorrlsh_n.asm |  17 +++++++
 mpn/x86_64/coreinhm/gmp-mparam.h  |  92 ++++++++++++++++++++++++++------------
 mpn/x86_64/coreisbr/aors_n.asm    |  14 +++++
 mpn/x86_64/invert_limb.asm        |   6 ++-
 mpn/x86_64/invert_limb_table.asm  |   3 +
 mpn/x86_64/logops_n.asm           |  16 +++++-
 mpn/x86_64/lshift.asm             |  11 ++++-
 mpn/x86_64/lshiftc.asm            |   7 ++-
 mpn/x86_64/lshsub_n.asm           |  16 ++++++-
 mpn/x86_64/mod_1_1.asm            |   7 ++
 mpn/x86_64/mod_1_2.asm            |   9 +++-
 mpn/x86_64/mod_1_4.asm            |  14 ++++-
 mpn/x86_64/mod_34lsub1.asm        |  12 +++-
 mpn/x86_64/mul_2.asm              |   7 ++-
 mpn/x86_64/mulmid_basecase.asm    |  14 +++++-
 mpn/x86_64/popham.asm             |  12 +++-
 mpn/x86_64/redc_1.asm             |   5 ++
 mpn/x86_64/rsh1aors_n.asm         |  17 ++++++-
 mpn/x86_64/rshift.asm             |   7 ++-
 mpn/x86_64/sqr_basecase.asm       |   8 ---
 mpn/x86_64/sublsh1_n.asm          |   7 ++-
 mpn/x86_64/tabselect.asm          |  14 +++++
 48 files changed, 521 insertions(+), 140 deletions(-)

diffs (truncated from 2120 to 300 lines):

diff -r 9c71a3da8dc1 -r 580248e75887 ChangeLog
--- a/ChangeLog	Mon Nov 28 23:13:59 2011 +0100
+++ b/ChangeLog	Tue Nov 29 21:59:39 2011 +0100
@@ -1,3 +1,7 @@
+2011-11-29  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/x86_64: Add DOS64 ABI support to most files.
+
 2011-11-28  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/mul_basecase.asm: Support ABI DOS64.
diff -r 9c71a3da8dc1 -r 580248e75887 configure.in
--- a/configure.in	Mon Nov 28 23:13:59 2011 +0100
+++ b/configure.in	Tue Nov 29 21:59:39 2011 +0100
@@ -1640,7 +1640,6 @@
 	    ;;
 	  *-*-mingw* | *-*-cygwin)
 	    limb_64=longlong
-	    extra_functions_64="" # FIXME: remove when invert_limb is ported
 	    CALLING_CONVENTIONS_OBJS_64=""
 	    AC_DEFINE(HOST_DOS64,1,[Define to 1 for Windos/64])
 	    AC_SUBST(GMP_NONSTD_ABI,DOS64)
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/addmul_2.asm
--- a/mpn/x86_64/addmul_2.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/addmul_2.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -50,10 +50,14 @@
 define(`w3', `%r10')
 define(`n',  `%r11')
 
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
+ASM_START()
 	TEXT
 	ALIGN(16)
-ASM_START()
 PROLOGUE(mpn_addmul_2)
+	DOS64_ENTRY(4)
 	mov	n_param, n
 	push	%rbx
 	push	%rbp
@@ -164,6 +168,7 @@
 
 	pop	%rbp
 	pop	%rbx
+	DOS64_EXIT()
 	ret
 EPILOGUE()
 
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aorrlsh1_n.asm
--- a/mpn/x86_64/aorrlsh1_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aorrlsh1_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -1,7 +1,8 @@
 dnl  AMD64 mpn_addlsh1_n -- rp[] = up[] + (vp[] << 1)
 dnl  AMD64 mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[]
 
-dnl  Copyright 2003, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+dnl  Copyright 2003, 2005, 2006, 2007, 2008, 2009, 2011 Free Software
+dnl  Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -54,10 +55,14 @@
 
 MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_rsblsh1_n)
 
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 ASM_START()
 	TEXT
 	ALIGN(16)
 PROLOGUE(func)
+	DOS64_ENTRY(4)
 	push	%rbp
 
 	mov	(vp), %r8
@@ -147,5 +152,6 @@
 	movslq	R32(%rbp), %rax')
 
 	pop	%rbp
+	DOS64_EXIT()
 	ret
 EPILOGUE()
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aorrlsh2_n.asm
--- a/mpn/x86_64/aorrlsh2_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aorrlsh2_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -3,7 +3,7 @@
 
 dnl  Contributed to the GNU project by Torbjorn Granlund.
 
-dnl  Copyright 2009, 2010 Free Software Foundation, Inc.
+dnl  Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -36,4 +36,7 @@
 
 MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_rsblsh2_n)
 
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 include_mpn(`x86_64/aorrlshC_n.asm')
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aorrlshC_n.asm
--- a/mpn/x86_64/aorrlshC_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aorrlshC_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -1,7 +1,7 @@
 dnl  AMD64 mpn_addlshC_n -- rp[] = up[] + (vp[] << C)
 dnl  AMD64 mpn_rsblshC_n -- rp[] = (vp[] << C) - up[]
 
-dnl  Copyright 2009, 2010 Free Software Foundation, Inc.
+dnl  Copyright 2009, 2010, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -37,10 +37,14 @@
 
 define(M, eval(m4_lshift(1,LSH)))
 
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 ASM_START()
 	TEXT
 	ALIGN(16)
 PROLOGUE(func)
+	DOS64_ENTRY(4)
 	push	%r12
 	push	%r13
 	push	%r14
@@ -140,5 +144,6 @@
 	pop	%r14
 	pop	%r13
 	pop	%r12
+	DOS64_EXIT()
 	ret
 EPILOGUE()
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aorrlsh_n.asm
--- a/mpn/x86_64/aorrlsh_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aorrlsh_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -56,10 +56,23 @@
 
 MULFUNC_PROLOGUE(mpn_addlsh_n mpn_rsblsh_n)
 
+ifdef(`HOST_DOS64',`
+  define(`IFDOS',   `$1')
+  define(`IFELF',   `')
+',`
+  define(`IFDOS',   `')
+  define(`IFELF',   `$1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 ASM_START()
 	TEXT
 	ALIGN(16)
 PROLOGUE(func)
+	DOS64_ENTRY(4)
+IFDOS(`	mov	56(%rsp), %r8d	')
 	push	%r12
 	push	%r13
 	push	%r14
@@ -155,5 +168,6 @@
 	pop	%r14
 	pop	%r13
 	pop	%r12
+	DOS64_EXIT()
 	ret
 EPILOGUE()
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aors_n.asm
--- a/mpn/x86_64/aors_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aors_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -1,7 +1,7 @@
 dnl  AMD64 mpn_add_n, mpn_sub_n
 
-dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2010 Free Software Foundation,
-dnl  Inc.
+dnl  Copyright 2003, 2004, 2005, 2007, 2008, 2010, 2011 Free Software
+dnl  Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -30,15 +30,15 @@
 C Intel atom	 4
 C VIA nano	 3.25
 
-C The inner loop of this code is the result of running a code generation and
+C The loop of this code is the result of running a code generation and
 C optimization tool suite written by David Harvey and Torbjorn Granlund.
 
 C INPUT PARAMETERS
-define(`rp',	`%rdi')
-define(`up',	`%rsi')
-define(`vp',	`%rdx')
-define(`n',	`%rcx')
-define(`cy',	`%r8')		C (only for mpn_add_nc)
+define(`rp',	`%rdi')	C rcx
+define(`up',	`%rsi')	C rdx
+define(`vp',	`%rdx')	C r8
+define(`n',	`%rcx')	C r9
+define(`cy',	`%r8')	C rsp+40    (only for mpn_add_nc)
 
 ifdef(`OPERATION_add_n', `
 	define(ADCSBB,	      adc)
@@ -51,10 +51,23 @@
 
 MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
 
+ifdef(`HOST_DOS64',`
+  define(`IFDOS',   `$1')
+  define(`IFELF',   `')
+',`
+  define(`IFDOS',   `')
+  define(`IFELF',   `$1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 ASM_START()
 	TEXT
 	ALIGN(16)
 PROLOGUE(func_nc)
+	DOS64_ENTRY(4)
+IFDOS(`	mov	56(%rsp), %r8	')
 	mov	R32(n), R32(%rax)
 	shr	$2, n
 	and	$3, R32(%rax)
@@ -69,6 +82,7 @@
 EPILOGUE()
 	ALIGN(16)
 PROLOGUE(func)
+	DOS64_ENTRY(4)
 	mov	R32(n), R32(%rax)
 	shr	$2, n
 	and	$3, R32(%rax)
@@ -85,6 +99,7 @@
 	ADCSBB	(vp), %r8
 	mov	%r8, (rp)
 	adc	R32(%rax), R32(%rax)
+	DOS64_EXIT()
 	ret
 
 L(2):	dec	R32(%rax)
@@ -95,6 +110,7 @@
 	mov	%r8, (rp)
 	mov	%r9, 8(rp)
 	adc	R32(%rax), R32(%rax)
+	DOS64_EXIT()
 	ret
 
 L(3):	mov	16(up), %r10
@@ -105,6 +121,7 @@
 	mov	%r9, 8(rp)
 	mov	%r10, 16(rp)
 	setc	R8(%rax)
+	DOS64_EXIT()
 	ret
 
 	ALIGN(16)
@@ -142,5 +159,6 @@
 	dec	R32(%rax)
 	jnz	L(lt4)
 	adc	R32(%rax), R32(%rax)
+	DOS64_EXIT()
 	ret
 EPILOGUE()
diff -r 9c71a3da8dc1 -r 580248e75887 mpn/x86_64/aorscnd_n.asm
--- a/mpn/x86_64/aorscnd_n.asm	Mon Nov 28 23:13:59 2011 +0100
+++ b/mpn/x86_64/aorscnd_n.asm	Tue Nov 29 21:59:39 2011 +0100
@@ -59,10 +59,23 @@
 
 MULFUNC_PROLOGUE(mpn_addcnd_n mpn_subcnd_n)
 
+ifdef(`HOST_DOS64',`
+  define(`IFDOS',   `$1')
+  define(`IFELF',   `')
+',`
+  define(`IFDOS',   `')
+  define(`IFELF',   `$1')
+')
+
+ABI_SUPPORT(DOS64)
+ABI_SUPPORT(ELF64)
+
 ASM_START()
 	TEXT
 	ALIGN(16)
 PROLOGUE(func)
+	DOS64_ENTRY(4)
+IFDOS(`	mov	56(%rsp), %r8	')
 	push	%rbx
 	push	%rbp
 	push	%r12
@@ -160,5 +173,6 @@
 	pop	%r12
 	pop	%rbp


More information about the gmp-commit mailing list