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

mercurial at gmplib.org mercurial at gmplib.org
Mon Mar 14 17:13:49 CET 2011


details:   /var/hg/gmp/rev/ff0a7cdf06fd
changeset: 14058:ff0a7cdf06fd
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 14 16:06:57 2011 +0100
description:
Add _nc entry point.

details:   /var/hg/gmp/rev/243038551263
changeset: 14059:243038551263
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 14 17:13:27 2011 +0100
description:
Make reference to "Formatted I/O" chapters from type specific I/O sections.

details:   /var/hg/gmp/rev/d1436d3718b9
changeset: 14060:d1436d3718b9
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 14 17:13:32 2011 +0100
description:
*** empty log message ***

diffstat:

 ChangeLog                            |  17 +++++++++++++++--
 doc/gmp.texi                         |  27 +++++++++++++++++----------
 mpn/alpha/add_n.asm                  |  21 ++++++++++++++-------
 mpn/alpha/sub_n.asm                  |  21 ++++++++++++++-------
 mpn/mips64/add_n.asm                 |  15 +++++++++++++--
 mpn/mips64/sub_n.asm                 |  15 +++++++++++++--
 mpn/sparc64/ultrasparc1234/add_n.asm |  16 +++++++++++++---
 mpn/sparc64/ultrasparc1234/sub_n.asm |  14 ++++++++++++--
 8 files changed, 111 insertions(+), 35 deletions(-)

diffs (truncated from 373 to 300 lines):

diff -r 8eb472d5c7c4 -r d1436d3718b9 ChangeLog
--- a/ChangeLog	Sun Mar 13 21:30:23 2011 +0100
+++ b/ChangeLog	Mon Mar 14 17:13:32 2011 +0100
@@ -1,3 +1,15 @@
+2011-03-14  Torbjorn Granlund  <tege at gmplib.org>
+
+	* doc/gmp.texi: Make reference to "Formatted I/O" chapters from type
+	specific I/O sections.
+
+	* mpn/alpha/add_n.asm: Add _nc entry point.
+	* mpn/alpha/sub_n.asm: Likewise.
+	* mpn/mips64/add_n.asm: Likewise.
+	* mpn/mips64/sub_n.asm: Likewise.
+	* mpn/sparc64/ultrasparc1234/add_n.asm: Likewise.
+	* mpn/sparc64/ultrasparc1234/sub_n: Likewise.
+
 2011-03-13  Marc Glisse  <marc.glisse at inria.fr>
 
 	* tests/cxx/t-ops2.cc: New file.
@@ -5,6 +17,9 @@
 
 2011-03-13  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/generic/toom32_mul.c (mpn_toom32_mul): Make 'hi' be limb-sized
+	for better code.
+
 	* gmp-impl.h (MPN_IORD_U): Handle x86_64 as well as x86_32.  Generate
 	no code for incrementing by constant 0.
 
@@ -35,7 +50,6 @@
 	udiv_qrnnd_preinv2gen): Remove obsolete macros.
 	(udiv_qrnnd_preinv): New name for udiv_qrnnd_preinv3.
 
-
 2011-03-11 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* gmp-impl.h: Declare many mpn_{sub,add}lsh*_n_ip[12] functions/macros.
@@ -5297,7 +5311,6 @@
 	usable for local symbols.
 	(LEA): Replace with code for external references.
 
-
 	* mpn/powerpc32/vmx/mod_34lsub1.asm: Use LEAL.
 
 2007-10-07  Torbjorn Granlund  <tege at swox.com>
diff -r 8eb472d5c7c4 -r d1436d3718b9 doc/gmp.texi
--- a/doc/gmp.texi	Sun Mar 13 21:30:23 2011 +0100
+++ b/doc/gmp.texi	Mon Mar 14 17:13:32 2011 +0100
@@ -3793,14 +3793,16 @@
 @cindex I/O functions
 
 Functions that perform input from a stdio stream, and functions that output to
