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

mercurial at gmplib.org mercurial at gmplib.org
Tue Feb 7 23:33:56 UTC 2017


details:   /var/hg/gmp/rev/79cc2f057248
changeset: 17232:79cc2f057248
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Wed Feb 08 00:29:12 2017 +0100
description:
Amend last change: Tweak pi1_bdiv_q_1 / divexact_1 criterion.

details:   /var/hg/gmp/rev/8b6f4d335f1c
changeset: 17233:8b6f4d335f1c
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Wed Feb 08 00:33:29 2017 +0100
description:
Choose mpn_pi1_bdiv_q_1 vs mpn_divexact_1 more wisely (spotted by Marco).

details:   /var/hg/gmp/rev/4d12ef1d2817
changeset: 17234:4d12ef1d2817
user:      Torbjorn Granlund <tg at gmplib.org>
date:      Wed Feb 08 00:33:53 2017 +0100
description:
ChangeLog

diffstat:

 ChangeLog                    |  7 +++++++
 mpn/generic/compute_powtab.c |  6 +++++-
 tune/tuneup.c                |  4 ++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diffs (60 lines):

diff -r 95d022abf322 -r 4d12ef1d2817 ChangeLog
--- a/ChangeLog	Tue Feb 07 20:48:14 2017 +0100
+++ b/ChangeLog	Wed Feb 08 00:33:53 2017 +0100
@@ -1,5 +1,12 @@
+2017-02-08  Torbjörn Granlund  <tg at gmplib.org>
+
+	* mpn/generic/compute_powtab.c: Choose mpn_pi1_bdiv_q_1 vs
+	mpn_divexact_1 more wisely (spotted by Marco).
+
 2017-02-07  Torbjörn Granlund  <tg at gmplib.org>
 
+	* tune/tuneup.c (relspeed_div_1_vs_mul_1): Prefer mpn_pi1_bdiv_q_1.
+
 	* mpn/generic/compute_powtab.c: Use mpn_pi1_bdiv_q_1/mpn_bdiv_q_1
 	instead of mpn_divexact_1.
 
diff -r 95d022abf322 -r 4d12ef1d2817 mpn/generic/compute_powtab.c
--- a/mpn/generic/compute_powtab.c	Tue Feb 07 20:48:14 2017 +0100
+++ b/mpn/generic/compute_powtab.c	Wed Feb 08 00:33:53 2017 +0100
@@ -236,14 +236,18 @@
 
       if (digits_in_base != exptab[pi])	/* if ((((un - 1) >> pi) & 2) == 0) */
 	{
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 || ! HAVE_NATIVE_mpn_divexact_1
 	  if (__GMP_LIKELY (base == 10))
 	    mpn_pi1_bdiv_q_1 (t, t, n, big_base >> MP_BASES_BIG_BASE_CTZ_10,
 			      MP_BASES_BIG_BASE_BINVERTED_10,
 			      MP_BASES_BIG_BASE_CTZ_10);
 	  else
+#endif
 	    /* FIXME: We could use _pi1 here if we add big_base_binverted and
 	       big_base_ctz fields to struct bases.  That would add about 2 KiB
-	       to mp_bases.c.  */
+	       to mp_bases.c.
+	       FIXME: Use mpn_bdiv_q_1 here when mpn_divexact_1 is converted to
+	       mpn_bdiv_q_1 for more machines. */
 	    mpn_divexact_1 (t, t, n, big_base);
 
 	  n -= t[n - 1] == 0;
diff -r 95d022abf322 -r 4d12ef1d2817 tune/tuneup.c
--- a/tune/tuneup.c	Tue Feb 07 20:48:14 2017 +0100
+++ b/tune/tuneup.c	Wed Feb 08 00:33:53 2017 +0100
@@ -1225,7 +1225,7 @@
       /* Make input divisible for good measure.  */
       ap[n - 1] = mpn_mul_1 (ap, ap, n - 1, MP_BASES_BIG_BASE_10);
 
-#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 || ! HAVE_NATIVE_mpn_divexact_1
 	  mpn_pi1_bdiv_q_1 (rp, ap, n, MP_BASES_BIG_BASE_10,
 			    MP_BASES_BIG_BASE_BINVERTED_10,
 			    MP_BASES_BIG_BASE_CTZ_10);
@@ -1235,7 +1235,7 @@
       speed_starttime ();
       for (j = speed_precision; j != 0 ; j--)
 	{
-#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 || ! HAVE_NATIVE_mpn_divexact_1
 	  mpn_pi1_bdiv_q_1 (rp, ap, n, MP_BASES_BIG_BASE_10,
 			    MP_BASES_BIG_BASE_BINVERTED_10,
 			    MP_BASES_BIG_BASE_CTZ_10);


More information about the gmp-commit mailing list