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

mercurial at gmplib.org mercurial at gmplib.org
Sun Oct 25 11:56:02 UTC 2020


details:   /var/hg/gmp-6.2/rev/e85738f7205f
changeset: 18104:e85738f7205f
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 25 12:20:43 2020 +0100
description:
mini-mpq.c (mpq_canonical_sign): Use the correct type for size

details:   /var/hg/gmp-6.2/rev/f242d9a85bc1
changeset: 18105:f242d9a85bc1
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 25 12:21:18 2020 +0100
description:
configfsf.guess: Updated to version 2020-10-22, from gnulib

details:   /var/hg/gmp-6.2/rev/aaa5cd5f1893
changeset: 18106:aaa5cd5f1893
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 25 12:21:58 2020 +0100
description:
Partial re-tune for large FFT

details:   /var/hg/gmp-6.2/rev/777a635003dd
changeset: 18107:777a635003dd
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sun Oct 25 12:27:10 2020 +0100
description:
mpz/millerrabin.c: Update current brute-force test limit

diffstat:

 ChangeLog                       |   4 ++++
 configfsf.guess                 |   3 ++-
 mini-gmp/ChangeLog              |   4 ++++
 mini-gmp/mini-mpq.c             |   6 +++---
 mpn/x86_64/skylake/gmp-mparam.h |  19 +++++++++++++------
 mpn/x86_64/zen2/gmp-mparam.h    |  21 +++++++++++++++------
 mpz/millerrabin.c               |  12 ++++++------
 7 files changed, 47 insertions(+), 22 deletions(-)

diffs (180 lines):

diff -r 734d04ff4aab -r 777a635003dd ChangeLog
--- a/ChangeLog	Sun Oct 18 21:49:42 2020 +0200
+++ b/ChangeLog	Sun Oct 25 12:27:10 2020 +0100
@@ -1,3 +1,7 @@
+2020-10-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* configfsf.guess: Updated to version 2020-10-22, from gnulib.
+
 2020-10-17 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* tests/devel/Makefile.am: Remove redundancies.
diff -r 734d04ff4aab -r 777a635003dd configfsf.guess
--- a/configfsf.guess	Sun Oct 18 21:49:42 2020 +0200
+++ b/configfsf.guess	Sun Oct 25 12:27:10 2020 +0100
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2020 Free Software Foundation, Inc.
 
