[Gmp-commit] /home/hgfiles/gmp: 3 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Fri May 14 11:41:05 CEST 2010


details:   /home/hgfiles/gmp/rev/48493b32cc3a
changeset: 13634:48493b32cc3a
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu May 13 22:52:01 2010 +0200
description:
Commit some ultrasparc t1 assembly and a gmp-mparam.h.

details:   /home/hgfiles/gmp/rev/ac6f463ca885
changeset: 13635:ac6f463ca885
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu May 13 22:53:06 2010 +0200
description:
Move ultrasparc 1,2,3,4 specific code into ultrasparc1234 subdir.

details:   /home/hgfiles/gmp/rev/beaa098c547e
changeset: 13636:beaa098c547e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Fri May 14 11:40:58 2010 +0200
description:
Use asm code just for GNU C.

diffstat:

 ChangeLog                                   |   27 +
 configure.in                                |    4 +-
 mpn/generic/redc_2.c                        |    2 +-
 mpn/sparc64/add_n.asm                       |  220 ----------
 mpn/sparc64/addmul_1.asm                    |  596 ----------------------------
 mpn/sparc64/addmul_2.asm                    |  540 -------------------------
 mpn/sparc64/lshift.asm                      |  150 -------
 mpn/sparc64/lshiftc.asm                     |  155 -------
 mpn/sparc64/mul_1.asm                       |  569 --------------------------
 mpn/sparc64/rshift.asm                      |  147 ------
 mpn/sparc64/sqr_diagonal.asm                |  331 ---------------
 mpn/sparc64/sub_n.asm                       |  220 ----------
 mpn/sparc64/submul_1.asm                    |   57 --
 mpn/sparc64/ultrasparc1234/add_n.asm        |  220 ++++++++++
 mpn/sparc64/ultrasparc1234/addmul_1.asm     |  596 ++++++++++++++++++++++++++++
 mpn/sparc64/ultrasparc1234/addmul_2.asm     |  540 +++++++++++++++++++++++++
 mpn/sparc64/ultrasparc1234/lshift.asm       |  150 +++++++
 mpn/sparc64/ultrasparc1234/lshiftc.asm      |  155 +++++++
 mpn/sparc64/ultrasparc1234/mul_1.asm        |  569 ++++++++++++++++++++++++++
 mpn/sparc64/ultrasparc1234/rshift.asm       |  147 ++++++
 mpn/sparc64/ultrasparc1234/sqr_diagonal.asm |  331 +++++++++++++++
 mpn/sparc64/ultrasparc1234/sub_n.asm        |  220 ++++++++++
 mpn/sparc64/ultrasparc1234/submul_1.asm     |   57 ++
 mpn/sparc64/ultrasparct1/add_n.asm          |   57 ++
 mpn/sparc64/ultrasparct1/addlsh1_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/addlsh2_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/addlshC_n.asm      |   58 ++
 mpn/sparc64/ultrasparct1/addmul_1.asm       |   75 +++
 mpn/sparc64/ultrasparct1/gmp-mparam.h       |  131 ++++++
 mpn/sparc64/ultrasparct1/lshift.asm         |   59 ++
 mpn/sparc64/ultrasparct1/lshiftc.asm        |   60 ++
 mpn/sparc64/ultrasparct1/mul_1.asm          |   71 +++
 mpn/sparc64/ultrasparct1/rsblsh1_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/rsblsh2_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/rsblshC_n.asm      |   58 ++
 mpn/sparc64/ultrasparct1/rshift.asm         |   61 ++
 mpn/sparc64/ultrasparct1/sub_n.asm          |   57 ++
 mpn/sparc64/ultrasparct1/sublsh1_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/sublsh2_n.asm      |   30 +
 mpn/sparc64/ultrasparct1/sublshC_n.asm      |   58 ++
 mpn/sparc64/ultrasparct1/submul_1.asm       |   75 +++
 41 files changed, 4015 insertions(+), 2988 deletions(-)

diffs (truncated from 7185 to 300 lines):

diff -r 2268a5f09f18 -r beaa098c547e ChangeLog
--- a/ChangeLog	Thu May 13 11:35:37 2010 +0200
+++ b/ChangeLog	Fri May 14 11:40:58 2010 +0200
@@ -1,5 +1,32 @@
+2010-05-14  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/generic/redc_2.c: Use asm code just for GNU C.
+
 2010-05-13  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/sparc64/ultrasparc1234: New directory.  Move all code that uses
