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

mercurial at gmplib.org mercurial at gmplib.org
Wed Feb 8 00:04:14 CET 2012


details:   /var/hg/gmp-5.0/rev/9f97a634c1f7
changeset: 13550:9f97a634c1f7
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Tue Feb 07 23:57:02 2012 +0100
description:
Extend FFT tables.

details:   /var/hg/gmp-5.0/rev/21a685b91fad
changeset: 13551:21a685b91fad
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Feb 08 00:03:35 2012 +0100
description:
Update for 5.0.4.

details:   /var/hg/gmp-5.0/rev/d3dd234d4b43
changeset: 13552:d3dd234d4b43
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Feb 08 00:04:07 2012 +0100
description:
Whitespace cleanups.

diffstat:

 NEWS                             |   22 +++++-
 mpn/generic/gcdext_subdiv_step.c |    2 +-
 mpn/x86_64/bd1/gmp-mparam.h      |  117 +++++++++++++++++++++++++++-----------
 tests/mpn/t-hgcd.c               |    2 +-
 tests/mpz/t-gcd.c                |    2 +-
 tune/README                      |    2 +-
 6 files changed, 104 insertions(+), 43 deletions(-)

diffs (223 lines):

diff -r 5bed10c29692 -r d3dd234d4b43 NEWS
--- a/NEWS	Tue Feb 07 22:10:41 2012 +0100
+++ b/NEWS	Wed Feb 08 00:04:07 2012 +0100
@@ -8,21 +8,33 @@
 Changes between GMP version 5.0.3 and 5.0.4
 
   BUGS FIXED
-  * Thresholds in powm_sec for a non-fat build are now used safely, plugging a
+
+  * Thresholds in powm_sec for non-fat builds are now used safely, plugging a
     one-word buffer overrun introduced in the 5.0.3 release.  (We have not been
     able to provoke malign stack smashing in any of the ~100 configurations
-    explored by the GMP nightly builds.
+    explored by the GMP nightly builds, but the bug should be assumed to be
+    exploitable.)
 
-  * Thresholds in powm_sec for a fat build are now used safely, plugging a
+  * Thresholds in powm_sec for fat builds are now used safely, plugging a
     potential multi-word buffer overrun.  (The bug is not fully analysed; we
     have not been able to provoke malign stack smashing in any of the ~100
-    configurations explored by the GMP nightly builds.)
+    configurations explored by the GMP nightly builds, but the bug should be
+    assumed to be exploitable.)
 
   * A bug in multiplication code causing incorrect computation with extremely
     low probability in 32-bits builds was fixed.
 
+  * A bug in the test suite causing buffer overruns during "make check",
+    sometimes leading to subsequent malloc crashes, has been fixed.
+
+  * Two bugs in the gcd code have been fixed.  One bug could lead to
+    incorrect results, but for uniformly distributed random operands,
+    the likelihood was infinitesimally small.  The other bug was
+    merely an incorrect ASSERT.
+
   SPEEDUPS
-  * None.
+  * None, except indirectly through recognition of new CPUs, and through better
+    tuning parameters.
 
   FEATURES
   * Some more tests added to the self-check suite.
diff -r 5bed10c29692 -r d3dd234d4b43 mpn/generic/gcdext_subdiv_step.c
--- a/mpn/generic/gcdext_subdiv_step.c	Tue Feb 07 22:10:41 2012 +0100
+++ b/mpn/generic/gcdext_subdiv_step.c	Wed Feb 08 00:04:07 2012 +0100
@@ -183,7 +183,7 @@
 	{
 	  mp_size_t u1n = un;
 	  un = qn + u0n;
-	  un -= (tp[un-1] == 0);	  
+	  un -= (tp[un-1] == 0);
 	  u1[un] = mpn_add (u1, tp, un, u1, u1n);
 	}
       else
