[Gmp-commit] /var/hg/gmp: Move MULLO THRESHOLDs to gmp-impl.h.

mercurial at gmplib.org mercurial at gmplib.org
Mon Jun 9 12:46:03 UTC 2014


details:   /var/hg/gmp/rev/b315de004ea1
changeset: 16435:b315de004ea1
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Jun 09 14:46:00 2014 +0200
description:
Move MULLO THRESHOLDs to gmp-impl.h.

diffstat:

 ChangeLog             |   6 ++++++
 gmp-impl.h            |  20 ++++++++++++++++----
 mpn/generic/mullo_n.c |  12 ------------
 3 files changed, 22 insertions(+), 16 deletions(-)

diffs (87 lines):

diff -r f0796f86c874 -r b315de004ea1 ChangeLog
--- a/ChangeLog	Mon Jun 09 05:31:45 2014 +0200
+++ b/ChangeLog	Mon Jun 09 14:46:00 2014 +0200
@@ -1,3 +1,9 @@
+2014-06-09  Torbjörn Granlund  <tege at gmplib.org>
+
+	* mpn/generic/mullo_n.c: Remove default THRESHOLDs.
+	* gmp-impl.h: Put MULLO THRESHOLDs here.  Improve various THRESHOLD
+	defaults.
+
 2014-06-08  Torbjörn Granlund  <tege at gmplib.org>
 
 	* gmp-impl.h (TMP_ALLOC): Decrease limit to about half.
diff -r f0796f86c874 -r b315de004ea1 gmp-impl.h
--- a/gmp-impl.h	Mon Jun 09 05:31:45 2014 +0200
+++ b/gmp-impl.h	Mon Jun 09 14:46:00 2014 +0200
@@ -2069,7 +2069,7 @@
    should be used, and that may be never.  */
 
 #ifndef SQR_BASECASE_THRESHOLD
-#define SQR_BASECASE_THRESHOLD            0
+#define SQR_BASECASE_THRESHOLD            0  /* never use mpn_mul_basecase */
 #endif
 
 #ifndef SQR_TOOM2_THRESHOLD
@@ -2093,8 +2093,20 @@
 #define MULMID_TOOM42_THRESHOLD     MUL_TOOM22_THRESHOLD
 #endif
 
+#ifndef MULLO_BASECASE_THRESHOLD
+#define MULLO_BASECASE_THRESHOLD          0  /* never use mpn_mul_basecase */
+#endif
+
+#ifndef MULLO_DC_THRESHOLD
+#define MULLO_DC_THRESHOLD         (2*MUL_TOOM22_THRESHOLD)
+#endif
+
+#ifndef MULLO_MUL_N_THRESHOLD
+#define MULLO_MUL_N_THRESHOLD      (2*MUL_FFT_THRESHOLD)
+#endif
+
 #ifndef DC_DIV_QR_THRESHOLD
-#define DC_DIV_QR_THRESHOLD              50
+#define DC_DIV_QR_THRESHOLD        (2*MUL_TOOM22_THRESHOLD)
 #endif
 
 #ifndef DC_DIVAPPR_Q_THRESHOLD
@@ -2102,7 +2114,7 @@
 #endif
 
 #ifndef DC_BDIV_QR_THRESHOLD
-#define DC_BDIV_QR_THRESHOLD             50
+#define DC_BDIV_QR_THRESHOLD       (2*MUL_TOOM22_THRESHOLD)
 #endif
 
 #ifndef DC_BDIV_Q_THRESHOLD
@@ -2114,7 +2126,7 @@
 #endif
 
 #ifndef INV_MULMOD_BNM1_THRESHOLD
-#define INV_MULMOD_BNM1_THRESHOLD  (5*MULMOD_BNM1_THRESHOLD)
+#define INV_MULMOD_BNM1_THRESHOLD  (4*MULMOD_BNM1_THRESHOLD)
 #endif
 
 #ifndef INV_APPR_THRESHOLD
diff -r f0796f86c874 -r b315de004ea1 mpn/generic/mullo_n.c
--- a/mpn/generic/mullo_n.c	Mon Jun 09 05:31:45 2014 +0200
+++ b/mpn/generic/mullo_n.c	Mon Jun 09 14:46:00 2014 +0200
@@ -39,18 +39,6 @@
 #include "gmp-impl.h"
 
 
-#ifndef MULLO_BASECASE_THRESHOLD
-#define MULLO_BASECASE_THRESHOLD 0	/* never use mpn_mul_basecase */
-#endif
-
-#ifndef MULLO_DC_THRESHOLD
-#define MULLO_DC_THRESHOLD 3*MUL_TOOM22_THRESHOLD
-#endif
-
-#ifndef MULLO_MUL_N_THRESHOLD
-#define MULLO_MUL_N_THRESHOLD MUL_FFT_THRESHOLD
-#endif
-
 #if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
 #define MAYBE_range_basecase 1
 #define MAYBE_range_toom22   1


More information about the gmp-commit mailing list