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

mercurial at gmplib.org mercurial at gmplib.org
Sat Jul 21 19:20:45 CEST 2012


details:   /var/hg/gmp/rev/40ece46d8a4b
changeset: 15072:40ece46d8a4b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jul 21 19:17:48 2012 +0200
description:
Fix r0 clobbering issue with "large" code affecting elf+darwin PIC.

details:   /var/hg/gmp/rev/a6e58bd233d3
changeset: 15073:a6e58bd233d3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jul 21 19:20:43 2012 +0200
description:
Trivial merge.

diffstat:

 ChangeLog                         |  13 +++++++++++--
 gmpxx.h                           |   4 +++-
 mpn/powerpc32/vmx/mod_34lsub1.asm |  17 +++++++++--------
 3 files changed, 23 insertions(+), 11 deletions(-)

diffs (115 lines):

diff -r b5ca16212198 -r a6e58bd233d3 ChangeLog
--- a/ChangeLog	Fri Jun 29 16:37:23 2012 +0200
+++ b/ChangeLog	Sat Jul 21 19:20:43 2012 +0200
@@ -1,3 +1,12 @@
+2012-07-21  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/powerpc32/vmx/mod_34lsub1.asm: Fix r0 clobbering issue with
+	"large" code affecting elf+darwin PIC.
+
+2012-07-21  Marc Glisse  <marc.glisse at inria.fr>
+
+	* gmpxx.h (__GMPXX_CONSTANT): Disable for g++-3.4.
+
 2012-06-26  Torbjorn Granlund  <tege at gmplib.org>
 
 	* Makefile.am (LIBMP_LT_*): Remove these.
@@ -332,7 +341,7 @@
 
 	* mpz/mfac_uiui.c: New file.
 	* Makefile.am: Compile it.
-	* mpz/Makefile.am (libmpz_la_SOURCES): Add mpz_mfac_uiui.c 
+	* mpz/Makefile.am (libmpz_la_SOURCES): Add mpz_mfac_uiui.c
 	* gmp-h.in (mpz_mfac_uiui): Declare.
 
 	* tests/mpz/t-mfac_uiui.c: New file.
@@ -961,7 +970,7 @@
 	* mpz/abs.c: Collapse MPZ_REALLOC(x,.) and PTR(x).
 	* mpz/aors_ui.h: Likewise.
 	* mpz/com.c: Likewise.
-        * mpz/neg.c: Likewise.
+	* mpz/neg.c: Likewise.
 
 	* mpz/invert.c: Reply "no-inverse" when modulus is zero.
 	* tests/mpz/t-invert.c: Add more checks.
diff -r b5ca16212198 -r a6e58bd233d3 gmpxx.h
--- a/gmpxx.h	Fri Jun 29 16:37:23 2012 +0200
+++ b/gmpxx.h	Sat Jul 21 19:20:43 2012 +0200
@@ -32,7 +32,9 @@
 #include <gmp.h>
 
 // wrapper for gcc's __builtin_constant_p
-#if defined (__GNUC__) && __GNUC__ >= 2
+// __builtin_constant_p has been in gcc since forever,
+// but g++-3.4 miscompiles it.
+#if __GMP_GNUC_PREREQ(4, 2)
 #define __GMPXX_CONSTANT(X) __builtin_constant_p(X)
 #else
 #define __GMPXX_CONSTANT(X) false
diff -r b5ca16212198 -r a6e58bd233d3 mpn/powerpc32/vmx/mod_34lsub1.asm
--- a/mpn/powerpc32/vmx/mod_34lsub1.asm	Fri Jun 29 16:37:23 2012 +0200
+++ b/mpn/powerpc32/vmx/mod_34lsub1.asm	Sat Jul 21 19:20:43 2012 +0200
@@ -1,6 +1,7 @@
 dnl  PowerPC-32 mpn_mod_34lsub1 -- mpn remainder mod 2^24-1.
 
-dnl  Copyright 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+dnl  Copyright 2002, 2003, 2005, 2006, 2007, 2012 Free Software Foundation,
+dnl  Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -135,15 +136,15 @@
 
 	andi.	r7, up, 15
 	vxor	a0, v0, v0
-	lis	r0, 0xaaaa
+	lis	r9, 0xaaaa
 	vxor	a1, v0, v0
-	ori	r0, r0, 0xaaab
+	ori	r9, r9, 0xaaab
 	vxor	a2, v0, v0
 	li	r5, 16
 	vxor	c0, v0, v0
 	li	r6, 32
 	vxor	c1, v0, v0
-	LEAL(	r11, cnsts)
+	LEAL(	r11, cnsts)		C CAUTION clobbers r0 for elf, darwin
 	vxor	c2, v0, v0
 	vxor	z, v0, v0
 
@@ -158,7 +159,7 @@
 	vsldoi	a2, z, a2, 12
 
 	addi	n, n, 9
-	mulhwu	r0, n, r0
+	mulhwu	r0, n, r9
 	srwi	r0, r0, 3		C r0 = floor(n/12)
 	mtctr	r0
 
@@ -174,7 +175,7 @@
 	vsldoi	a1, z, a1, 8
 
 	addi	n, n, 6
-	mulhwu	r0, n, r0
+	mulhwu	r0, n, r9
 	srwi	r0, r0, 3		C r0 = floor(n/12)
 	mtctr	r0
 
@@ -188,7 +189,7 @@
 	vsldoi	a0, z, a0, 4
 
 	addi	n, n, 3
-	mulhwu	r0, n, r0
+	mulhwu	r0, n, r9
 	srwi	r0, r0, 3		C r0 = floor(n/12)
 	mtctr	r0
 
@@ -197,7 +198,7 @@
 	b	L(0)
 
 L(aligned16):
-	mulhwu	r0, n, r0
+	mulhwu	r0, n, r9
 	srwi	r0, r0, 3		C r0 = floor(n/12)
 	mtctr	r0
 


More information about the gmp-commit mailing list