-timestamp='2020-09-19'
+timestamp='2020-10-22'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -182,6 +182,7 @@
 	    "/usr/sbin/$sysctl" 2>/dev/null || \
 	    echo unknown)`
 	case "$UNAME_MACHINE_ARCH" in
+	    aarch64eb) machine=aarch64_be-unknown ;;
 	    armeb) machine=armeb-unknown ;;
 	    arm*) machine=arm-unknown ;;
 	    sh3el) machine=shl-unknown ;;
diff -r 734d04ff4aab -r 777a635003dd mini-gmp/ChangeLog
--- a/mini-gmp/ChangeLog	Sun Oct 18 21:49:42 2020 +0200
+++ b/mini-gmp/ChangeLog	Sun Oct 25 12:27:10 2020 +0100
@@ -1,3 +1,7 @@
+2020-10-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mini-mpq.c (mpq_canonical_sign): Use the correct type for size.
+
 2020-10-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* mini-mpq.c (mpq_out_str): Return 0 when base is out of range.
diff -r 734d04ff4aab -r 777a635003dd mini-gmp/mini-mpq.c
--- a/mini-gmp/mini-mpq.c	Sun Oct 18 21:49:42 2020 +0200
+++ b/mini-gmp/mini-mpq.c	Sun Oct 25 12:27:10 2020 +0100
@@ -107,10 +107,10 @@
 static void
 mpq_canonical_sign (mpq_t r)
 {
-  int cmp = mpq_denref (r)->_mp_size;
-  if (cmp <= 0)
+  mp_size_t ds = mpq_denref (r)->_mp_size;
+  if (ds <= 0)
     {
-      if (cmp == 0)
+      if (ds == 0)
 	gmp_die("mpq: Fraction with zero denominator.");
       mpz_neg (mpq_denref (r), mpq_denref (r));
       mpz_neg (mpq_numref (r), mpq_numref (r));
diff -r 734d04ff4aab -r 777a635003dd mpn/x86_64/skylake/gmp-mparam.h
--- a/mpn/x86_64/skylake/gmp-mparam.h	Sun Oct 18 21:49:42 2020 +0200
+++ b/mpn/x86_64/skylake/gmp-mparam.h	Sun Oct 25 12:27:10 2020 +0100
@@ -38,6 +38,7 @@
 /* 3600-4000 MHz Intel Xeon E3-1270v5 Skylake */
 /* FFT tuning limit = 465,990,371 */
 /* Generated by tuneup.c, 2019-10-18, gcc 8.3 */
+/* FFT_TABLEs merged with a new run, 2020-09-25, fft_max_size 1000000000 */
 
 #define MOD_1_NORM_THRESHOLD                 0  /* always */
 #define MOD_1_UNNORM_THRESHOLD               0  /* always */
@@ -135,10 +136,13 @@
     {   3071,15}, {   6911,16}, {   3583,15}, {   7679,14}, \
     {  15359,15}, {   7935,17}, {   2047,16}, {   4095,15}, \
     {   8703,16}, {   4607,15}, {   9983,14}, {  19967,16}, \
-    {   5631,15}, {  11775,17}, {   3071,16}, {  65536,17}, \
-    { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
-    {2097152,22}, {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 227
+    {   5631,15}, {  11775,17}, {   3071,16}, \
+    {   7679,15}, {  15359,18}, {   2047,17}, {   4095,16}, \
+    {   9727,15}, {  19967,17}, {   5119,16}, {  11775,15}, \
+    {  24063,17}, {   6143,16}, {  12799,17}, {   7167,16}, \
+    {  65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+    {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 239
 #define MUL_FFT_THRESHOLD                 6272
 
 #define SQR_FFT_MODF_THRESHOLD             400  /* k = 5 */
@@ -192,10 +196,13 @@
     {   6911,16}, {   3583,15}, {   7679,14}, {  15359,17}, \
     {   2047,16}, {   4095,15}, {   8191,16}, {   4607,15}, \
     {   9983,14}, {  19967,16}, {   5631,15}, {  11775,17}, \
-    {   3071,16}, {  65536,17}, { 131072,18}, { 262144,19}, \
+    {   3071,16}, {   7679,15}, {  15359,18}, {   2047,17}, \
+    {   4095,16}, {   9727,15}, {  19967,17}, {   5119,16}, \
+    {  11775,15}, {  23551,17}, {   6143,16}, {  12799,17}, \
+    {   7167,16}, {  65536,17}, { 131072,18}, { 262144,19}, \
     { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
     {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 205
+#define SQR_FFT_TABLE3_SIZE 217
 #define SQR_FFT_THRESHOLD                 4224
 
 #define MULLO_BASECASE_THRESHOLD             0  /* always */
diff -r 734d04ff4aab -r 777a635003dd mpn/x86_64/zen2/gmp-mparam.h
--- a/mpn/x86_64/zen2/gmp-mparam.h	Sun Oct 18 21:49:42 2020 +0200
+++ b/mpn/x86_64/zen2/gmp-mparam.h	Sun Oct 25 12:27:10 2020 +0100
@@ -38,6 +38,7 @@
 /* 3600-4400 MHz Matisse */
 /* FFT tuning limit = 703,392,483 */
 /* Generated by tuneup.c, 2019-10-19, gcc 8.3 */
+/* FFT_TABLEs merged with a new run, 2020-09-24,  fft_max_size 2000000000 */
 
 #define MOD_1_NORM_THRESHOLD                 0  /* always */
 #define MOD_1_UNNORM_THRESHOLD               0  /* always */
@@ -147,10 +148,14 @@
     {   4095,15}, {   8959,16}, {   4607,15}, {   9983,14}, \
     {  19967,16}, {   5631,15}, {  11775,17}, {   3071,16}, \
     {   7679,15}, {  15871,18}, {   2047,17}, {   4095,16}, \
-    {   9727,15}, {  19967,17}, {   5119,16}, {  65536,17}, \
+    {   9727,15}, {  19967,17}, \
+    {   5119,16}, {  11775,15}, {  24063,17}, {   6143,16}, \
+    {  12799,17}, {   7167,16}, {  15871,15}, {  31743,18}, \
+    {   4095,17}, {   8191,16}, {  16895,17}, {   9215,16}, \
+    {  19967,17}, {  11263,16}, {  24063,18}, {   6143,17}, \
     { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
     {2097152,22}, {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 275
+#define MUL_FFT_TABLE3_SIZE 289
 #define MUL_FFT_THRESHOLD                 4736
 
 #define SQR_FFT_MODF_THRESHOLD             396  /* k = 5 */
@@ -223,10 +228,14 @@
     {   9983,14}, {  19967,16}, {   5119,15}, {  10239,16}, \
     {   5631,15}, {  11775,17}, {   3071,16}, {   7679,15}, \
     {  15359,18}, {   2047,17}, {   4095,16}, {   9727,15}, \
-    {  19967,17}, {   5119,16}, {  65536,17}, { 131072,18}, \
-    { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
-    {4194304,23}, {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 282
+    {  19967,17}, \
+    {   5119,16}, {  11775,15}, {  23551,17}, {   6143,16}, \
+    {  12799,17}, {   7167,16}, {  15871,15}, {  31743,18}, \
+    {   4095,17}, {   8191,16}, {  16895,17}, {   9215,16}, \
+    {  19967,17}, {  11263,16}, {  24063,18}, {   6143,17}, \
+    { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+    {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 296
 #define SQR_FFT_THRESHOLD                 3264
 
 #define MULLO_BASECASE_THRESHOLD             0  /* always */
diff -r 734d04ff4aab -r 777a635003dd mpz/millerrabin.c
--- a/mpz/millerrabin.c	Sun Oct 18 21:49:42 2020 +0200
+++ b/mpz/millerrabin.c	Sun Oct 25 12:27:10 2020 +0100
@@ -8,7 +8,7 @@
    With the current implementation, the first 24 MR-tests are substituted by a
    Baillie-PSW probable prime test.
 
-   This implementation the Baillie-PSW test was checked up to 19*2^46,
+   This implementation the Baillie-PSW test was checked up to 31*2^46,
    for smaller values no MR-test is performed, regardless of reps, and
    2 ("surely prime") is returned if the number was not proved composite.
 
@@ -101,11 +101,11 @@
 	  || SIZ (n) - 64 / GMP_NUMB_BITS == (PTR (n) [64 / GMP_NUMB_BITS] < CNST_LIMB(1) << 64 % GMP_NUMB_BITS)
 #endif
 #else
-	  /* Consider numbers up to 19*2^46 that pass the BPSW test as primes.
-	     This implementation was tested up to 19*2^46 = 2^50+2^47+2^46 */
-	  /* 2^4 < 19 = 0b10011 < 2^5 */
-#define GMP_BPSW_LIMB_CONST CNST_LIMB(19)
-#define GMP_BPSW_BITS_CONST (LOG2C(19) - 1)
+	  /* Consider numbers up to 31*2^46 that pass the BPSW test as primes.
+	     This implementation was tested up to 31*2^46 */
+	  /* 2^4 < 31 = 0b11111 < 2^5 */
+#define GMP_BPSW_LIMB_CONST CNST_LIMB(31)
+#define GMP_BPSW_BITS_CONST (LOG2C(31) - 1)
 #define GMP_BPSW_BITS_LIMIT (46 + GMP_BPSW_BITS_CONST)
 
 #define GMP_BPSW_LIMBS_LIMIT (GMP_BPSW_BITS_LIMIT / GMP_NUMB_BITS)



More information about the gmp-commit mailing list