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

mercurial at gmplib.org mercurial at gmplib.org
Wed Oct 16 19:57:07 CEST 2013


details:   /var/hg/gmp/rev/86d73fe37e85
changeset: 16048:86d73fe37e85
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 18:50:11 2013 +0200
description:
(PROLOGUE): Provide "..ng" post-gp label.

details:   /var/hg/gmp/rev/8bcb9d8e4e40
changeset: 16049:8bcb9d8e4e40
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 18:51:02 2013 +0200
description:
Use provided gp mechanisms.

details:   /var/hg/gmp/rev/2f24a7c175fa
changeset: 16050:2f24a7c175fa
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 18:52:04 2013 +0200
description:
Align table to 8-byte boundary.  Make code work if table is not fully aligned.  Properly test for BWX.

details:   /var/hg/gmp/rev/bbaa591bdede
changeset: 16051:bbaa591bdede
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 18:53:32 2013 +0200
description:
(DATASTART): Accept optional align parameter.

details:   /var/hg/gmp/rev/6af9c42fcb82
changeset: 16052:6af9c42fcb82
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 18:54:32 2013 +0200
description:
Clarify a comment.

details:   /var/hg/gmp/rev/07f8ac01f0a6
changeset: 16053:07f8ac01f0a6
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 19:55:27 2013 +0200
description:
Let AMD64 cpuid bit override pessimistic cpu guesses.

details:   /var/hg/gmp/rev/6fb39224cfd3
changeset: 16054:6fb39224cfd3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Oct 16 19:56:52 2013 +0200
description:
ChangeLog

diffstat:

 ChangeLog                   |  10 ++++++++++
 config.guess                |  15 ++++++++++-----
 mpn/alpha/default.m4        |   7 ++++---
 mpn/alpha/divrem_2.asm      |   7 +++----
 mpn/alpha/invert_limb.asm   |   7 ++++---
 mpn/alpha/unicos.m4         |   5 +++--
 mpn/generic/sbpi1_div_sec.c |   2 +-
 7 files changed, 35 insertions(+), 18 deletions(-)

diffs (167 lines):

diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 ChangeLog
--- a/ChangeLog	Tue Oct 15 22:42:24 2013 +0200
+++ b/ChangeLog	Wed Oct 16 19:56:52 2013 +0200
@@ -1,3 +1,13 @@
+2013-10-16  Torbjorn Granlund  <tege at gmplib.org>
+
+	* config.guess: Let AMD64 cpuid bit override pessimistic cpu guesses.
+
+	* mpn/alpha/unicos.m4 (DATASTART): Accept optional align parameter.
+	* mpn/alpha/divrem_2.asm: Use provided gp mechanisms.
+	* mpn/alpha/default.m4 (PROLOGUE): Provide "..ng" post-gp label.
+	* mpn/alpha/invert_limb.asm: Align table to 8-byte boundary.  Make code
+	work if table is not fully aligned.  Properly test for BWX.
+
 2013-10-15  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/alpha/default.m4 (DATASTART): Use RODATA instead of DATA;
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 config.guess
--- a/config.guess	Tue Oct 15 22:42:24 2013 +0200
+++ b/config.guess	Wed Oct 16 19:56:52 2013 +0200
@@ -747,6 +747,7 @@
   int family, model, stepping;
   const char *modelstr;
   int cpu_64bit = 0;
+  int cpuid_64bit;
 
   CPUID (vendor_string, 0);
   vendor_string[12] = 0;
@@ -857,11 +858,15 @@
 	}
     }
 
-  /* If our cpuid-based exact guess is more conservative than the previous
-     guess, revert.  This is of course wrong, but it can happen in an emulator,
-     so this workaround allows for successful 64-bit builds.  */
-  if (strcmp ("$guess_cpu", "x86_64") == 0 && ! cpu_64bit)
-    modelstr = "$guess_cpu";
+  CPUID (dummy_string, 0x80000001);
+  cpuid_64bit = (dummy_string[7] >> 5) & 1;
+
+  /* If our cpuid-based CPU identification thinks this is a 32-bit CPU but
+     cpuid claims AMD64 capabilities, then revert to the generic "x86_64".
+     This is of course wrong, but it can happen in some emulators, so this
+     workaround allows for successful 64-bit builds.  */
+  if (cpuid_64bit && ! cpu_64bit)
+    modelstr = "x86_64";
 
   printf ("%s", modelstr);
   return 0;
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 mpn/alpha/default.m4
--- a/mpn/alpha/default.m4	Tue Oct 15 22:42:24 2013 +0200
+++ b/mpn/alpha/default.m4	Wed Oct 16 19:56:52 2013 +0200
@@ -53,8 +53,9 @@
 	.globl	$1
 	.ent	$1
 $1:
-ifelse(`$2',gp,`	ldgp	r29,0(r27)')
-	.frame r30,0,r26
+	.frame r30,0,r26,0
+ifelse(`$2',gp,`	ldgp	r29, 0(r27)
+`$'$1..ng:')
 	.prologue ifelse(`$2',gp,1,0)')
 
 define(`EPILOGUE_cpu',
@@ -105,7 +106,7 @@
 dnl  Load a symbolic address into a register
 define(`LEA',
 m4_assert_numargs(2)
-`lda   $1,  $2')
+`lda	$1, $2')
 
 dnl  Usage: ASM_END()
 define(`ASM_END',
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 mpn/alpha/divrem_2.asm
--- a/mpn/alpha/divrem_2.asm	Tue Oct 15 22:42:24 2013 +0200
+++ b/mpn/alpha/divrem_2.asm	Wed Oct 16 19:56:52 2013 +0200
@@ -1,6 +1,6 @@
 dnl  Alpha mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
 
-dnl  Copyright 2007, 2008 Free Software Foundation, Inc.
+dnl  Copyright 2007, 2008, 2013 Free Software Foundation, Inc.
 
 dnl  This file is part of the GNU MP Library.
 
@@ -41,8 +41,7 @@
 define(`dp',		`r20')
 
 ASM_START()
-PROLOGUE(mpn_divrem_2)
-	ldgp	r29, 0(r27)
+PROLOGUE(mpn_divrem_2,gp)
 	lda	r30, -80(r30)
 	stq	r26, 0(r30)
 	stq	r9, 8(r30)
@@ -80,7 +79,7 @@
 	blt	r19, L(L10)
 	bis	r31, r12, r16
 	jsr	r26, mpn_invert_limb
-	ldgp	r29, 0(r26)
+	LDGP(	r29, 0(r26))
 	mulq	r0, r12, r4		C t0 = LO(di * d1)
 	umulh	r0, r10, r2		C s1 = HI(di * d0)
 	addq	r4, r10, r4		C t0 += d0
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 mpn/alpha/invert_limb.asm
--- a/mpn/alpha/invert_limb.asm	Tue Oct 15 22:42:24 2013 +0200
+++ b/mpn/alpha/invert_limb.asm	Wed Oct 16 19:56:52 2013 +0200
@@ -37,11 +37,10 @@
 	bic	r1, 1, r7
 	lda	r4, 1(r4)
 	srl	r16, 1, r3
-ifdef(`BWX',`
 	addq	r7, r2, r1
+ifelse(bwx_available_p,1,`
 	ldwu	r0, -512(r1)
 ',`
-	addq	r1, r2, r1
 	ldq_u	r0, -512(r1)
 	extwl	r0, r7, r0
 ')
@@ -76,9 +75,11 @@
 	subq	r0, r3, r0
 	ret	r31, (r26), 1
 EPILOGUE()
-DATASTART(approx_tab,2)
+DATASTART(approx_tab,8)
 forloop(i,256,512-1,dnl
 `	.word	eval(0x7fd00/i)
 ')dnl
+	SIZE(approx_tab, 512)
+	TYPE(approx_tab, object)
 DATAEND()
 ASM_END()
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 mpn/alpha/unicos.m4
--- a/mpn/alpha/unicos.m4	Tue Oct 15 22:42:24 2013 +0200
+++ b/mpn/alpha/unicos.m4	Wed Oct 16 19:56:52 2013 +0200
@@ -3,7 +3,7 @@
 dnl  m4 macros for alpha assembler on unicos.
 
 
-dnl  Copyright 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+dnl  Copyright 2000, 2002, 2003, 2004, 2013 Free Software Foundation, Inc.
 dnl
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -75,8 +75,9 @@
 `	.extern	$1')
 
 define(`DATASTART',
-m4_assert_numargs(1)
+m4_assert_numargs_range(1,2)
 `	.psect	$1 at crud,data
+	ALIGN(ifelse($#,1,2,$2))
 $1:')
 
 define(`DATAEND',
diff -r 4fa4b9b52bd5 -r 6fb39224cfd3 mpn/generic/sbpi1_div_sec.c
--- a/mpn/generic/sbpi1_div_sec.c	Tue Oct 15 22:42:24 2013 +0200
+++ b/mpn/generic/sbpi1_div_sec.c	Wed Oct 16 19:56:52 2013 +0200
@@ -31,7 +31,7 @@
 
 /* This side-channel silent division algorithm reduces the partial remainder by
    GMP_NUMB_BITS/2 bits at a time, compared to GMP_NUMB_BITS for the main
-   division algorithm.  We do not insists on reducing by exactly
+   division algorithm.  We actually do not insists on reducing by exactly
    GMP_NUMB_BITS/2, but may leave a partial remainder that is D*B^i to 3D*B^i
    too large (B is the limb base, D is the divisor, and i is the induction
    variable); the subsequent step will handle the extra partial remainder bits.


More information about the gmp-commit mailing list