-a stdio stream.  Passing a @code{NULL} pointer for a @var{stream} argument to any of
-these functions will make them read from @code{stdin} and write to
- at code{stdout}, respectively.
+a stdio stream, of @code{mpz} numbers.  Passing a @code{NULL} pointer for a
+ at var{stream} argument to any of these functions will make them read from
+ at code{stdin} and write to @code{stdout}, respectively.
 
 When using any of these functions, it is a good idea to include @file{stdio.h}
 before @file{gmp.h}, since that will allow @file{gmp.h} to define prototypes
 for these functions.
 
+See also @ref{Formatted Output} and @ref{Formatted Input}.
+
 @deftypefun size_t mpz_out_str (FILE *@var{stream}, int @var{base}, mpz_t @var{op})
 Output @var{op} on stdio stream @var{stream}, as a string of digits in base
 @var{base}.  The base argument may vary from 2 to 62 or from @minus{}2 to
@@ -4416,13 +4418,16 @@
 @cindex Output functions
 @cindex I/O functions
 
-When using any of these functions, it's a good idea to include @file{stdio.h}
+Functions that perform input from a stdio stream, and functions that output to
+a stdio stream, of @code{mpq} numbers.  Passing a @code{NULL} pointer for a
+ at var{stream} argument to any of these functions will make them read from
+ at code{stdin} and write to @code{stdout}, respectively.
+
+When using any of these functions, it is a good idea to include @file{stdio.h}
 before @file{gmp.h}, since that will allow @file{gmp.h} to define prototypes
 for these functions.
 
-Passing a @code{NULL} pointer for a @var{stream} argument to any of these
-functions will make them read from @code{stdin} and write to @code{stdout},
-respectively.
+See also @ref{Formatted Output} and @ref{Formatted Input}.
 
 @deftypefun size_t mpq_out_str (FILE *@var{stream}, int @var{base}, mpq_t @var{op})
 Output @var{op} on stdio stream @var{stream}, as a string of digits in base
@@ -4917,14 +4922,16 @@
 @cindex I/O functions
 
 Functions that perform input from a stdio stream, and functions that output to
-a stdio stream.  Passing a @code{NULL} pointer for a @var{stream} argument to
-any of these functions will make them read from @code{stdin} and write to
- at code{stdout}, respectively.
+a stdio stream, of @code{mpf} numbers.  Passing a @code{NULL} pointer for a
+ at var{stream} argument to any of these functions will make them read from
+ at code{stdin} and write to @code{stdout}, respectively.
 
 When using any of these functions, it is a good idea to include @file{stdio.h}
 before @file{gmp.h}, since that will allow @file{gmp.h} to define prototypes
 for these functions.
 
+See also @ref{Formatted Output} and @ref{Formatted Input}.
+
 @deftypefun size_t mpf_out_str (FILE *@var{stream}, int @var{base}, size_t @var{n_digits}, mpf_t @var{op})
 Print @var{op} to @var{stream}, as a string of digits.  Return the number of
 bytes written, or if an error occurred, return 0.
diff -r 8eb472d5c7c4 -r d1436d3718b9 mpn/alpha/add_n.asm
--- a/mpn/alpha/add_n.asm	Sun Mar 13 21:30:23 2011 +0100
+++ b/mpn/alpha/add_n.asm	Mon Mar 14 17:13:32 2011 +0100
@@ -1,7 +1,7 @@
 dnl  Alpha mpn_add_n -- Add two limb vectors of the same length > 0 and
 dnl  store sum in a third limb vector.
 
-dnl  Copyright 1995, 1999, 2000, 2005 Free Software Foundation, Inc.
+dnl  Copyright 1995, 1999, 2000, 2005, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -32,9 +32,13 @@
 dnl  size	r19
 
 ASM_START()
