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

mercurial at gmplib.org mercurial at gmplib.org
Mon Apr 30 20:13:48 CEST 2012


details:   /var/hg/gmp/rev/bb7c4c5fc787
changeset: 14921:bb7c4c5fc787
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Apr 30 20:04:00 2012 +0200
description:
tests/mpz/t-lcm.c: Test zero too.

details:   /var/hg/gmp/rev/1685dfb28b7a
changeset: 14922:1685dfb28b7a
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Apr 30 20:09:51 2012 +0200
description:
mpz/mfac_uiui.c: typo in TMP_ALLOC.

details:   /var/hg/gmp/rev/2073e4006eea
changeset: 14923:2073e4006eea
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon Apr 30 20:13:43 2012 +0200
description:
mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).

diffstat:

 ChangeLog         |  4 ++++
 mpz/mfac_uiui.c   |  2 +-
 mpz/prodlimbs.c   |  2 +-
 tests/mpz/t-lcm.c |  7 +++++++
 4 files changed, 13 insertions(+), 2 deletions(-)

diffs (55 lines):

diff -r 7d54ba484fba -r 2073e4006eea ChangeLog
--- a/ChangeLog	Mon Apr 30 17:44:54 2012 +0200
+++ b/ChangeLog	Mon Apr 30 20:13:43 2012 +0200
@@ -20,6 +20,10 @@
 
 	* doc/gmp.texi: Document mpz_mfac_uiui, collapsing with other factorial functions.
 
+	* tests/mpz/t-lcm.c: Test zero too.
+
+	* mpz/prodlimbs.c: Simplify threshold (should be tuned, not guessed).
+
 2012-04-29  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/arm/aors_n.asm: Tune for more stable performance.
diff -r 7d54ba484fba -r 2073e4006eea mpz/mfac_uiui.c
--- a/mpz/mfac_uiui.c	Mon Apr 30 17:44:54 2012 +0200
+++ b/mpz/mfac_uiui.c	Mon Apr 30 20:13:43 2012 +0200
@@ -89,7 +89,7 @@
       max_prod = GMP_NUMB_MAX / n;
 
       TMP_MARK;
-      factors = TMP_SALLOC_LIMBS (sn / log_n_max (n) + 1);
+      factors = TMP_ALLOC_LIMBS (sn / log_n_max (n) + 2);
 
       for (; n > m; n -= m)
 	FACTOR_LIST_STORE (n, prod, max_prod, factors, j);
diff -r 7d54ba484fba -r 2073e4006eea mpz/prodlimbs.c
--- a/mpz/prodlimbs.c	Mon Apr 30 17:44:54 2012 +0200
+++ b/mpz/prodlimbs.c	Mon Apr 30 20:13:43 2012 +0200
@@ -33,7 +33,7 @@
 
 /* FIXME: should be tuned */
 #ifndef RECURSIVE_PROD_THRESHOLD
-#define RECURSIVE_PROD_THRESHOLD (MUL_TOOM22_THRESHOLD|(MUL_TOOM22_THRESHOLD<<1))
+#define RECURSIVE_PROD_THRESHOLD (MUL_TOOM22_THRESHOLD)
 #endif
 
 /* Computes the product of the j>1 limbs pointed by factors, puts the
diff -r 7d54ba484fba -r 2073e4006eea tests/mpz/t-lcm.c
--- a/tests/mpz/t-lcm.c	Mon Apr 30 17:44:54 2012 +0200
+++ b/tests/mpz/t-lcm.c	Mon Apr 30 20:13:43 2012 +0200
@@ -111,6 +111,13 @@
   mpz_init (x);
   mpz_init (y);
 
+  /* Check zeros. */
+  mpz_set_ui (want, 0);
+  mpz_set_ui (x, 1);
+  check_all (want, want, want);
+  check_all (want, want, x);
+  check_all (want, x, want);
+
   /* New prime each time. */
   mpz_set_ui (want, 1L);
   for (i = 0; i < numberof (prime); i++)


More information about the gmp-commit mailing list