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

mercurial at gmplib.org mercurial at gmplib.org
Mon May 7 19:14:22 CEST 2012


details:   /var/hg/gmp/rev/de7cc462adfa
changeset: 14949:de7cc462adfa
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon May 07 19:12:02 2012 +0200
description:
mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.

details:   /var/hg/gmp/rev/3605a9a198f5
changeset: 14950:3605a9a198f5
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Mon May 07 19:14:12 2012 +0200
description:
tune/tuneup.c: Update minimal threshold for FAC_DSC.

diffstat:

 ChangeLog                  |  3 +++
 mpn/minithres/gmp-mparam.h |  2 +-
 mpz/oddfac_1.c             |  2 ++
 tune/tuneup.c              |  2 +-
 4 files changed, 7 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r 9ff994ee2cc6 -r 3605a9a198f5 ChangeLog
--- a/ChangeLog	Mon May 07 08:31:11 2012 +0200
+++ b/ChangeLog	Mon May 07 19:14:12 2012 +0200
@@ -3,6 +3,9 @@
 	* mpn/minithres/gmp-mparam.h: Updated TOOM6 and FAC_DSC.
 	* tests/mpn/toom-sqr-shared.h: Don't test if no range.
 
+	* mpz/oddfac_1.c: Add ASSERTs to warn about small threshold.
+	* tune/tuneup.c: Update minimal threshold for FAC_DSC.
+
 2012-05-06  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mini-gmp/mini-gmp.c: Put untested functions under
diff -r 9ff994ee2cc6 -r 3605a9a198f5 mpn/minithres/gmp-mparam.h
--- a/mpn/minithres/gmp-mparam.h	Mon May 07 08:31:11 2012 +0200
+++ b/mpn/minithres/gmp-mparam.h	Mon May 07 19:14:12 2012 +0200
@@ -95,4 +95,4 @@
 #define SET_STR_PRECOMPUTE_THRESHOLD       100
 
 #define FAC_ODD_THRESHOLD                    0  /* always */
-#define FAC_DSC_THRESHOLD                   26
+#define FAC_DSC_THRESHOLD                   42
diff -r 9ff994ee2cc6 -r 3605a9a198f5 mpz/oddfac_1.c
--- a/mpz/oddfac_1.c	Mon May 07 08:31:11 2012 +0200
+++ b/mpz/oddfac_1.c	Mon May 07 19:14:12 2012 +0200
@@ -298,6 +298,7 @@
 
 #if TUNE_PROGRAM_BUILD
 	ASSERT (FAC_DSC_THRESHOLD_LIMIT >= FAC_DSC_THRESHOLD);
+	ASSERT (FAC_DSC_THRESHOLD >= 2 * (ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 2));
 #endif
 
 	/* Compute the number of recursive steps for the DSC algorithm. */
@@ -317,6 +318,7 @@
 	max_prod = GMP_NUMB_MAX / FAC_DSC_THRESHOLD;
 #endif
 
+	ASSERT (tn > ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 1);
 	do {
 	  i = ODD_DOUBLEFACTORIAL_TABLE_LIMIT + 2;
 	  factors[j++] = ODD_DOUBLEFACTORIAL_TABLE_MAX;
diff -r 9ff994ee2cc6 -r 3605a9a198f5 tune/tuneup.c
--- a/tune/tuneup.c	Mon May 07 08:31:11 2012 +0200
+++ b/tune/tuneup.c	Mon May 07 19:14:12 2012 +0200
@@ -2642,7 +2642,7 @@
   param.function = speed_mpz_fac_ui_tune;
 
   param.name = "FAC_DSC_THRESHOLD";
-  param.min_size = 26;
+  param.min_size = 42;
   param.max_size = FAC_DSC_THRESHOLD_LIMIT;
   one (&fac_dsc_threshold, &param);
 


More information about the gmp-commit mailing list