+PROLOGUE(mpn_add_nc)
+	bis	r20,r31,r25
+	br	L(com)
+EPILOGUE()
 PROLOGUE(mpn_add_n)
 	bis	r31,r31,r25		C clear cy
-	subq	r19,4,r19		C decr loop cnt
+L(com):	subq	r19,4,r19		C decr loop cnt
 	blt	r19,$Lend2		C if less than 4 limbs, goto 2nd loop
 C Start software pipeline for 1st loop
 	ldq	r0,0(r18)
@@ -42,13 +46,16 @@
 	ldq	r1,8(r18)
 	ldq	r5,8(r17)
 	addq	r17,32,r17		C update s1_ptr
+	addq	r0,r4,r28		C 1st main add
 	ldq	r2,16(r18)
-	addq	r0,r4,r20		C 1st main add
+	addq	r25,r28,r20		C 1st carry add
 	ldq	r3,24(r18)
+	cmpult	r28,r4,r8		C compute cy from last add
+	ldq	r6,-16(r17)
+	cmpult	r20,r28,r25		C compute cy from last add
+	ldq	r7,-8(r17)
+	bis	r8,r25,r25		C combine cy from the two adds
 	subq	r19,4,r19		C decr loop cnt
-	ldq	r6,-16(r17)
-	cmpult	r20,r0,r25		C compute cy from last add
-	ldq	r7,-8(r17)
 	addq	r1,r5,r28		C 2nd main add
 	addq	r18,32,r18		C update s2_ptr
 	addq	r28,r25,r21		C 2nd carry add
@@ -142,5 +149,5 @@
 
 $Lret:	bis	r25,r31,r0		C return cy
 	ret	r31,(r26),1
-EPILOGUE(mpn_add_n)
+EPILOGUE()
 ASM_END()
diff -r 8eb472d5c7c4 -r d1436d3718b9 mpn/alpha/sub_n.asm
--- a/mpn/alpha/sub_n.asm	Sun Mar 13 21:30:23 2011 +0100
+++ b/mpn/alpha/sub_n.asm	Mon Mar 14 17:13:32 2011 +0100
@@ -1,7 +1,7 @@
 dnl  Alpha mpn_sub_n -- Subtract two limb vectors of the same length > 0
 dnl  and store difference in a third limb vector.
 
-dnl  Copyright 1995, 1999, 2000, 2005 Free Software Foundation, Inc.
+dnl  Copyright 1995, 1999, 2000, 2005, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -32,9 +32,13 @@
 dnl  size	r19
 
 ASM_START()
+PROLOGUE(mpn_sub_nc)
+	bis	r31,r20,r25
+	br	L(com)
+EPILOGUE()
 PROLOGUE(mpn_sub_n)
 	bis	r31,r31,r25		C clear cy
-	subq	r19,4,r19		C decr loop cnt
+L(com):	subq	r19,4,r19		C decr loop cnt
 	blt	r19,$Lend2		C if less than 4 limbs, goto 2nd loop
 C Start software pipeline for 1st loop
 	ldq	r0,0(r18)
@@ -42,13 +46,16 @@
 	ldq	r1,8(r18)
 	ldq	r5,8(r17)
 	addq	r17,32,r17		C update s1_ptr
+	subq	r4,r0,r28		C 1st main subtract
 	ldq	r2,16(r18)
-	subq	r4,r0,r20		C 1st main subtract
+	subq	r28,r25,r20		C 1st carry subtract
 	ldq	r3,24(r18)
+	cmpult	r4,r0,r8		C compute cy from last subtract
+	ldq	r6,-16(r17)
+	cmpult	r28,r25,r25		C compute cy from last subtract
+	ldq	r7,-8(r17)
+	bis	r8,r25,r25		C combine cy from the two subtracts
 	subq	r19,4,r19		C decr loop cnt
