[Gmp-commit] /home/hgfiles/gmp: Amend FFT tuneup changes.

mercurial at gmplib.org mercurial at gmplib.org
Tue Jan 19 15:04:47 CET 2010


details:   /home/hgfiles/gmp/rev/1fbc27c1dcd5
changeset: 13384:1fbc27c1dcd5
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Jan 19 15:04:43 2010 +0100
description:
Amend FFT tuneup changes.

diffstat:

 ChangeLog     |   6 ++++++
 tune/tuneup.c |  11 ++++-------
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 6e47f8f34f33 -r 1fbc27c1dcd5 ChangeLog
--- a/ChangeLog	Mon Jan 18 19:00:36 2010 +0100
+++ b/ChangeLog	Tue Jan 19 15:04:43 2010 +0100
@@ -1,3 +1,9 @@
+2010-01-19  Torbjorn Granlund  <tege at gmplib.org>
+
+	* tune/tuneup.c (fftmes): Round up initial n according to initial k.
+	Limit k to 24 in loop.  Remove an obsolete always-true condition.
+	Remove a redundant trace printout.
+
 2010-01-18  Torbjorn Granlund  <tege at gmplib.org>
 
 	* tune/tuneup.c (fftmes): New function
diff -r 6e47f8f34f33 -r 1fbc27c1dcd5 tune/tuneup.c
--- a/tune/tuneup.c	Mon Jan 18 19:00:36 2010 +0100
+++ b/tune/tuneup.c	Tue Jan 19 15:04:43 2010 +0100
@@ -866,7 +866,8 @@
   rp = malloc (sizeof (mp_limb_t));
   alloc = 1;
 
-  n = nmin;
+  /* Round n to comply to initial k value */
+  n = (nmin + ((1ul << initial_k) - 1)) & (MP_SIZE_T_MAX << initial_k);
 
   n_measurements = (18 - initial_k) | 1;
   n_measurements = MAX (n_measurements, MIN_REPS);
@@ -883,7 +884,7 @@
       prev_n1 = n + 1;
 
       start_k = MAX (4, best_k - 4);
-      for (k = start_k; k <= 30; k++)
+      for (k = start_k; k <= 24; k++)
 	{
           n1 = mpn_fft_next_size (prev_n1, k);
 
@@ -933,8 +934,7 @@
 
       if (last_best_k != best_k)
 	{
-	  if (last_best_k >= 0)
-	    ASSERT_ALWAYS ((prev_n1 & ((1ul << last_best_k) - 1)) == 1);
+	  ASSERT_ALWAYS ((prev_n1 & ((1ul << last_best_k) - 1)) == 1);
 
 	  if (idx >= FFT_TABLE3_SIZE)
 	    {
@@ -953,9 +953,6 @@
 	    }
 
 	  if (option_trace >= 2)
-	    printf ("{%ld,%d}\n", prev_n1, best_k);
-
-	  if (option_trace >= 2)
 	    {
 	      printf ("{%lu,%u}\n", prev_n1, best_k);
 	      fflush (stdout);


More information about the gmp-commit mailing list