[Gmp-commit] /var/hg/gmp: Update sparc64 PIC.

mercurial at gmplib.org mercurial at gmplib.org
Mon Apr 15 21:32:21 CEST 2013


details:   /var/hg/gmp/rev/827551142828
changeset: 15718:827551142828
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Apr 15 21:32:16 2013 +0200
description:
Update sparc64 PIC.

diffstat:

 ChangeLog                                |   5 +++++
 mpn/sparc64/gcd_1.asm                    |  15 +++++----------
 mpn/sparc64/ultrasparct3/dive_1.asm      |  17 +++++------------
 mpn/sparc64/ultrasparct3/invert_limb.asm |  15 +++++++++++++++
 mpn/sparc64/ultrasparct3/mode1o.asm      |  17 +++++------------
 5 files changed, 35 insertions(+), 34 deletions(-)

diffs (141 lines):

diff -r 072b7964204b -r 827551142828 ChangeLog
--- a/ChangeLog	Mon Apr 15 16:30:00 2013 +0200
+++ b/ChangeLog	Mon Apr 15 21:32:16 2013 +0200
@@ -1,5 +1,10 @@
 2013-04-15  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/sparc64/gcd_1.asm: Use rdpc for PIC.
+	* mpn/sparc64/ultrasparct3/mode1o.asm: Use rdpc for PIC.
+	* mpn/sparc64/ultrasparct3/dive_1.asm: Use rdpc for PIC.
+	* mpn/sparc64/ultrasparct3/invert_limb.asm: Handle PIC, use rdpc.
+
 	* Revert remaining parts of recent sparc LEA changes.
 
 2013-04-14  David S. Miller  <davem at davemloft.net>
diff -r 072b7964204b -r 827551142828 mpn/sparc64/gcd_1.asm
--- a/mpn/sparc64/gcd_1.asm	Mon Apr 15 16:30:00 2013 +0200
+++ b/mpn/sparc64/gcd_1.asm	Mon Apr 15 21:32:16 2013 +0200
@@ -95,12 +95,13 @@
 L(noreduce):
 
 ifdef(`PIC',`
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
-	call	L(LGETPC0)
-	add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
+	rd	%pc, %g3
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_+4), %g4
+	add	%g4, %lo(_GLOBAL_OFFSET_TABLE_+8), %g4
+	add	%g3, %g4, %g4
 	sethi	%hi(ctz_table), %g1
 	or	%g1, %lo(ctz_table), %g1
-	ldx	[%l7+%g1], %i5
+	ldx	[%g4+%g1], %i5
 ',`
 	sethi	%hh(ctz_table), %l7
 	or	%l7, %hm(ctz_table), %l7
@@ -135,10 +136,4 @@
 L(shift_alot):
 	b	L(mid)
 	 and	%o0, MASK, %g3		C
-
-ifdef(`PIC',`
-L(LGETPC0):
-	retl
-	add	%o7, %l7, %l7
-')
 EPILOGUE()
diff -r 072b7964204b -r 827551142828 mpn/sparc64/ultrasparct3/dive_1.asm
--- a/mpn/sparc64/ultrasparct3/dive_1.asm	Mon Apr 15 16:30:00 2013 +0200
+++ b/mpn/sparc64/ultrasparct3/dive_1.asm	Mon Apr 15 21:32:16 2013 +0200
@@ -55,14 +55,13 @@
 	and	%g1, 127, %g1
 
 ifdef(`PIC',`
-C	save	%sp, -192, %sp
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
-	call	L(GETPC0)
-	add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
+	rd	%pc, %g3
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_+4), %g4
+	add	%g4, %lo(_GLOBAL_OFFSET_TABLE_+8), %g4
+	add	%g3, %g4, %g4
 	sethi	%hi(binvert_limb_table), %g2
 	or	%g2, %lo(binvert_limb_table), %g2
-	ldx	[%l7+%g2], %g2
-C	restore
+	ldx	[%g4+%g2], %g2
 ',`
 	sethi	%hh(binvert_limb_table), %g3
 	or	%g3, %hm(binvert_limb_table), %g3
@@ -131,10 +130,4 @@
 
 	return	%i7+8
 	 nop
-
-ifdef(`PIC',`
-L(GETPC0):
-	retl
-	add	%o7, %l7, %l7
-')
 EPILOGUE()
diff -r 072b7964204b -r 827551142828 mpn/sparc64/ultrasparct3/invert_limb.asm
--- a/mpn/sparc64/ultrasparct3/invert_limb.asm	Mon Apr 15 16:30:00 2013 +0200
+++ b/mpn/sparc64/ultrasparct3/invert_limb.asm	Mon Apr 15 21:32:16 2013 +0200
@@ -34,8 +34,23 @@
 PROLOGUE(mpn_invert_limb)
 	srlx	d, 55, %g1
 	add	%g1, %g1, %g1
+
+ifdef(`PIC',`
+	rd	%pc, %g3
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_+4), %g4
+	add	%g4, %lo(_GLOBAL_OFFSET_TABLE_+8), %g4
+	add	%g3, %g4, %g4
 	sethi	%hi(approx_tab-512), %g2
 	or	%g2, %lo(approx_tab-512), %g2
+	ldx	[%g4+%g2], %g2
+',`
+	sethi	%hh(approx_tab-512), %g3
+	or	%g3, %hm(approx_tab-512), %g3
+	sllx	%g3, 32, %g3
+	sethi	%lm(approx_tab-512), %g2
+	add	%g3, %g2, %g3
+	or	%g3, %lo(approx_tab-512), %g2
+')
 	lduh	[%g2+%g1], %g3
 	srlx	d, 24, %g4
 	add	%g4, 1, %g4
diff -r 072b7964204b -r 827551142828 mpn/sparc64/ultrasparct3/mode1o.asm
--- a/mpn/sparc64/ultrasparct3/mode1o.asm	Mon Apr 15 16:30:00 2013 +0200
+++ b/mpn/sparc64/ultrasparct3/mode1o.asm	Mon Apr 15 21:32:16 2013 +0200
@@ -42,14 +42,13 @@
 	and	%g1, 127, %g1
 
 ifdef(`PIC',`
-	save	%sp, -192, %sp
-	sethi	%hi(_GLOBAL_OFFSET_TABLE_-4), %l7
-	call	L(GETPC0)
-	add	%l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7
+	rd	%pc, %g3
+	sethi	%hi(_GLOBAL_OFFSET_TABLE_+4), %g4
+	add	%g4, %lo(_GLOBAL_OFFSET_TABLE_+8), %g4
+	add	%g3, %g4, %g4
 	sethi	%hi(binvert_limb_table), %g2
 	or	%g2, %lo(binvert_limb_table), %g2
-	ldx	[%l7+%g2], %g2
-	restore
+	ldx	[%g4+%g2], %g2
 ',`
 	sethi	%hh(binvert_limb_table), %g3
 	or	%g3, %hm(binvert_limb_table), %g3
@@ -84,10 +83,4 @@
 
 	retl
 	 mov	cy, %o0
-
-ifdef(`PIC',`
-L(GETPC0):
-	retl
-	add	%o7, %l7, %l7
-')
 EPILOGUE()


More information about the gmp-commit mailing list