[Gmp-commit] /var/hg/gmp: Try different jump table for the benefit of broken ...

mercurial at gmplib.org mercurial at gmplib.org
Tue Dec 11 13:29:32 CET 2012


details:   /var/hg/gmp/rev/c5001c11c266
changeset: 15176:c5001c11c266
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Dec 11 13:29:22 2012 +0100
description:
Try different jump table for the benefit of broken Apple linkers.

diffstat:

 ChangeLog                  |   9 +++++++--
 mpn/x86_64/mod_34lsub1.asm |  32 +++++++++++++++++---------------
 2 files changed, 24 insertions(+), 17 deletions(-)

diffs (60 lines):

diff -r b600a9bb52bb -r c5001c11c266 ChangeLog
--- a/ChangeLog	Sun Dec 09 22:28:16 2012 +0100
+++ b/ChangeLog	Tue Dec 11 13:29:22 2012 +0100
@@ -1,7 +1,12 @@
+2012-12-11  Torbjorn Granlund  <tege at gmplib.org>
+
+	* Version 5.1.0 released.
+
+	* mpn/x86_64/mod_34lsub1.asm: Try different jump table for the benefit
+	of broken Apple linkers.
+
 2012-12-09  Torbjorn Granlund  <tege at gmplib.org>
 
-	* Version 5.1.0 released.
-
 	* configure.in: Make GMP_NONSTD_ABI ABI specific.
 
 2012-12-08  Torbjorn Granlund  <tege at gmplib.org>
diff -r b600a9bb52bb -r c5001c11c266 mpn/x86_64/mod_34lsub1.asm
--- a/mpn/x86_64/mod_34lsub1.asm	Sun Dec 09 22:28:16 2012 +0100
+++ b/mpn/x86_64/mod_34lsub1.asm	Tue Dec 11 13:29:22 2012 +0100
@@ -102,21 +102,23 @@
 	sub	$eval(UNROLL*3), %rsi
 	jnc	L(top)
 
-L(end):	LEA(	L(tab), %r8)
-	movslq	36(%r8,%rsi,4), %r10
-	lea	(%r10, %r8), %r8
-	jmp	*%r8
-
-	RODATA
-L(tab):	.long	L(0)-L(tab)
-	.long	L(1)-L(tab)
-	.long	L(2)-L(tab)
-	.long	L(3)-L(tab)
-	.long	L(4)-L(tab)
-	.long	L(5)-L(tab)
-	.long	L(6)-L(tab)
-	.long	L(7)-L(tab)
-	.long	L(8)-L(tab)
+L(end):
+C Handle 0-8 remaining limbs.  The switch code here is zany in an attempt to
+C fit the tiny envelope of code that triggers no Apple bugs
+	lea	L(tab)(%rip), %r8
+	jmp	*72(%r8,%rsi,8)
+	
+	JUMPTABSECT
+	ALIGN(8)
+L(tab):	.quad	L(0)
+	.quad	L(1)
+	.quad	L(2)
+	.quad	L(3)
+	.quad	L(4)
+	.quad	L(5)
+	.quad	L(6)
+	.quad	L(7)
+	.quad	L(8)
 
 	TEXT
 L(6):	add	(ap), %rax


More information about the gmp-commit mailing list