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

mercurial at gmplib.org mercurial at gmplib.org
Tue May 29 10:38:27 UTC 2018


details:   /var/hg/gmp/rev/b083baa698c2
changeset: 17634:b083baa698c2
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Tue May 29 12:36:05 2018 +0200
description:
(x86): Pass more exact arch/tune options for nehalem.

details:   /var/hg/gmp/rev/a5870679ea9c
changeset: 17635:a5870679ea9c
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Tue May 29 12:36:41 2018 +0200
description:
ChangeLog

details:   /var/hg/gmp/rev/e6a6f693d36d
changeset: 17636:e6a6f693d36d
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Tue May 29 12:38:25 2018 +0200
description:
Trivial merge.

diffstat:

 ChangeLog           |  13 +++++++++++++
 configure.ac        |   4 ++--
 mpn/generic/gcd_1.c |  30 ------------------------------
 3 files changed, 15 insertions(+), 32 deletions(-)

diffs (95 lines):

diff -r e4849ae7c974 -r e6a6f693d36d ChangeLog
--- a/ChangeLog	Mon May 28 06:24:27 2018 +0200
+++ b/ChangeLog	Tue May 29 12:38:25 2018 +0200
@@ -1,3 +1,12 @@
+2018-05-29  Torbjörn Granlund  <tg at gmplib.org>
+
+	* configure.ac (x86): Pass more exact arch/tune options for nehalem.
+
+2018-05-28  Niels Möller  <nisse at lysator.liu.se>
+
+	* mpn/generic/gcd_1.c (mpn_gcd_1) [USE_ZEROTAB]: Delete unused code
+	variant for USE_ZEROTAB != 0.
+
 2018-05-20 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* bootstrap.c: Define DONT_USE_FLOAT_H before including mini-gmp.
@@ -62,6 +71,10 @@
 
 	* tests/cxx/t-ops2z.cc: Add parentheses to quiet a warning.
 
+2018-03-28  Torbjörn Granlund  <tg at gmplib.org>
+
+	* configure.ac (mips): Recognise "mipsisa64*".
+
 2018-03-23  Torbjörn Granlund  <tg at gmplib.org>
 
 	* mpn/generic/sec_powm.c: Remove unused macros.
diff -r e4849ae7c974 -r e6a6f693d36d configure.ac
--- a/configure.ac	Mon May 28 06:24:27 2018 +0200
+++ b/configure.ac	Tue May 29 12:38:25 2018 +0200
@@ -1846,8 +1846,8 @@
 	path_64="x86_64/core2 x86_64"
 	;;
       corei | coreinhm | coreiwsm | nehalem | westmere)
-	gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
-	gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
+	gcc_cflags_cpu="-mtune=nehalem -mtune=corei7 -mtune=core2 -mtune=k8"
+	gcc_cflags_arch="-march=nehalem -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
 	path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
 	path_64="x86_64/coreinhm x86_64/core2 x86_64"
 	;;
diff -r e4849ae7c974 -r e6a6f693d36d mpn/generic/gcd_1.c
--- a/mpn/generic/gcd_1.c	Mon May 28 06:24:27 2018 +0200
+++ b/mpn/generic/gcd_1.c	Tue May 29 12:38:25 2018 +0200
@@ -35,20 +35,6 @@
 #define GCD_1_METHOD 2
 #endif
 
-#define USE_ZEROTAB 0
-
-#if USE_ZEROTAB
-#define MAXSHIFT 4
-#define MASK ((1 << MAXSHIFT) - 1)
-static const unsigned char zerotab[1 << MAXSHIFT] =
-{
-#if MAXSHIFT > 4
-  5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-#endif
-  4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-#endif
-
 /* Does not work for U == 0 or V == 0.  It would be tough to make it work for
    V == 0 since gcd(x,0) = x, and U does not generally fit in an mp_limb_t.
 
@@ -161,21 +147,6 @@
       /* u <-- |u - v| */
       ulimb = (t ^ vgtu) - vgtu;
 
-#if USE_ZEROTAB
-      /* Number of trailing zeros is the same no matter if we look at
-       * t or ulimb, but using t gives more parallelism. */
-      c = zerotab[t & MASK];
-
-      while (UNLIKELY (c == MAXSHIFT))
-	{
-	  ulimb >>= MAXSHIFT;
-	  if (0)
-	  strip_u_maybe:
-	    vlimb >>= 1;
-
-	  c = zerotab[ulimb & MASK];
-	}
-#else
       if (0)
 	{
 	strip_u_maybe:
@@ -183,7 +154,6 @@
 	  t = ulimb;
 	}
       count_trailing_zeros (c, t);
-#endif
       ulimb = (ulimb >> c) >> 1;
     }
 


More information about the gmp-commit mailing list