diff -r 5bed10c29692 -r d3dd234d4b43 mpn/x86_64/bd1/gmp-mparam.h
--- a/mpn/x86_64/bd1/gmp-mparam.h	Tue Feb 07 22:10:41 2012 +0100
+++ b/mpn/x86_64/bd1/gmp-mparam.h	Wed Feb 08 00:04:07 2012 +0100
@@ -56,46 +56,95 @@
 #define MUL_FFT_MODF_THRESHOLD             412  /* k = 5 */
 #define MUL_FFT_TABLE3                                      \
   { {    412, 5}, {     19, 6}, {     10, 5}, {     21, 6}, \
+    {     11, 5}, {     23, 6}, {     21, 7}, {     11, 6}, \
+    {     23, 7}, {     21, 8}, {     11, 7}, {     25, 8}, \
+    {     13, 7}, {     28, 8}, {     15, 7}, {     31, 8}, \
+    {     21, 9}, {     11, 8}, {     27, 9}, {     15, 8}, \
+    {     33, 9}, {     19, 8}, {     41, 9}, {     23, 8}, \
+    {     47, 9}, {     27,10}, {     15, 9}, {     31, 8}, \
+    {     63, 9}, {     39,10}, {     23, 9}, {     51,11}, \
+    {     15,10}, {     31, 9}, {     67,10}, {     39, 9}, \
+    {     79,10}, {     47, 9}, {     95,10}, {     55,11}, \
+    {     31,10}, {     79,11}, {     47,10}, {    103,12}, \
+    {     31,11}, {     63,10}, {    127,11}, {     79,10}, \
+    {    175,11}, {     95,10}, {    191,12}, {     63,11}, \
+    {    127,10}, {    255,11}, {    143,10}, {    287,11}, \
+    {    159,12}, {     95,13}, {     63,12}, {    127,11}, \
+    {    271, 9}, {   1087,11}, {    287,10}, {    575,11}, \
+    {    303,12}, {    159,11}, {    319,10}, {    671,11}, \
+    {    351,12}, {    191,11}, {    383,10}, {    767,11}, \
+    {    415,12}, {    223,11}, {    447,13}, {    127,12}, \
+    {    255,11}, {    543,12}, {    287,11}, {    575,10}, \
+    {   1215,12}, {    319,11}, {    639,12}, {    351,13}, \
+    {    191,12}, {    383,11}, {    767,12}, {    415,11}, \
+    {    831,10}, {   1663,12}, {    447,14}, {    127,13}, \
+    {    255,12}, {    543,11}, {   1087,10}, {   2175,12}, \
+    {    575,11}, {   1151,12}, {    607,11}, {   1215,13}, \
+    {    319,12}, {    639,11}, {   1279,12}, {    671,11}, \
+    {   1343,10}, {   2687,12}, {    703,13}, {    383,12}, \
+    {    767,11}, {   1535,12}, {    831,13}, {    447,12}, \
+    {    959,14}, {    255,13}, {    511,12}, {   1087,11}, \
+    {   2175,13}, {    575,12}, {   1215,11}, {   2431,10}, \
+    {   4863,13}, {    639,12}, {   1343,11}, {   2687,13}, \
+    {    703,12}, {   1407,14}, {    383,13}, {    767,12}, \
+    {   1535,13}, {    831,12}, {   1663,13}, {    959,15}, \
+    {    255,14}, {    511,13}, {   1087,12}, {   2175,13}, \
+    {   1215,12}, {   2431,11}, {   4863,14}, {    639,13}, \
+    {   1343,12}, {   2687,13}, {   1471,12}, {   2943,11}, \
+    {   5887,14}, {    767,13}, {   1599,12}, {   3199,13}, \
+    {   1727,14}, {    895,13}, {   1919,12}, {   3839,15}, \
+    {    511,14}, {   1023,13}, {   2175,14}, {   1151,13}, \
+    {   2431,12}, {   4863,14}, {  16384,15}, {  32768,16}, \
+    {  65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+    {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 168
+#define MUL_FFT_THRESHOLD                 4736
+
+#define SQR_FFT_MODF_THRESHOLD             368  /* k = 5 */
+#define SQR_FFT_TABLE3                                      \
+  { {    368, 5}, {     19, 6}, {     10, 5}, {     21, 6}, \
     {     21, 7}, {     11, 6}, {     23, 7}, {     21, 8}, \
     {     11, 7}, {     25, 8}, {     13, 7}, {     28, 8}, \
-    {     15, 7}, {     31, 8}, {     21, 9}, {     11, 8}, \
-    {     27, 9}, {     15, 8}, {     33, 9}, {     19, 8}, \
-    {     41, 9}, {     23, 8}, {     47, 9}, {     27,10}, \
-    {     15, 9}, {     31, 8}, {     63, 9}, {     39,10}, \
-    {     23, 9}, {     51,11}, {     15,10}, {     31, 9}, \
-    {     67,10}, {     39, 9}, {     83,10}, {     47, 9}, \
-    {     95,10}, {     55,11}, {     31,10}, {     79,11}, \
-    {     47,10}, {    103,12}, {     31,11}, {     63,10}, \
-    {    135,11}, {     79,10}, {    167,11}, {    111,12}, \
-    {     63,11}, {    127,10}, {    271,11}, {    143,10}, \
-    {    287,11}, {    159,12}, {     95,11}, {    191,10}, \
-    {    383,13}, {   8192,14}, {  16384,15}, {  32768,16}, \
-    {  65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
-    {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 68
-#define MUL_FFT_THRESHOLD                 4736
-
-#define SQR_FFT_MODF_THRESHOLD             364  /* k = 5 */
-#define SQR_FFT_TABLE3                                      \
-  { {    364, 5}, {     19, 6}, {     10, 5}, {     21, 6}, \
-    {     11, 5}, {     23, 6}, {     21, 7}, {     11, 6}, \
-    {     23, 7}, {     21, 8}, {     11, 7}, {     25, 8}, \
-    {     13, 7}, {     27, 8}, {     15, 7}, {     31, 8}, \
-    {     17, 7}, {     35, 8}, {     27, 9}, {     15, 8}, \
+    {     15, 7}, {     31, 8}, {     17, 7}, {     35, 8}, \
+    {     19, 7}, {     39, 8}, {     27, 9}, {     15, 8}, \
     {     35, 9}, {     19, 8}, {     41, 9}, {     23, 8}, \
     {     47, 9}, {     27,10}, {     15, 9}, {     39,10}, \
     {     23, 9}, {     51,11}, {     15,10}, {     31, 9}, \
-    {     63,10}, {     39, 9}, {     79,10}, {     55,11}, \
-    {     31,10}, {     79,11}, {     47,10}, {     95,12}, \
-    {     31,11}, {     63,10}, {    135,11}, {     79,10}, \
-    {    159, 9}, {    319,10}, {    167,11}, {     95,10}, \
+    {     67,10}, {     39, 9}, {     79,10}, {     47, 9}, \
+    {     95,10}, {     55,11}, {     31,10}, {     79,11}, \
+    {     47,10}, {     95,12}, {     31,11}, {     63,10}, \
+    {    135,11}, {     79,10}, {    159,11}, {     95,10}, \
     {    191,11}, {    111,12}, {     63,11}, {    127,10}, \
-    {    255,11}, {    143, 9}, {    575,10}, {    303,12}, \
-    {     95,11}, {    191,10}, {    383,11}, {    207,13}, \
-    {   8192,14}, {  16384,15}, {  32768,16}, {  65536,17}, \
-    { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
-    {2097152,22}, {4194304,23}, {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 71
+    {    255, 9}, {    543,11}, {    143, 9}, {    575,12}, \
+    {     95,11}, {    191,13}, {     63,12}, {    127,11}, \
+    {    255,10}, {    511,11}, {    271,10}, {    543,11}, \
+    {    287,10}, {    575,11}, {    303,12}, {    159,11}, \
+    {    335,12}, {    191,11}, {    415,12}, {    223,11}, \
+    {    447,10}, {    895,13}, {    127,12}, {    255,11}, \
+    {    319,11}, {    639,10}, {   1279,12}, {    351,13}, \
+    {    191,12}, {    383,11}, {    767,12}, {    415,11}, \
+    {    831,10}, {   1663,12}, {    447,11}, {    895,14}, \
+    {    127,13}, {    255,12}, {    511,11}, {   1023,12}, \
+    {    543,11}, {   1087,10}, {   2175,12}, {    575,11}, \
+    {   1151,12}, {    607,13}, {    319,12}, {    639,11}, \
+    {   1279,12}, {    671,11}, {   1343,10}, {   2687,12}, \
+    {    703,13}, {    383,12}, {    767,11}, {   1599,12}, \
+    {    831,13}, {    447,12}, {    959,14}, {    255,13}, \
+    {    511,12}, {   1087,11}, {   2175,13}, {    575,12}, \
+    {   1151,11}, {   2303,12}, {   1215,11}, {   2431,10}, \
+    {   4863,13}, {    639,12}, {   1343,11}, {   2687,13}, \
+    {    703,12}, {   1407,14}, {    383,13}, {    767,12}, \
+    {   1599,13}, {    831,12}, {   1727,13}, {    895,15}, \
+    {    255,14}, {    511,13}, {   1087,12}, {   2175,13}, \
+    {   1215,12}, {   2431,11}, {   4863,14}, {    639,13}, \
+    {   1343,12}, {   2687,13}, {   1471,12}, {   2943,11}, \
+    {   5887,14}, {    767,13}, {   1599,12}, {   3199,13}, \
+    {   1727,14}, {    895,13}, {   1919,12}, {   3839,15}, \
+    {    511,14}, {   1023,13}, {   2175,14}, {   1151,13}, \
+    {   2431,12}, {   4863,14}, {  16384,15}, {  32768,16}, \
+    {  65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+    {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 172
 #define SQR_FFT_THRESHOLD                 3264
 
 #define MULLO_BASECASE_THRESHOLD             4
diff -r 5bed10c29692 -r d3dd234d4b43 tests/mpn/t-hgcd.c
--- a/tests/mpn/t-hgcd.c	Tue Feb 07 22:10:41 2012 +0100
+++ b/tests/mpn/t-hgcd.c	Wed Feb 08 00:04:07 2012 +0100
@@ -114,7 +114,7 @@
 
       if (mpz_size (op1) > 0)
 	one_test (op1, op2, i);
-      
+
       /* Generate a division chain backwards, allowing otherwise
 	 unlikely huge quotients.  */
 
diff -r 5bed10c29692 -r d3dd234d4b43 tests/mpz/t-gcd.c
--- a/tests/mpz/t-gcd.c	Tue Feb 07 22:10:41 2012 +0100
+++ b/tests/mpz/t-gcd.c	Wed Feb 08 00:04:07 2012 +0100
@@ -172,7 +172,7 @@
 	mpz_neg (op2, op2);
 
       one_test (op1, op2, NULL, i);
-	 
+
       /* Generate a division chain backwards, allowing otherwise unlikely huge
 	 quotients.  */
 
diff -r 5bed10c29692 -r d3dd234d4b43 tune/README
--- a/tune/README	Tue Feb 07 22:10:41 2012 +0100
+++ b/tune/README	Wed Feb 08 00:04:07 2012 +0100
@@ -91,7 +91,7 @@
       LIBS="$old_LIBS"
 
       AC_SUBST(TUNE_LIBS)
-    
+
     might work.
 
 Low resolution timebase


More information about the gmp-commit mailing list