+	floating-point into this directory.
+	* configure.in: Point to ultrasparc1234 for appropriate CPUs.
+
+	* mpn/sparc64/ultrasparct1/add_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/addlsh2_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/addmul_1.asm: New file.
+	* mpn/sparc64/ultrasparct1/lshift.asm: New file.
+	* mpn/sparc64/ultrasparct1/mul_1.asm: New file.
+	* mpn/sparc64/ultrasparct1/rsblsh2_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/rshift.asm: New file.
+	* mpn/sparc64/ultrasparct1/sublsh1_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/sublshC_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/addlsh1_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/addlshC_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/lshiftc.asm: New file.
+	* mpn/sparc64/ultrasparct1/rsblsh1_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/rsblshC_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/sub_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/sublsh2_n.asm: New file.
+	* mpn/sparc64/ultrasparct1/submul_1.asm: New file.
+	* mpn/sparc64/ultrasparct1/gmp-mparam.h: New file.
+
 	* configure.in: Give ultrasparct1 and ultrasparct2 special code path.
 
 	* mpn/x86_64/pentium4/gmp-mparam.h: Disable mpn_addlsh_n, mpn_rsblsh_n.
diff -r 2268a5f09f18 -r beaa098c547e configure.in
--- a/configure.in	Thu May 13 11:35:37 2010 +0200
+++ b/configure.in	Fri May 14 11:40:58 2010 +0200
@@ -1241,9 +1241,9 @@
 
 	case $host_cpu in
 	  ultrasparc | ultrasparc2 | ultrasparc2i)
-	    path_64="sparc64/ultrasparc12 sparc64" ;;
+	    path_64="sparc64/ultrasparc1234 sparc64" ;;
 	  ultrasparc3)
-	    path_64="sparc64/ultrasparc34 sparc64/ultrasparc12 sparc64" ;;
+	    path_64="sparc64/ultrasparc34 sparc64/ultrasparc1234 sparc64" ;;
 	  ultrasparct1 | ultrasparct2)
 	    path_64="sparc64/ultrasparct1 sparc64" ;;
 	  *)
diff -r 2268a5f09f18 -r beaa098c547e mpn/generic/redc_2.c
--- a/mpn/generic/redc_2.c	Thu May 13 11:35:37 2010 +0200
+++ b/mpn/generic/redc_2.c	Fri May 14 11:40:58 2010 +0200
@@ -41,7 +41,7 @@
 }
 #endif
 