-	ldq	r6,-16(r17)
-	cmpult	r4,r0,r25		C compute cy from last subtract
-	ldq	r7,-8(r17)
 	subq	r5,r1,r28		C 2nd main subtract
 	addq	r18,32,r18		C update s2_ptr
 	subq	r28,r25,r21		C 2nd carry subtract
@@ -142,5 +149,5 @@
 
 $Lret:	bis	r25,r31,r0		C return cy
 	ret	r31,(r26),1
-EPILOGUE(mpn_sub_n)
+EPILOGUE()
 ASM_END()
diff -r 8eb472d5c7c4 -r d1436d3718b9 mpn/mips64/add_n.asm
--- a/mpn/mips64/add_n.asm	Sun Mar 13 21:30:23 2011 +0100
+++ b/mpn/mips64/add_n.asm	Mon Mar 14 17:13:32 2011 +0100
@@ -1,7 +1,7 @@
 dnl  MIPS64 mpn_add_n -- Add two limb vectors of the same length > 0 and store
 dnl  sum in a third limb vector.
 
-dnl  Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc.
+dnl  Copyright 1995, 2000, 2001, 2002, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -27,6 +27,17 @@
 C size		$7
 
 ASM_START()
+PROLOGUE(mpn_add_nc)
+	ld	$10,0($5)
+	ld	$11,0($6)
+
+	daddiu	$7,$7,-1
+	and	$9,$7,4-1	C number of limbs in first loop
+	beq	$9,$0,.L0	C if multiple of 4 limbs, skip first loop
+	 move	$2,$8
+	b	.Loop0
+	 dsubu	$7,$7,$9
+EPILOGUE()
 PROLOGUE(mpn_add_n)
 	ld	$10,0($5)
 	ld	$11,0($6)
@@ -109,4 +120,4 @@
 	sd	$11,0($4)
 	j	$31
 	or	$2,$2,$8
-EPILOGUE(mpn_add_n)
+EPILOGUE()
diff -r 8eb472d5c7c4 -r d1436d3718b9 mpn/mips64/sub_n.asm
--- a/mpn/mips64/sub_n.asm	Sun Mar 13 21:30:23 2011 +0100
+++ b/mpn/mips64/sub_n.asm	Mon Mar 14 17:13:32 2011 +0100
@@ -1,7 +1,7 @@
 dnl  MIPS64 mpn_sub_n -- Subtract two limb vectors of the same length > 0 and
 dnl  store difference in a third limb vector.
 
-dnl  Copyright 1995, 2000, 2001, 2002 Free Software Foundation, Inc.
+dnl  Copyright 1995, 2000, 2001, 2002, 2011 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -27,6 +27,17 @@
 C size		$7
 
 ASM_START()
+PROLOGUE(mpn_sub_nc)
+	ld	$10,0($5)
+	ld	$11,0($6)
+
+	daddiu	$7,$7,-1
+	and	$9,$7,4-1	C number of limbs in first loop
+	beq	$9,$0,.L0	C if multiple of 4 limbs, skip first loop
+	 move	$2,$8
+	b	.Loop0
+	 dsubu	$7,$7,$9
+EPILOGUE()
 PROLOGUE(mpn_sub_n)
 	ld	$10,0($5)
 	ld	$11,0($6)
@@ -109,4 +120,4 @@
 	sd	$11,0($4)
 	j	$31
 	or	$2,$2,$8
-EPILOGUE(mpn_sub_n)
+EPILOGUE()
diff -r 8eb472d5c7c4 -r d1436d3718b9 mpn/sparc64/ultrasparc1234/add_n.asm
--- a/mpn/sparc64/ultrasparc1234/add_n.asm	Sun Mar 13 21:30:23 2011 +0100
+++ b/mpn/sparc64/ultrasparc1234/add_n.asm	Mon Mar 14 17:13:32 2011 +0100
@@ -1,7 +1,7 @@
 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  Copyright 2001, 2002, 2003, 2011 Free Software Foundation, Inc.


More information about the gmp-commit mailing list