-#if defined (__ia64) && W_TYPE_SIZE == 64
+#if defined (__GNUC__) && defined (__ia64) && W_TYPE_SIZE == 64
 #define umul2low(ph, pl, uh, ul, vh, vl) \
   do {									\
     mp_limb_t _ph, _pl;							\
diff -r 2268a5f09f18 -r beaa098c547e mpn/sparc64/add_n.asm
--- a/mpn/sparc64/add_n.asm	Thu May 13 11:35:37 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-dnl  SPARC v9 mpn_add_n -- Add two limb vectors of the same length > 0 and
-dnl  store sum in a third limb vector.
-
-dnl  Copyright 2001, 2002, 2003 Free Software Foundation, Inc.
-
-dnl  This file is part of the GNU MP Library.
-
-dnl  The GNU MP Library is free software; you can redistribute it and/or modify
-dnl  it under the terms of the GNU Lesser General Public License as published
-dnl  by the Free Software Foundation; either version 3 of the License, or (at
-dnl  your option) any later version.
-
-dnl  The GNU MP Library is distributed in the hope that it will be useful, but
-dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
-dnl  License for more details.
-
-dnl  You should have received a copy of the GNU Lesser General Public License
-dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C		   cycles/limb
-C UltraSPARC 1&2:     4
-C UltraSPARC 3:	      4.5
-
-C Compute carry-out from the most significant bits of u,v, and r, where
-C r=u+v+carry_in, using logic operations.
-
-C This code runs at 4 cycles/limb on UltraSPARC 1 and 2.  It has a 4 insn
-C recurrency, and the UltraSPARC 1 and 2 the IE units are 100% saturated.
-C Therefore, it seems futile to try to optimize this any further...
-
-C INPUT PARAMETERS
-define(`rp',`%i0')
-define(`up',`%i1')
-define(`vp',`%i2')
-define(`n',`%i3')
-
-define(`u0',`%l0')
-define(`u1',`%l2')
-define(`u2',`%l4')
-define(`u3',`%l6')
-define(`v0',`%l1')
-define(`v1',`%l3')
-define(`v2',`%l5')
-define(`v3',`%l7')
-
-define(`cy',`%i4')
-
-define(`fanop',`fitod %f0,%f2')		dnl  A quasi nop running in the FA pipe
-define(`fmnop',`fmuld %f0,%f0,%f4')	dnl  A quasi nop running in the FM pipe
-
-ASM_START()
-	REGISTER(%g2,#scratch)
-	REGISTER(%g3,#scratch)
-PROLOGUE(mpn_add_n)
-	save	%sp,-160,%sp
-
-	fitod	%f0,%f0		C make sure f0 contains small, quiet number
-	subcc	n,4,%g0
-	bl,pn	%xcc,.Loop0
-	mov	0,cy
-
-	ldx	[up+0],u0
-	ldx	[vp+0],v0
-	add	up,32,up
-	ldx	[up-24],u1
-	ldx	[vp+8],v1
-	add	vp,32,vp
-	ldx	[up-16],u2
-	ldx	[vp-16],v2
-	ldx	[up-8],u3
-	ldx	[vp-8],v3
-	subcc	n,8,n
-	add	u0,v0,%g1	C main add
-	add	%g1,cy,%g4	C carry add
-	or	u0,v0,%g2
-	bl,pn	%xcc,.Lend4567
-	fanop
-	b,a	.Loop
-
-	.align	16
-C START MAIN LOOP
-.Loop:	andn	%g2,%g4,%g2
-	and	u0,v0,%g3
-	ldx	[up+0],u0
-	fanop
-C --
-	or	%g3,%g2,%g2
-	ldx	[vp+0],v0
-	add	up,32,up
-	fanop
-C --
-	srlx	%g2,63,cy
-	add	u1,v1,%g1
-	stx	%g4,[rp+0]
-	fanop
-C --
-	add	%g1,cy,%g4
-	or	u1,v1,%g2
-	fmnop
-	fanop
-C --
-	andn	%g2,%g4,%g2
-	and	u1,v1,%g3
-	ldx	[up-24],u1
-	fanop
-C --
-	or	%g3,%g2,%g2
-	ldx	[vp+8],v1
-	add	vp,32,vp
-	fanop
-C --
-	srlx	%g2,63,cy
-	add	u2,v2,%g1
-	stx	%g4,[rp+8]
-	fanop
-C --
-	add	%g1,cy,%g4
-	or	u2,v2,%g2
-	fmnop
-	fanop
-C --
-	andn	%g2,%g4,%g2
-	and	u2,v2,%g3
-	ldx	[up-16],u2
-	fanop
-C --
-	or	%g3,%g2,%g2
-	ldx	[vp-16],v2
-	add	rp,32,rp
-	fanop
-C --
-	srlx	%g2,63,cy
-	add	u3,v3,%g1
-	stx	%g4,[rp-16]
-	fanop
-C --
-	add	%g1,cy,%g4
-	or	u3,v3,%g2
-	fmnop
-	fanop
-C --
-	andn	%g2,%g4,%g2
-	and	u3,v3,%g3
-	ldx	[up-8],u3
-	fanop
-C --
-	or	%g3,%g2,%g2
-	subcc	n,4,n
-	ldx	[vp-8],v3
-	fanop
-C --
-	srlx	%g2,63,cy
-	add	u0,v0,%g1
-	stx	%g4,[rp-8]
-	fanop
-C --
-	add	%g1,cy,%g4
-	or	u0,v0,%g2
-	bge,pt	%xcc,.Loop
-	fanop
-C END MAIN LOOP
-.Lend4567:
-	andn	%g2,%g4,%g2
-	and	u0,v0,%g3
-	or	%g3,%g2,%g2
-	srlx	%g2,63,cy
-	add	u1,v1,%g1
-	stx	%g4,[rp+0]
-	add	%g1,cy,%g4
-	or	u1,v1,%g2
-	andn	%g2,%g4,%g2
-	and	u1,v1,%g3
-	or	%g3,%g2,%g2
-	srlx	%g2,63,cy
-	add	u2,v2,%g1
-	stx	%g4,[rp+8]
-	add	%g1,cy,%g4
-	or	u2,v2,%g2
-	andn	%g2,%g4,%g2
-	and	u2,v2,%g3
-	or	%g3,%g2,%g2
-	add	rp,32,rp
-	srlx	%g2,63,cy
-	add	u3,v3,%g1
-	stx	%g4,[rp-16]
-	add	%g1,cy,%g4
-	or	u3,v3,%g2
-	andn	%g2,%g4,%g2
-	and	u3,v3,%g3
-	or	%g3,%g2,%g2
-	srlx	%g2,63,cy
-	stx	%g4,[rp-8]
-
-	addcc	n,4,n
-	bz,pn	%xcc,.Lret
-	fanop
-
-.Loop0:	ldx	[up],u0
-	add	up,8,up
-	ldx	[vp],v0
-	add	vp,8,vp
-	add	rp,8,rp
-	subcc	n,1,n
-	add	u0,v0,%g1
-	or	u0,v0,%g2
-	add	%g1,cy,%g4
-	and	u0,v0,%g3
-	andn	%g2,%g4,%g2
-	stx	%g4,[rp-8]
-	or	%g3,%g2,%g2
-	bnz,pt	%xcc,.Loop0
-	srlx	%g2,63,cy
-
-.Lret:	mov	cy,%i0
-	ret
-	restore
-EPILOGUE(mpn_add_n)
diff -r 2268a5f09f18 -r beaa098c547e mpn/sparc64/addmul_1.asm
--- a/mpn/sparc64/addmul_1.asm	Thu May 13 11:35:37 2010 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,596 +0,0 @@
-dnl  SPARC v9 64-bit mpn_addmul_1 -- Multiply a limb vector with a limb and add
-dnl  the result to a second limb vector.
-
-dnl  Copyright 1998, 2000, 2001, 2002, 2003, 2004 Free Software Foundation,
-dnl  Inc.
-
-dnl  This file is part of the GNU MP Library.
-
-dnl  The GNU MP Library is free software; you can redistribute it and/or modify


More information about the gmp-commit mailing list