summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortege <tege@gmplib.org>2002-02-19 02:55:50 +0100
committertege <tege@gmplib.org>2002-02-19 02:55:50 +0100
commit10771eb65077071674fa4fb188179db21c4cf844 (patch)
tree58ebf2ae654b47bc9ee4e632c03eed4b1f4a76dd
parentbb6a085e894aa3644bc7f3d6d16302063eaced2f (diff)
downloadgmp-10771eb65077071674fa4fb188179db21c4cf844.tar.gz
Clean up *_THRESHOLD names.
-rw-r--r--config.in6
-rwxr-xr-xconfigure14
-rw-r--r--configure.in14
-rw-r--r--doc/tasks.html4
-rw-r--r--gmp-impl.h150
-rw-r--r--gmp.texi36
-rw-r--r--mpn/alpha/ev5/gmp-mparam.h31
-rw-r--r--mpn/alpha/ev6/gmp-mparam.h31
-rw-r--r--mpn/alpha/gmp-mparam.h31
-rw-r--r--mpn/arm/gmp-mparam.h27
-rw-r--r--mpn/asm-defs.m44
-rw-r--r--mpn/cray/gmp-mparam.h29
-rw-r--r--mpn/cray/ieee/gmp-mparam.h26
-rw-r--r--mpn/generic/dc_divrem_n.c4
-rw-r--r--mpn/generic/get_str.c10
-rw-r--r--mpn/generic/mul.c18
-rw-r--r--mpn/generic/mul_basecase.c4
-rw-r--r--mpn/generic/mul_fft.c8
-rw-r--r--mpn/generic/mul_n.c54
-rw-r--r--mpn/generic/sb_divrem_mn.c6
-rw-r--r--mpn/generic/sqr_basecase.c6
-rw-r--r--mpn/generic/tdiv_qr.c6
-rw-r--r--mpn/hppa/gmp-mparam.h23
-rw-r--r--mpn/hppa/hppa1_1/gmp-mparam.h29
-rw-r--r--mpn/hppa/hppa2_0/gmp-mparam.h29
-rw-r--r--mpn/ia64/gmp-mparam.h30
-rw-r--r--mpn/m68k/gmp-mparam.h28
-rw-r--r--mpn/mips32/gmp-mparam.h28
-rw-r--r--mpn/mips64/gmp-mparam.h28
-rw-r--r--mpn/pa64/gmp-mparam.h31
-rw-r--r--mpn/pa64w/gmp-mparam.h31
-rw-r--r--mpn/powerpc32/gmp-mparam.h31
-rw-r--r--mpn/powerpc64/gmp-mparam.h32
-rw-r--r--mpn/s390/gmp-mparam.h28
-rw-r--r--mpn/sparc32/v8/gmp-mparam.h31
-rw-r--r--mpn/sparc32/v8/supersparc/gmp-mparam.h29
-rw-r--r--mpn/sparc32/v9/gmp-mparam.h31
-rw-r--r--mpn/sparc64/gmp-mparam.h31
-rw-r--r--mpn/x86/i486/gmp-mparam.h14
-rw-r--r--mpn/x86/k6/gmp-mparam.h26
-rw-r--r--mpn/x86/k6/sqr_basecase.asm24
-rw-r--r--mpn/x86/k7/gmp-mparam.h26
-rw-r--r--mpn/x86/k7/sqr_basecase.asm14
-rw-r--r--mpn/x86/p6/gmp-mparam.h26
-rw-r--r--mpn/x86/p6/sqr_basecase.asm14
-rw-r--r--mpn/x86/pentium/gmp-mparam.h26
-rw-r--r--mpn/x86/pentium/mmx/gmp-mparam.h26
-rw-r--r--mpn/x86/pentium4/sse2/gmp-mparam.h28
-rwxr-xr-xmpn/x86/t-zdisp2.pl10
-rw-r--r--mpz/powm.c8
-rw-r--r--tune/Makefile.am2
-rw-r--r--tune/Makefile.in4
-rw-r--r--tune/README10
-rw-r--r--tune/sb_div.c8
-rw-r--r--tune/sb_inv.c8
-rw-r--r--tune/tuneup.c60
56 files changed, 669 insertions, 654 deletions
diff --git a/config.in b/config.in
index 0a7d41111..c2e650874 100644
--- a/config.in
+++ b/config.in
@@ -1,7 +1,7 @@
/* config.in. Generated automatically from configure.in by autoheader. */
/* Templates for defines setup by configure.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -397,8 +397,8 @@ MA 02111-1307, USA. */
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
-/* Maximum size the tune program can test for KARATSUBA_SQR_THRESHOLD */
-#undef TUNE_KARATSUBA_SQR_MAX
+/* Maximum size the tune program can test for SQR_KARATSUBA_THRESHOLD */
+#undef TUNE_SQR_KARATSUBA_MAX
/* Version number of package */
#undef VERSION
diff --git a/configure b/configure
index d5191554d..c66b08a56 100755
--- a/configure
+++ b/configure
@@ -3,7 +3,7 @@
# Guess values for system-dependent variables and create Makefiles.
# Generated by Autoconf 2.52.
#
-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
@@ -19553,12 +19553,12 @@ cat >>confdefs.h <<EOF
#define GMP_MPARAM_H_SUGGEST "$gmp_mparam_source"
EOF
-# Copy any KARATSUBA_SQR_THRESHOLD from gmp-mparam.h to config.m4.
+# Copy any SQR_KARATSUBA_THRESHOLD from gmp-mparam.h to config.m4.
# Some versions of sqr_basecase.asm use this.
-tmp_gmp_karatsuba_sqr_threshold=`sed -n 's/^#define KARATSUBA_SQR_THRESHOLD[ ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
+tmp_gmp_karatsuba_sqr_threshold=`sed -n 's/^#define SQR_KARATSUBA_THRESHOLD[ ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
-echo "define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)" >> $gmp_tmpconfigm4
+echo "define(<SQR_KARATSUBA_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)" >> $gmp_tmpconfigm4
fi
@@ -20138,12 +20138,12 @@ TUNE_SQR_OBJ=
test -d tune || mkdir tune
case $sqr_basecase_source in
*.asm)
- sqr_max=`sed -n 's/^def...(KARATSUBA_SQR_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`
+ sqr_max=`sed -n 's/^def...(SQR_KARATSUBA_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`
if test -n "$sqr_max"; then
TUNE_SQR_OBJ=sqr_asm.o
cat >>confdefs.h <<EOF
-#define TUNE_KARATSUBA_SQR_MAX $sqr_max
+#define TUNE_SQR_KARATSUBA_MAX $sqr_max
EOF
fi
@@ -20155,7 +20155,7 @@ EOF
*.c)
TUNE_SQR_OBJ=
cat >>confdefs.h <<\EOF
-#define TUNE_KARATSUBA_SQR_MAX KARATSUBA_SQR_MAX_GENERIC
+#define TUNE_SQR_KARATSUBA_MAX SQR_KARATSUBA_MAX_GENERIC
EOF
cat >tune/sqr_basecase.c <<EOF
diff --git a/configure.in b/configure.in
index c535a7532..ed9d64259 100644
--- a/configure.in
+++ b/configure.in
@@ -1773,11 +1773,11 @@ AC_DEFINE_UNQUOTED(GMP_MPARAM_H_SUGGEST, "$gmp_mparam_source",
[The gmp-mparam.h to update when tuning.])
-# Copy any KARATSUBA_SQR_THRESHOLD from gmp-mparam.h to config.m4.
+# Copy any SQR_KARATSUBA_THRESHOLD from gmp-mparam.h to config.m4.
# Some versions of sqr_basecase.asm use this.
-tmp_gmp_karatsuba_sqr_threshold=`sed -n 's/^#define KARATSUBA_SQR_THRESHOLD[ ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
+tmp_gmp_karatsuba_sqr_threshold=`sed -n 's/^#define SQR_KARATSUBA_THRESHOLD[ ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
if test -n "$tmp_gmp_karatsuba_sqr_threshold"; then
- GMP_DEFINE_RAW(["define(<KARATSUBA_SQR_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)"])
+ GMP_DEFINE_RAW(["define(<SQR_KARATSUBA_THRESHOLD>,<$tmp_gmp_karatsuba_sqr_threshold>)"])
fi
# This must come after gmp-mparam.h has been chosen.
@@ -1820,11 +1820,11 @@ TUNE_SQR_OBJ=
test -d tune || mkdir tune
case $sqr_basecase_source in
*.asm)
- sqr_max=[`sed -n 's/^def...(KARATSUBA_SQR_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`]
+ sqr_max=[`sed -n 's/^def...(SQR_KARATSUBA_THRESHOLD_MAX, *\([0-9]*\))/\1/p' $sqr_basecase_source`]
if test -n "$sqr_max"; then
TUNE_SQR_OBJ=sqr_asm.o
- AC_DEFINE_UNQUOTED(TUNE_KARATSUBA_SQR_MAX,$sqr_max,
- [Maximum size the tune program can test for KARATSUBA_SQR_THRESHOLD])
+ AC_DEFINE_UNQUOTED(TUNE_SQR_KARATSUBA_MAX,$sqr_max,
+ [Maximum size the tune program can test for SQR_KARATSUBA_THRESHOLD])
fi
cat >tune/sqr_basecase.c <<EOF
/* not sure that an empty file can compile, so put in a dummy */
@@ -1833,7 +1833,7 @@ EOF
;;
*.c)
TUNE_SQR_OBJ=
- AC_DEFINE(TUNE_KARATSUBA_SQR_MAX,KARATSUBA_SQR_MAX_GENERIC)
+ AC_DEFINE(TUNE_SQR_KARATSUBA_MAX,SQR_KARATSUBA_MAX_GENERIC)
cat >tune/sqr_basecase.c <<EOF
#define TUNE_PROGRAM_BUILD 1
#define TUNE_PROGRAM_BUILD_SQR 1
diff --git a/doc/tasks.html b/doc/tasks.html
index 054c85532..dd6699d9d 100644
--- a/doc/tasks.html
+++ b/doc/tasks.html
@@ -352,7 +352,7 @@ MA 02111-1307, USA.
#if __GNUC__ == 2 && __GNUC_MINOR__ == 8
...
#endif
- #ifndef KARATSUBA_MUL_THRESHOLD
+ #ifndef MUL_KARATSUBA_THRESHOLD
/* Default GNUC values */
...
#endif
@@ -854,7 +854,7 @@ MA 02111-1307, USA.
<code>mftbu</code>) could be used for the speed and tune programs. Would
need to know its frequency though, for instance it seemed to be 25 MHz on
a couple of Apples (compared to the CPU speed of 350 or 450 MHz).
-<li> <code>FFT_MUL_THRESHOLD</code> etc: the FFT thresholds should allow a
+<li> <code>MUL_FFT_THRESHOLD</code> etc: the FFT thresholds should allow a
return to a previous k at certain sizes. This arises basically due to
the step effect caused by size multiples effectively used for each k.
Looking at a graph makes it fairly clear.
diff --git a/gmp-impl.h b/gmp-impl.h
index 96ba3189c..db797b50d 100644
--- a/gmp-impl.h
+++ b/gmp-impl.h
@@ -1061,16 +1061,16 @@ extern const mp_limb_t __gmp_fib_table[];
#define BELOW_THRESHOLD(size,thresh) (! ABOVE_THRESHOLD (size, thresh))
-/* If KARATSUBA_MUL_THRESHOLD is not already defined, define it to a
+/* If MUL_KARATSUBA_THRESHOLD is not already defined, define it to a
value which is good on most machines. */
-#ifndef KARATSUBA_MUL_THRESHOLD
-#define KARATSUBA_MUL_THRESHOLD 32
+#ifndef MUL_KARATSUBA_THRESHOLD
+#define MUL_KARATSUBA_THRESHOLD 32
#endif
-/* If TOOM3_MUL_THRESHOLD is not already defined, define it to a
+/* If MUL_TOOM3_THRESHOLD is not already defined, define it to a
value which is good on most machines. */
-#ifndef TOOM3_MUL_THRESHOLD
-#define TOOM3_MUL_THRESHOLD 256
+#ifndef MUL_TOOM3_THRESHOLD
+#define MUL_TOOM3_THRESHOLD 256
#endif
/* This is the threshold at which mpn_sqr_basecase should take over from
@@ -1078,21 +1078,21 @@ extern const mp_limb_t __gmp_fib_table[];
always.
If it turns out that mpn_kara_sqr_n becomes faster than mpn_mul_basecase
- before mpn_sqr_basecase does, then BASECASE_SQR_THRESHOLD is the
- karatsuba threshold and KARATSUBA_SQR_THRESHOLD is 0. This oddity arises
- more or less because KARATSUBA_SQR_THRESHOLD represents the size up to
+ before mpn_sqr_basecase does, then SQR_BASECASE_THRESHOLD is the
+ karatsuba threshold and SQR_KARATSUBA_THRESHOLD is 0. This oddity arises
+ more or less because SQR_KARATSUBA_THRESHOLD represents the size up to
which mpn_sqr_basecase should be used, and that may be never. */
-#ifndef BASECASE_SQR_THRESHOLD
-#define BASECASE_SQR_THRESHOLD 0
+#ifndef SQR_BASECASE_THRESHOLD
+#define SQR_BASECASE_THRESHOLD 0
#endif
-#ifndef KARATSUBA_SQR_THRESHOLD
-#define KARATSUBA_SQR_THRESHOLD (2*KARATSUBA_MUL_THRESHOLD)
+#ifndef SQR_KARATSUBA_THRESHOLD
+#define SQR_KARATSUBA_THRESHOLD (2*MUL_KARATSUBA_THRESHOLD)
#endif
-#ifndef TOOM3_SQR_THRESHOLD
-#define TOOM3_SQR_THRESHOLD (2*TOOM3_MUL_THRESHOLD)
+#ifndef SQR_TOOM3_THRESHOLD
+#define SQR_TOOM3_THRESHOLD (2*MUL_TOOM3_THRESHOLD)
#endif
/* First k to use for an FFT modF multiply. A modF FFT is an order
@@ -1101,11 +1101,11 @@ extern const mp_limb_t __gmp_fib_table[];
#define FFT_FIRST_K 4
/* Threshold at which FFT should be used to do a modF NxN -> N multiply. */
-#ifndef FFT_MODF_MUL_THRESHOLD
-#define FFT_MODF_MUL_THRESHOLD (TOOM3_MUL_THRESHOLD * 3)
+#ifndef MUL_FFT_MODF_THRESHOLD
+#define MUL_FFT_MODF_THRESHOLD (MUL_TOOM3_THRESHOLD * 3)
#endif
-#ifndef FFT_MODF_SQR_THRESHOLD
-#define FFT_MODF_SQR_THRESHOLD (TOOM3_SQR_THRESHOLD * 3)
+#ifndef SQR_FFT_MODF_THRESHOLD
+#define SQR_FFT_MODF_THRESHOLD (SQR_TOOM3_THRESHOLD * 3)
#endif
/* Threshold at which FFT should be used to do an NxN -> 2N multiply. This
@@ -1113,34 +1113,34 @@ extern const mp_limb_t __gmp_fib_table[];
NxN->2N multiply and not recursing into itself is an order
log(2^k)/log(2^(k-2)) algorithm, so it'll be at least k=7 at 1.39 which
is the first better than toom3. */
-#ifndef FFT_MUL_THRESHOLD
-#define FFT_MUL_THRESHOLD (FFT_MODF_MUL_THRESHOLD * 10)
+#ifndef MUL_FFT_THRESHOLD
+#define MUL_FFT_THRESHOLD (MUL_FFT_MODF_THRESHOLD * 10)
#endif
-#ifndef FFT_SQR_THRESHOLD
-#define FFT_SQR_THRESHOLD (FFT_MODF_SQR_THRESHOLD * 10)
+#ifndef SQR_FFT_THRESHOLD
+#define SQR_FFT_THRESHOLD (SQR_FFT_MODF_THRESHOLD * 10)
#endif
/* Table of thresholds for successive modF FFT "k"s. The first entry is
where FFT_FIRST_K+1 should be used, the second FFT_FIRST_K+2,
etc. See mpn_fft_best_k(). */
-#ifndef FFT_MUL_TABLE
-#define FFT_MUL_TABLE \
- { TOOM3_MUL_THRESHOLD * 4, /* k=5 */ \
- TOOM3_MUL_THRESHOLD * 8, /* k=6 */ \
- TOOM3_MUL_THRESHOLD * 16, /* k=7 */ \
- TOOM3_MUL_THRESHOLD * 32, /* k=8 */ \
- TOOM3_MUL_THRESHOLD * 96, /* k=9 */ \
- TOOM3_MUL_THRESHOLD * 288, /* k=10 */ \
+#ifndef MUL_FFT_TABLE
+#define MUL_FFT_TABLE \
+ { MUL_TOOM3_THRESHOLD * 4, /* k=5 */ \
+ MUL_TOOM3_THRESHOLD * 8, /* k=6 */ \
+ MUL_TOOM3_THRESHOLD * 16, /* k=7 */ \
+ MUL_TOOM3_THRESHOLD * 32, /* k=8 */ \
+ MUL_TOOM3_THRESHOLD * 96, /* k=9 */ \
+ MUL_TOOM3_THRESHOLD * 288, /* k=10 */ \
0 }
#endif
-#ifndef FFT_SQR_TABLE
-#define FFT_SQR_TABLE \
- { TOOM3_SQR_THRESHOLD * 4, /* k=5 */ \
- TOOM3_SQR_THRESHOLD * 8, /* k=6 */ \
- TOOM3_SQR_THRESHOLD * 16, /* k=7 */ \
- TOOM3_SQR_THRESHOLD * 32, /* k=8 */ \
- TOOM3_SQR_THRESHOLD * 96, /* k=9 */ \
- TOOM3_SQR_THRESHOLD * 288, /* k=10 */ \
+#ifndef SQR_FFT_TABLE
+#define SQR_FFT_TABLE \
+ { SQR_TOOM3_THRESHOLD * 4, /* k=5 */ \
+ SQR_TOOM3_THRESHOLD * 8, /* k=6 */ \
+ SQR_TOOM3_THRESHOLD * 16, /* k=7 */ \
+ SQR_TOOM3_THRESHOLD * 32, /* k=8 */ \
+ SQR_TOOM3_THRESHOLD * 96, /* k=9 */ \
+ SQR_TOOM3_THRESHOLD * 288, /* k=10 */ \
0 }
#endif
@@ -1153,13 +1153,13 @@ extern const mp_limb_t __gmp_fib_table[];
/* mpn_dc_divrem_n(n) calls 2*mul(n/2)+2*div(n/2), thus to be faster than
div(n) = 4*div(n/2), we need mul(n/2) to be faster than the classic way,
- i.e. n/2 >= KARATSUBA_MUL_THRESHOLD
+ i.e. n/2 >= MUL_KARATSUBA_THRESHOLD
- Measured values are between 2 and 4 times KARATSUBA_MUL_THRESHOLD, so go
+ Measured values are between 2 and 4 times MUL_KARATSUBA_THRESHOLD, so go
for 3 as an average. */
-#ifndef DC_THRESHOLD
-#define DC_THRESHOLD (3 * KARATSUBA_MUL_THRESHOLD)
+#ifndef DIV_DC_THRESHOLD
+#define DIV_DC_THRESHOLD (3 * MUL_KARATSUBA_THRESHOLD)
#endif
@@ -2701,18 +2701,18 @@ extern mp_size_t mod_1_unnorm_threshold[];
extern mp_size_t get_str_basecase_threshold[];
extern mp_size_t get_str_precompute_threshold[];
-#undef KARATSUBA_MUL_THRESHOLD
-#undef TOOM3_MUL_THRESHOLD
-#undef FFT_MUL_TABLE
-#undef FFT_MUL_THRESHOLD
-#undef FFT_MODF_MUL_THRESHOLD
-#undef BASECASE_SQR_THRESHOLD
-#undef KARATSUBA_SQR_THRESHOLD
-#undef TOOM3_SQR_THRESHOLD
-#undef FFT_SQR_TABLE
-#undef FFT_SQR_THRESHOLD
-#undef FFT_MODF_SQR_THRESHOLD
-#undef DC_THRESHOLD
+#undef MUL_KARATSUBA_THRESHOLD
+#undef MUL_TOOM3_THRESHOLD
+#undef MUL_FFT_TABLE
+#undef MUL_FFT_THRESHOLD
+#undef MUL_FFT_MODF_THRESHOLD
+#undef SQR_BASECASE_THRESHOLD
+#undef SQR_KARATSUBA_THRESHOLD
+#undef SQR_TOOM3_THRESHOLD
+#undef SQR_FFT_TABLE
+#undef SQR_FFT_THRESHOLD
+#undef SQR_FFT_MODF_THRESHOLD
+#undef DIV_DC_THRESHOLD
#undef POWM_THRESHOLD
#undef GCD_ACCEL_THRESHOLD
#undef GCDEXT_THRESHOLD
@@ -2720,21 +2720,21 @@ extern mp_size_t get_str_precompute_threshold[];
#undef DIVREM_1_UNNORM_THRESHOLD
#undef MOD_1_NORM_THRESHOLD
#undef MOD_1_UNNORM_THRESHOLD
-#undef GET_STR_BASECASE_THRESHOLD
+#undef GET_STR_DC_THRESHOLD
#undef GET_STR_PRECOMPUTE_THRESHOLD
-#define KARATSUBA_MUL_THRESHOLD mul_threshold[0]
-#define TOOM3_MUL_THRESHOLD mul_threshold[1]
-#define FFT_MUL_TABLE { 0 }
-#define FFT_MUL_THRESHOLD mul_threshold[2]
-#define FFT_MODF_MUL_THRESHOLD fft_modf_mul_threshold
-#define BASECASE_SQR_THRESHOLD sqr_threshold[0]
-#define KARATSUBA_SQR_THRESHOLD sqr_threshold[1]
-#define TOOM3_SQR_THRESHOLD sqr_threshold[2]
-#define FFT_SQR_TABLE { 0 }
-#define FFT_SQR_THRESHOLD sqr_threshold[3]
-#define FFT_MODF_SQR_THRESHOLD fft_modf_sqr_threshold
-#define DC_THRESHOLD dc_threshold[0]
+#define MUL_KARATSUBA_THRESHOLD mul_threshold[0]
+#define MUL_TOOM3_THRESHOLD mul_threshold[1]
+#define MUL_FFT_TABLE { 0 }
+#define MUL_FFT_THRESHOLD mul_threshold[2]
+#define MUL_FFT_MODF_THRESHOLD fft_modf_mul_threshold
+#define SQR_BASECASE_THRESHOLD sqr_threshold[0]
+#define SQR_KARATSUBA_THRESHOLD sqr_threshold[1]
+#define SQR_TOOM3_THRESHOLD sqr_threshold[2]
+#define SQR_FFT_TABLE { 0 }
+#define SQR_FFT_THRESHOLD sqr_threshold[3]
+#define SQR_FFT_MODF_THRESHOLD fft_modf_sqr_threshold
+#define DIV_DC_THRESHOLD dc_threshold[0]
#define POWM_THRESHOLD powm_threshold[0]
#define GCD_ACCEL_THRESHOLD gcd_accel_threshold[0]
#define GCDEXT_THRESHOLD gcdext_threshold[0]
@@ -2742,19 +2742,19 @@ extern mp_size_t get_str_precompute_threshold[];
#define DIVREM_1_UNNORM_THRESHOLD divrem_1_unnorm_threshold[0]
#define MOD_1_NORM_THRESHOLD mod_1_norm_threshold[0]
#define MOD_1_UNNORM_THRESHOLD mod_1_unnorm_threshold[0]
-#define GET_STR_BASECASE_THRESHOLD get_str_basecase_threshold[0]
+#define GET_STR_DC_THRESHOLD get_str_basecase_threshold[0]
#define GET_STR_PRECOMPUTE_THRESHOLD get_str_precompute_threshold[0]
#if ! UDIV_PREINV_ALWAYS
-#undef SB_PREINV_THRESHOLD
+#undef DIV_SB_PREINV_THRESHOLD
#undef DIVREM_2_THRESHOLD
-#define SB_PREINV_THRESHOLD sb_preinv_threshold[0]
+#define DIV_SB_PREINV_THRESHOLD sb_preinv_threshold[0]
#define DIVREM_2_THRESHOLD divrem_2_threshold[0]
#endif
/* Sizes the tune program tests up to, used in a couple of recompilations. */
-#define KARATSUBA_SQR_MAX_GENERIC 200
-#define TOOM3_MUL_THRESHOLD_LIMIT 700
+#define SQR_KARATSUBA_MAX_GENERIC 200
+#define MUL_TOOM3_THRESHOLD_LIMIT 700
#define GET_STR_THRESHOLD_LIMIT 500
#undef FFT_TABLE_ATTRS
@@ -2762,8 +2762,8 @@ extern mp_size_t get_str_precompute_threshold[];
extern mp_size_t mpn_fft_table[2][MPN_FFT_TABLE_SIZE];
#if TUNE_PROGRAM_BUILD_SQR
-#undef KARATSUBA_SQR_THRESHOLD
-#define KARATSUBA_SQR_THRESHOLD KARATSUBA_SQR_MAX_GENERIC
+#undef SQR_KARATSUBA_THRESHOLD
+#define SQR_KARATSUBA_THRESHOLD SQR_KARATSUBA_MAX_GENERIC
#endif
#endif /* TUNE_PROGRAM_BUILD */
diff --git a/gmp.texi b/gmp.texi
index 8c08ecd2b..af0d9be41 100644
--- a/gmp.texi
+++ b/gmp.texi
@@ -6113,9 +6113,9 @@ algorithms, as the size N increases.
@multitable {KaratsubaMMM} {MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM}
@item Algorithm @tab Threshold
@item Basecase @tab (none)
-@item Karatsuba @tab @code{KARATSUBA_MUL_THRESHOLD}
-@item Toom-3 @tab @code{TOOM3_MUL_THRESHOLD}
-@item FFT @tab @code{FFT_MUL_THRESHOLD}
+@item Karatsuba @tab @code{MUL_KARATSUBA_THRESHOLD}
+@item Toom-3 @tab @code{MUL_TOOM3_THRESHOLD}
+@item FFT @tab @code{MUL_FFT_THRESHOLD}
@end multitable
@end quotation
@@ -6124,7 +6124,7 @@ FFT is only used if GMP is configured with @samp{--enable-fft}, @pxref{Build
Options}.
N@cross{}M multiplications of operands with different sizes above
-@code{KARATSUBA_MUL_THRESHOLD} are currently done by splitting into M@cross{}M
+@code{MUL_KARATSUBA_THRESHOLD} are currently done by splitting into M@cross{}M
pieces. The Karatsuba and Toom-3 routines then operate only on equal size
operands. This is not very efficient, and is slated for improvement in the
future.
@@ -6222,7 +6222,7 @@ usually around 1.5@cross{}. Less than 1.5@cross{} probably indicates
@code{mpn_sqr_basecase} wants improving on that CPU.
On some CPUs @code{mpn_mul_basecase} can be faster than the generic C
-@code{mpn_sqr_basecase}. @code{BASECASE_SQR_THRESHOLD} is the size at which
+@code{mpn_sqr_basecase}. @code{SQR_BASECASE_THRESHOLD} is the size at which
to use @code{mpn_sqr_basecase}, this will be zero if that routine should be
used always.
@@ -6373,7 +6373,7 @@ each 1/2 the size of the inputs. This is a big improvement over the basecase
multiply at @ma{O(N^2)} and the advantage soon overcomes the extra additions
Karatsuba performs.
-@code{KARATSUBA_MUL_THRESHOLD} can be as little as 10 limbs. The @code{SQR}
+@code{MUL_KARATSUBA_THRESHOLD} can be as little as 10 limbs. The @code{SQR}
threshold is usually about twice the @code{MUL}. The basecase algorithm will
take a time of the form @m{M(N) = aN^2 + bN + c, M(N) = a*N^2 + b*N + c} and
the Karatsuba algorithm @m{K(N) = 3M(N/2) + dN + e, K(N) = 3*M(N/2) + d*N +
@@ -6667,7 +6667,7 @@ only realizes its advantage above a certain size.
Near the crossover between Toom-3 and Karatsuba there's generally a range of
sizes where the difference between the two is small.
-@code{TOOM3_MUL_THRESHOLD} is a somewhat arbitrary point in that range and
+@code{MUL_TOOM3_THRESHOLD} is a somewhat arbitrary point in that range and
successive runs of the tune program can give different values due to small
variations in measuring. A graph of time versus size for the two shows the
effect, see @file{tune/README}.
@@ -6756,16 +6756,16 @@ For a mod @ma{2^N+1} product, an FFT-@ma{k} is an @m{O(N^{k/(k-1)}),
O(N^(k/(k-1)))} algorithm, the exponent representing @ma{2^k} recursed modular
multiplies each @m{1/2^{k-1},1/2^(k-1)} the size of the original. Each
successive @ma{k} is an asymptotic improvement, but overheads mean each is
-only faster at bigger and bigger sizes. In the code, @code{FFT_MUL_TABLE} and
-@code{FFT_SQR_TABLE} are the thresholds where each @ma{k} is used. Each new
+only faster at bigger and bigger sizes. In the code, @code{MUL_FFT_TABLE} and
+@code{SQR_FFT_TABLE} are the thresholds where each @ma{k} is used. Each new
@ma{k} effectively swaps some multiplying for some shifts, adds and overheads.
A mod @ma{2^N+1} product can be formed with a normal
@ma{N@cross{}N@rightarrow{}2N} bit multiply plus a subtraction, so an FFT and
Toom-3 etc can be compared directly. A @ma{k=4} FFT at @ma{O(N^@W{1.333})}
can be expected to be the first faster than Toom-3 at @ma{O(N^@W{1.465})}. In
-practice this is what's found, with @code{FFT_MODF_MUL_THRESHOLD} and
-@code{FFT_MODF_SQR_THRESHOLD} being between 300 and 1000 limbs, depending on
+practice this is what's found, with @code{MUL_FFT_MODF_THRESHOLD} and
+@code{SQR_FFT_MODF_THRESHOLD} being between 300 and 1000 limbs, depending on
the CPU. So far it's been found that only very large FFTs recurse into
pointwise multiplies above these sizes.
@@ -6776,7 +6776,7 @@ recursing into a normal multiply and that on that basis it's doing @ma{2^k}
recursed multiplies each @m{1/2^{k-2},1/2^(k-2)} the size of the inputs,
making it @m{O(N^{k/(k-2)}), O(N^(k/(k-2)))}. This would mean @ma{k=7} at
@ma{O(N^@W{1.4})} would be the first FFT faster than Toom-3. In practice
-@code{FFT_MUL_THRESHOLD} and @code{FFT_SQR_THRESHOLD} have been found to be in
+@code{MUL_FFT_THRESHOLD} and @code{SQR_FFT_THRESHOLD} have been found to be in
the @ma{k=8} range, somewhere between 3000 and 10000 limbs.
The way @ma{N} is split into @ma{2^k} pieces and then @ma{2M+k+3} is rounded
@@ -6799,7 +6799,7 @@ and so the step effect is quite noticeable in a time versus size graph.
The threshold determinations currently measure at the mid-points of size
steps, but this is sub-optimal since at the start of a new step it can happen
that it's better to go back to the previous @ma{k} for a while. Something
-more sophisticated for @code{FFT_MUL_TABLE} and @code{FFT_SQR_TABLE} will be
+more sophisticated for @code{MUL_FFT_TABLE} and @code{SQR_FFT_TABLE} will be
needed.
@@ -6938,7 +6938,7 @@ divide for each of the Q quotient limbs.
@node Divide and Conquer Division, Exact Division, Basecase Division, Division Algorithms
@subsection Divide and Conquer Division
-For divisors larger than @code{DC_THRESHOLD}, division is done by dividing.
+For divisors larger than @code{DIV_DC_THRESHOLD}, division is done by dividing.
Or to be precise by a recursive divide and conquer algorithm based on work by
Moenck and Borodin, Jebelean, and Burnikel and Ziegler (@pxref{References}).
@@ -6954,11 +6954,11 @@ If the (N/2)@cross{}(N/2) multiplies are done with a basecase multiplication
then the work is about the same as a basecase division, but with more function
call overheads and with some subtractions separated from the multiplies.
These overheads mean that it's only when N/2 is above
-@code{KARATSUBA_MUL_THRESHOLD} that divide and conquer is of use.
+@code{MUL_KARATSUBA_THRESHOLD} that divide and conquer is of use.
-@code{DC_THRESHOLD} is based on the divisor size N, so it will be somewhere
-above twice @code{KARATSUBA_MUL_THRESHOLD}, but how much above depends on the
-CPU. An optimized @code{mpn_mul_basecase} can lower @code{DC_THRESHOLD} a
+@code{DIV_DC_THRESHOLD} is based on the divisor size N, so it will be somewhere
+above twice @code{MUL_KARATSUBA_THRESHOLD}, but how much above depends on the
+CPU. An optimized @code{mpn_mul_basecase} can lower @code{DIV_DC_THRESHOLD} a
little by offering a ready-made advantage over repeated @code{mpn_submul_1}
calls.
diff --git a/mpn/alpha/ev5/gmp-mparam.h b/mpn/alpha/ev5/gmp-mparam.h
index 1005144e4..55e3b25b9 100644
--- a/mpn/alpha/ev5/gmp-mparam.h
+++ b/mpn/alpha/ev5/gmp-mparam.h
@@ -1,6 +1,7 @@
/* Alpha EV5 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -27,15 +28,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-08, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 14
-#define TOOM3_MUL_THRESHOLD 81
+#define MUL_KARATSUBA_THRESHOLD 14
+#define MUL_TOOM3_THRESHOLD 81
-#define BASECASE_SQR_THRESHOLD 4
-#define KARATSUBA_SQR_THRESHOLD 28
-#define TOOM3_SQR_THRESHOLD 87
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_KARATSUBA_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 87
-#define SB_PREINV_THRESHOLD 0 /* preinv always */
-#define DC_THRESHOLD 48
+#define DIV_SB_PREINV_THRESHOLD 0 /* preinv always */
+#define DIV_DC_THRESHOLD 48
#define POWM_THRESHOLD 87
#define GCD_ACCEL_THRESHOLD 3
@@ -52,14 +53,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 20
+#define GET_STR_DC_THRESHOLD 20
#define GET_STR_PRECOMPUTE_THRESHOLD 36
#define SET_STR_THRESHOLD 3664
-#define FFT_MUL_TABLE { 496, 1056, 2624, 4352, 11264, 36864, 0 }
-#define FFT_MODF_MUL_THRESHOLD 592
-#define FFT_MUL_THRESHOLD 5248
+#define MUL_FFT_TABLE { 496, 1056, 2624, 4352, 11264, 36864, 0 }
+#define MUL_FFT_MODF_THRESHOLD 592
+#define MUL_FFT_THRESHOLD 5248
-#define FFT_SQR_TABLE { 496, 992, 2752, 3840, 11264, 28672, 0 }
-#define FFT_MODF_SQR_THRESHOLD 592
-#define FFT_SQR_THRESHOLD 4736
+#define SQR_FFT_TABLE { 496, 992, 2752, 3840, 11264, 28672, 0 }
+#define SQR_FFT_MODF_THRESHOLD 592
+#define SQR_FFT_THRESHOLD 4736
diff --git a/mpn/alpha/ev6/gmp-mparam.h b/mpn/alpha/ev6/gmp-mparam.h
index f66530416..29da1e0c6 100644
--- a/mpn/alpha/ev6/gmp-mparam.h
+++ b/mpn/alpha/ev6/gmp-mparam.h
@@ -1,6 +1,7 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -24,15 +25,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-06, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 31
-#define TOOM3_MUL_THRESHOLD 142
+#define MUL_KARATSUBA_THRESHOLD 31
+#define MUL_TOOM3_THRESHOLD 142
-#define BASECASE_SQR_THRESHOLD 5
-#define KARATSUBA_SQR_THRESHOLD 66
-#define TOOM3_SQR_THRESHOLD 133
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_KARATSUBA_THRESHOLD 66
+#define SQR_TOOM3_THRESHOLD 133
-#define SB_PREINV_THRESHOLD 0 /* preinv always */
-#define DC_THRESHOLD 129
+#define DIV_SB_PREINV_THRESHOLD 0 /* preinv always */
+#define DIV_DC_THRESHOLD 129
#define POWM_THRESHOLD 271
#define GCD_ACCEL_THRESHOLD 3
@@ -49,14 +50,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 19
+#define GET_STR_DC_THRESHOLD 19
#define GET_STR_PRECOMPUTE_THRESHOLD 28
#define SET_STR_THRESHOLD 46000
-#define FFT_MUL_TABLE { 688, 1440, 2880, 6400, 15360, 45056, 0 }
-#define FFT_MODF_MUL_THRESHOLD 752
-#define FFT_MUL_THRESHOLD 6272
+#define MUL_FFT_TABLE { 688, 1440, 2880, 6400, 15360, 45056, 0 }
+#define MUL_FFT_MODF_THRESHOLD 752
+#define MUL_FFT_THRESHOLD 6272
-#define FFT_SQR_TABLE { 624, 1376, 3264, 6400, 17408, 36864, 0 }
-#define FFT_MODF_SQR_THRESHOLD 752
-#define FFT_SQR_THRESHOLD 7040
+#define SQR_FFT_TABLE { 624, 1376, 3264, 6400, 17408, 36864, 0 }
+#define SQR_FFT_MODF_THRESHOLD 752
+#define SQR_FFT_THRESHOLD 7040
diff --git a/mpn/alpha/gmp-mparam.h b/mpn/alpha/gmp-mparam.h
index db0616dfe..9992ff97f 100644
--- a/mpn/alpha/gmp-mparam.h
+++ b/mpn/alpha/gmp-mparam.h
@@ -1,6 +1,7 @@
/* Alpha EV4 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -27,15 +28,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-08, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 12
-#define TOOM3_MUL_THRESHOLD 69
+#define MUL_KARATSUBA_THRESHOLD 12
+#define MUL_TOOM3_THRESHOLD 69
-#define BASECASE_SQR_THRESHOLD 4
-#define KARATSUBA_SQR_THRESHOLD 22
-#define TOOM3_SQR_THRESHOLD 77
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_KARATSUBA_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 77
-#define SB_PREINV_THRESHOLD 0 /* preinv always */
-#define DC_THRESHOLD 41
+#define DIV_SB_PREINV_THRESHOLD 0 /* preinv always */
+#define DIV_DC_THRESHOLD 41
#define POWM_THRESHOLD 54
#define GCD_ACCEL_THRESHOLD 3
@@ -52,14 +53,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 22
+#define GET_STR_DC_THRESHOLD 22
#define GET_STR_PRECOMPUTE_THRESHOLD 42
#define SET_STR_THRESHOLD 3259
-#define FFT_MUL_TABLE { 400, 928, 1856, 3840, 7168, 20480, 0 }
-#define FFT_MODF_MUL_THRESHOLD 416
-#define FFT_MUL_THRESHOLD 2944
+#define MUL_FFT_TABLE { 400, 928, 1856, 3840, 7168, 20480, 0 }
+#define MUL_FFT_MODF_THRESHOLD 416
+#define MUL_FFT_THRESHOLD 2944
-#define FFT_SQR_TABLE { 400, 992, 1984, 3840, 9216, 20480, 0 }
-#define FFT_MODF_SQR_THRESHOLD 416
-#define FFT_SQR_THRESHOLD 2944
+#define SQR_FFT_TABLE { 400, 992, 1984, 3840, 9216, 20480, 0 }
+#define SQR_FFT_MODF_THRESHOLD 416
+#define SQR_FFT_THRESHOLD 2944
diff --git a/mpn/arm/gmp-mparam.h b/mpn/arm/gmp-mparam.h
index 25d565e61..a3b3e9e3f 100644
--- a/mpn/arm/gmp-mparam.h
+++ b/mpn/arm/gmp-mparam.h
@@ -1,6 +1,7 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -25,14 +26,14 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-02-23. */
-#define KARATSUBA_MUL_THRESHOLD 21
-#define TOOM3_MUL_THRESHOLD 252
+#define MUL_KARATSUBA_THRESHOLD 21
+#define MUL_TOOM3_THRESHOLD 252
-#define KARATSUBA_SQR_THRESHOLD 46
-#define TOOM3_SQR_THRESHOLD 309
+#define SQR_KARATSUBA_THRESHOLD 46
+#define SQR_TOOM3_THRESHOLD 309
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 92
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 92
#define POWM_THRESHOLD 95
#define GCD_ACCEL_THRESHOLD 3
@@ -47,12 +48,12 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 688, 1504, 2944, 6656, 18432, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 704
-#define FFT_MUL_THRESHOLD 6912
+#define MUL_FFT_TABLE { 688, 1504, 2944, 6656, 18432, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 704
+#define MUL_FFT_THRESHOLD 6912
-#define FFT_SQR_TABLE { 688, 1056, 2688, 6656, 22528, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 704
-#define FFT_SQR_THRESHOLD 5376
+#define SQR_FFT_TABLE { 688, 1056, 2688, 6656, 22528, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 704
+#define SQR_FFT_THRESHOLD 5376
/* Tuneup completed successfully, took 4035 seconds */
diff --git a/mpn/asm-defs.m4 b/mpn/asm-defs.m4
index 43c395159..033f78534 100644
--- a/mpn/asm-defs.m4
+++ b/mpn/asm-defs.m4
@@ -9,7 +9,7 @@ dnl GNU m4 and OpenBSD 2.7 m4 will give filenames and line numbers in error
dnl messages.
-dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+dnl Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -986,7 +986,7 @@ dnl Check that `symbol' is defined. If it isn't, issue an error and
dnl terminate immediately. The error message explains that the symbol
dnl should be in config.m4, copied from gmp-mparam.h.
dnl
-dnl Termination is immediate since missing say KARATSUBA_SQR_THRESHOLD can
+dnl Termination is immediate since missing say SQR_KARATSUBA_THRESHOLD can
dnl lead to infinite loops and endless error messages.
define(m4_config_gmp_mparam,
diff --git a/mpn/cray/gmp-mparam.h b/mpn/cray/gmp-mparam.h
index 31cdd4eaf..2f08f4cb5 100644
--- a/mpn/cray/gmp-mparam.h
+++ b/mpn/cray/gmp-mparam.h
@@ -1,6 +1,7 @@
/* Cray T90 CFP gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1996, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -31,15 +32,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-28, system compiler */
-#define KARATSUBA_MUL_THRESHOLD 71
-#define TOOM3_MUL_THRESHOLD 131
+#define MUL_KARATSUBA_THRESHOLD 71
+#define MUL_TOOM3_THRESHOLD 131
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 199
-#define TOOM3_SQR_THRESHOLD 363
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 199
+#define SQR_TOOM3_THRESHOLD 363
-#define SB_PREINV_THRESHOLD 0 /* (preinv always) */
-#define DC_THRESHOLD 577
+#define DIV_SB_PREINV_THRESHOLD 0 /* (preinv always) */
+#define DIV_DC_THRESHOLD 577
#define POWM_THRESHOLD 601
#define GCD_ACCEL_THRESHOLD 3
@@ -54,10 +55,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 368, 736, 1472, 2816, 7168, 12288, 49152, 0 }
-#define FFT_MODF_MUL_THRESHOLD 184
-#define FFT_MUL_THRESHOLD 864
+#define MUL_FFT_TABLE { 368, 736, 1472, 2816, 7168, 12288, 49152, 0 }
+#define MUL_FFT_MODF_THRESHOLD 184
+#define MUL_FFT_THRESHOLD 864
-#define FFT_SQR_TABLE { 1008, 2080, 4544, 8960, 19456, 45056, 0 }
-#define FFT_MODF_SQR_THRESHOLD 600
-#define FFT_SQR_THRESHOLD 2976
+#define SQR_FFT_TABLE { 1008, 2080, 4544, 8960, 19456, 45056, 0 }
+#define SQR_FFT_MODF_THRESHOLD 600
+#define SQR_FFT_THRESHOLD 2976
diff --git a/mpn/cray/ieee/gmp-mparam.h b/mpn/cray/ieee/gmp-mparam.h
index ad5f2ecc3..3bc3e7b48 100644
--- a/mpn/cray/ieee/gmp-mparam.h
+++ b/mpn/cray/ieee/gmp-mparam.h
@@ -30,15 +30,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-12, system compiler */
-#define KARATSUBA_MUL_THRESHOLD 130
-#define TOOM3_MUL_THRESHOLD 517
+#define MUL_KARATSUBA_THRESHOLD 130
+#define MUL_TOOM3_THRESHOLD 517
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 130
-#define TOOM3_SQR_THRESHOLD 260
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 130
+#define SQR_TOOM3_THRESHOLD 260
-#define SB_PREINV_THRESHOLD 0 /* (preinv always) */
-#define DC_THRESHOLD 390
+#define DIV_SB_PREINV_THRESHOLD 0 /* (preinv always) */
+#define DIV_DC_THRESHOLD 390
#define POWM_THRESHOLD 656
#define GCD_ACCEL_THRESHOLD 3
@@ -55,10 +55,10 @@ MA 02111-1307, USA. */
#define SET_STR_THRESHOLD 26000
-#define FFT_MUL_TABLE { 1264, 2784, 5952, 12032, 25600, 0 }
-#define FFT_MODF_MUL_THRESHOLD 776
-#define FFT_MUL_THRESHOLD 5408
+#define MUL_FFT_TABLE { 1264, 2784, 5952, 12032, 25600, 0 }
+#define MUL_FFT_MODF_THRESHOLD 776
+#define MUL_FFT_THRESHOLD 5408
-#define FFT_SQR_TABLE { 1040, 2080, 4160, 8448, 17408, 36864, 0 }
-#define FFT_MODF_SQR_THRESHOLD 856
-#define FFT_SQR_THRESHOLD 3488
+#define SQR_FFT_TABLE { 1040, 2080, 4160, 8448, 17408, 36864, 0 }
+#define SQR_FFT_MODF_THRESHOLD 856
+#define SQR_FFT_THRESHOLD 3488
diff --git a/mpn/generic/dc_divrem_n.c b/mpn/generic/dc_divrem_n.c
index 15a8a35af..13ac1587e 100644
--- a/mpn/generic/dc_divrem_n.c
+++ b/mpn/generic/dc_divrem_n.c
@@ -6,7 +6,7 @@
FUTURE GNU MP RELEASE.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Paul Zimmermann.
This file is part of the GNU MP Library.
@@ -112,7 +112,7 @@ mpn_dc_div_3_halves_by_2 (mp_ptr qp, mp_ptr np, mp_srcptr dp, mp_size_t n)
TMP_DECL (marker);
TMP_MARK (marker);
- if (n < DC_THRESHOLD)
+ if (n < DIV_DC_THRESHOLD)
qhl = mpn_sb_divrem_mn (qp, np + n, twon, dp + n, n);
else
qhl = mpn_dc_divrem_n (qp, np + n, dp + n, n);
diff --git a/mpn/generic/get_str.c b/mpn/generic/get_str.c
index dcb555d30..d17239eee 100644
--- a/mpn/generic/get_str.c
+++ b/mpn/generic/get_str.c
@@ -81,11 +81,11 @@ MA 02111-1307, USA. */
mpn_dc_get_str:
mpn_tdiv_qr
- if (qn < GET_STR_BASECASE_THRESHOLD)
+ if (qn < GET_STR_DC_THRESHOLD)
mpn_sb_get_str
else
mpn_dc_get_str
- if (rn < GET_STR_BASECASE_THRESHOLD)
+ if (rn < GET_STR_DC_THRESHOLD)
mpn_sb_get_str
else
mpn_dc_get_str
@@ -126,8 +126,8 @@ MA 02111-1307, USA. */
#endif
/* When to stop divide-and-conquer and call the basecase mpn_get_str. */
-#ifndef GET_STR_BASECASE_THRESHOLD
-#define GET_STR_BASECASE_THRESHOLD 15
+#ifndef GET_STR_DC_THRESHOLD
+#define GET_STR_DC_THRESHOLD 15
#endif
/* Whether to bother at all with precomputing powers of the base, or go
to the basecase mpn_get_str directly. */
@@ -317,7 +317,7 @@ mpn_dc_get_str (unsigned char *str, size_t len,
mp_ptr up, mp_size_t un,
powers_t *powtab)
{
- if (un < GET_STR_BASECASE_THRESHOLD)
+ if (un < GET_STR_DC_THRESHOLD)
{
if (un != 0)
str = mpn_sb_get_str (str, len, up, un, powtab);
diff --git a/mpn/generic/mul.c b/mpn/generic/mul.c
index 97bf196be..a7d49940f 100644
--- a/mpn/generic/mul.c
+++ b/mpn/generic/mul.c
@@ -6,7 +6,7 @@
THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 1991, 1993, 1994, 1996, 1997, 1999, 2000, 2001 Free Software
+Copyright 1991, 1993, 1994, 1996, 1997, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -52,15 +52,15 @@ mpn_sqr_n (mp_ptr prodp,
if (un == 0)
return;
- if (BELOW_THRESHOLD (un, BASECASE_SQR_THRESHOLD))
+ if (BELOW_THRESHOLD (un, SQR_BASECASE_THRESHOLD))
{ /* mul_basecase is faster than sqr_basecase on small sizes sometimes */
mpn_mul_basecase (prodp, up, un, up, un);
}
- else if (BELOW_THRESHOLD (un, KARATSUBA_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (un, SQR_KARATSUBA_THRESHOLD))
{ /* plain schoolbook multiplication */
mpn_sqr_basecase (prodp, up, un);
}
- else if (BELOW_THRESHOLD (un, TOOM3_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (un, SQR_TOOM3_THRESHOLD))
{ /* karatsuba multiplication */
mp_ptr tspace;
TMP_DECL (marker);
@@ -70,13 +70,13 @@ mpn_sqr_n (mp_ptr prodp,
TMP_FREE (marker);
}
#if WANT_FFT || TUNE_PROGRAM_BUILD
- else if (BELOW_THRESHOLD (un, FFT_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (un, SQR_FFT_THRESHOLD))
#else
else
#endif
{ /* Toom3 multiplication.
Use workspace from the heap, as stack may be limited. Since n is
- at least TOOM3_MUL_THRESHOLD, the multiplication will take much
+ at least MUL_TOOM3_THRESHOLD, the multiplication will take much
longer than malloc()/free(). */
mp_ptr tspace;
mp_size_t tsize;
@@ -113,7 +113,7 @@ mpn_mul (mp_ptr prodp,
return prodp[2 * un - 1];
}
- if (vn < KARATSUBA_MUL_THRESHOLD)
+ if (vn < MUL_KARATSUBA_THRESHOLD)
{ /* long multiplication */
mpn_mul_basecase (prodp, up, un, vp, vn);
return prodp[un + vn - 1];
@@ -137,11 +137,11 @@ mpn_mul (mp_ptr prodp,
MPN_SRCPTR_SWAP (up,un, vp,vn);
}
- ws = (mp_ptr) TMP_ALLOC (((vn >= KARATSUBA_MUL_THRESHOLD ? vn : un) + vn)
+ ws = (mp_ptr) TMP_ALLOC (((vn >= MUL_KARATSUBA_THRESHOLD ? vn : un) + vn)
* BYTES_PER_MP_LIMB);
t = 0;
- while (vn >= KARATSUBA_MUL_THRESHOLD)
+ while (vn >= MUL_KARATSUBA_THRESHOLD)
{
mpn_mul_n (ws, up, vp, vn);
if (l <= 2*vn)
diff --git a/mpn/generic/mul_basecase.c b/mpn/generic/mul_basecase.c
index 22b39cad0..59ee83b4c 100644
--- a/mpn/generic/mul_basecase.c
+++ b/mpn/generic/mul_basecase.c
@@ -5,7 +5,7 @@
SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
-Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2000, 2001 Free Software
+Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,7 @@ MA 02111-1307, USA. */
Note that prodp gets usize+vsize limbs stored, even if the actual result
only needs usize+vsize-1.
- There's no good reason to call here with vsize>=KARATSUBA_MUL_THRESHOLD.
+ There's no good reason to call here with vsize>=MUL_KARATSUBA_THRESHOLD.
Currently this is allowed, but it might not be in the future.
This is the most critical code for multiplication. All multiplies rely
diff --git a/mpn/generic/mul_fft.c b/mpn/generic/mul_fft.c
index b827f184c..d737d1702 100644
--- a/mpn/generic/mul_fft.c
+++ b/mpn/generic/mul_fft.c
@@ -62,8 +62,8 @@ MA 02111-1307, USA. */
FFT_TABLE_ATTRS mp_size_t mpn_fft_table[2][MPN_FFT_TABLE_SIZE] = {
- FFT_MUL_TABLE,
- FFT_SQR_TABLE
+ MUL_FFT_TABLE,
+ SQR_FFT_TABLE
};
@@ -332,7 +332,7 @@ mpn_fft_mul_modF_K (mp_ptr *ap, mp_ptr *bp, mp_size_t n, int K)
TMP_MARK(marker);
- if (n >= (sqr ? FFT_MODF_SQR_THRESHOLD : FFT_MODF_MUL_THRESHOLD))
+ if (n >= (sqr ? SQR_FFT_MODF_THRESHOLD : MUL_FFT_MODF_THRESHOLD))
{
int k, K2,nprime2,Nprime2,M2,maxLK,l,Mp2;
int **_fft_l;
@@ -629,7 +629,7 @@ mpn_mul_fft (mp_ptr op, mp_size_t pl,
nprime = Nprime / BITS_PER_MP_LIMB;
TRACE (printf ("N=%d K=%d, M=%d, l=%d, maxLK=%d, Np=%d, np=%d\n",
N, K, M, l, maxLK, Nprime, nprime));
- if (nprime >= (sqr ? FFT_MODF_SQR_THRESHOLD : FFT_MODF_MUL_THRESHOLD))
+ if (nprime >= (sqr ? SQR_FFT_MODF_THRESHOLD : MUL_FFT_MODF_THRESHOLD))
{
maxLK = (1 << mpn_fft_best_k (nprime,n == m)) * BITS_PER_MP_LIMB;
if (Nprime % maxLK)
diff --git a/mpn/generic/mul_n.c b/mpn/generic/mul_n.c
index 67bea5d97..0d880e3d9 100644
--- a/mpn/generic/mul_n.c
+++ b/mpn/generic/mul_n.c
@@ -6,8 +6,8 @@
THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 1991, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001 Free Software
-Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free
+Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -138,9 +138,9 @@ mpn_kara_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n, mp_ptr ws)
p[n] = w;
n1 = n + 1;
- if (n2 < KARATSUBA_MUL_THRESHOLD)
+ if (n2 < MUL_KARATSUBA_THRESHOLD)
{
- if (n3 < KARATSUBA_MUL_THRESHOLD)
+ if (n3 < MUL_KARATSUBA_THRESHOLD)
{
mpn_mul_basecase (ws, p, n3, p + n3, n3);
mpn_mul_basecase (p, a, n3, b, n3);
@@ -230,7 +230,7 @@ mpn_kara_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n, mp_ptr ws)
mpn_sub_n (p + n2, x, y, n2);
/* Pointwise products. */
- if (n2 < KARATSUBA_MUL_THRESHOLD)
+ if (n2 < MUL_KARATSUBA_THRESHOLD)
{
mpn_mul_basecase (ws, p, n2, p + n2, n2);
mpn_mul_basecase (p, a, n2, b, n2);
@@ -304,12 +304,12 @@ mpn_kara_sqr_n (mp_ptr p, mp_srcptr a, mp_size_t n, mp_ptr ws)
/* n2 is always either n3 or n3-1 so maybe the two sets of tests here
could be combined. But that's not important, since the tests will
take a miniscule amount of time compared to the function calls. */
- if (BELOW_THRESHOLD (n3, BASECASE_SQR_THRESHOLD))
+ if (BELOW_THRESHOLD (n3, SQR_BASECASE_THRESHOLD))
{
mpn_mul_basecase (ws, p, n3, p, n3);
mpn_mul_basecase (p, a, n3, a, n3);
}
- else if (BELOW_THRESHOLD (n3, KARATSUBA_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (n3, SQR_KARATSUBA_THRESHOLD))
{
mpn_sqr_basecase (ws, p, n3);
mpn_sqr_basecase (p, a, n3);
@@ -319,9 +319,9 @@ mpn_kara_sqr_n (mp_ptr p, mp_srcptr a, mp_size_t n, mp_ptr ws)
mpn_kara_sqr_n (ws, p, n3, ws + n1); /* (x-y)^2 */
mpn_kara_sqr_n (p, a, n3, ws + n1); /* x^2 */
}
- if (BELOW_THRESHOLD (n2, BASECASE_SQR_THRESHOLD))
+ if (BELOW_THRESHOLD (n2, SQR_BASECASE_THRESHOLD))
mpn_mul_basecase (p + n1, a + n3, n2, a + n3, n2);
- else if (BELOW_THRESHOLD (n2, KARATSUBA_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (n2, SQR_KARATSUBA_THRESHOLD))
mpn_sqr_basecase (p + n1, a + n3, n2);
else
mpn_kara_sqr_n (p + n1, a + n3, n2, ws + n1); /* y^2 */
@@ -377,13 +377,13 @@ mpn_kara_sqr_n (mp_ptr p, mp_srcptr a, mp_size_t n, mp_ptr ws)
mpn_sub_n (p, x, y, n2);
/* Pointwise products. */
- if (BELOW_THRESHOLD (n2, BASECASE_SQR_THRESHOLD))
+ if (BELOW_THRESHOLD (n2, SQR_BASECASE_THRESHOLD))
{
mpn_mul_basecase (ws, p, n2, p, n2);
mpn_mul_basecase (p, a, n2, a, n2);
mpn_mul_basecase (p + n, a + n2, n2, a + n2, n2);
}
- else if (BELOW_THRESHOLD (n2, KARATSUBA_SQR_THRESHOLD))
+ else if (BELOW_THRESHOLD (n2, SQR_KARATSUBA_THRESHOLD))
{
mpn_sqr_basecase (ws, p, n2);
mpn_sqr_basecase (p, a, n2);
@@ -913,16 +913,16 @@ interpolate3 (mp_srcptr A, mp_ptr B, mp_ptr C, mp_ptr D, mp_srcptr E,
* ws is workspace.
*/
-/* TO DO: If TOOM3_MUL_THRESHOLD is much bigger than KARATSUBA_MUL_THRESHOLD then the
+/* TO DO: If MUL_TOOM3_THRESHOLD is much bigger than MUL_KARATSUBA_THRESHOLD then the
* recursion in mpn_toom3_mul_n() will always bottom out with mpn_kara_mul_n()
- * because the "n < KARATSUBA_MUL_THRESHOLD" test here will always be false.
+ * because the "n < MUL_KARATSUBA_THRESHOLD" test here will always be false.
*/
#define TOOM3_MUL_REC(p, a, b, n, ws) \
do { \
- if (n < KARATSUBA_MUL_THRESHOLD) \
+ if (n < MUL_KARATSUBA_THRESHOLD) \
mpn_mul_basecase (p, a, n, b, n); \
- else if (n < TOOM3_MUL_THRESHOLD) \
+ else if (n < MUL_TOOM3_THRESHOLD) \
mpn_kara_mul_n (p, a, b, n, ws); \
else \
mpn_toom3_mul_n (p, a, b, n, ws); \
@@ -944,7 +944,7 @@ mpn_toom3_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n, mp_ptr ws)
mp_limb_t m;
/* this is probably unnecessarily strict */
- ASSERT (n >= TOOM3_MUL_THRESHOLD);
+ ASSERT (n >= MUL_TOOM3_THRESHOLD);
l = ls = n / 3;
m = n - l * 3;
@@ -1020,15 +1020,15 @@ mpn_toom3_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n, mp_ptr ws)
/* Like previous function but for squaring */
-/* FIXME: If TOOM3_SQR_THRESHOLD is big enough it might never get into the
+/* FIXME: If SQR_TOOM3_THRESHOLD is big enough it might never get into the
basecase range. Try to arrange those conditonals go dead. */
#define TOOM3_SQR_REC(p, a, n, ws) \
do { \
- if (BELOW_THRESHOLD (n, BASECASE_SQR_THRESHOLD)) \
+ if (BELOW_THRESHOLD (n, SQR_BASECASE_THRESHOLD)) \
mpn_mul_basecase (p, a, n, a, n); \
- else if (BELOW_THRESHOLD (n, KARATSUBA_SQR_THRESHOLD)) \
+ else if (BELOW_THRESHOLD (n, SQR_KARATSUBA_THRESHOLD)) \
mpn_sqr_basecase (p, a, n); \
- else if (BELOW_THRESHOLD (n, TOOM3_SQR_THRESHOLD)) \
+ else if (BELOW_THRESHOLD (n, SQR_TOOM3_THRESHOLD)) \
mpn_kara_sqr_n (p, a, n, ws); \
else \
mpn_toom3_sqr_n (p, a, n, ws); \
@@ -1050,7 +1050,7 @@ mpn_toom3_sqr_n (mp_ptr p, mp_srcptr a, mp_size_t n, mp_ptr ws)
mp_limb_t m;
/* this is probably unnecessarily strict */
- ASSERT (n >= TOOM3_SQR_THRESHOLD);
+ ASSERT (n >= SQR_TOOM3_THRESHOLD);
l = ls = n / 3;
m = n - l * 3;
@@ -1121,26 +1121,26 @@ mpn_mul_n (mp_ptr p, mp_srcptr a, mp_srcptr b, mp_size_t n)
ASSERT (! MPN_OVERLAP_P (p, 2*n, a, n));
ASSERT (! MPN_OVERLAP_P (p, 2*n, b, n));
- if (n < KARATSUBA_MUL_THRESHOLD)
+ if (n < MUL_KARATSUBA_THRESHOLD)
mpn_mul_basecase (p, a, n, b, n);
- else if (n < TOOM3_MUL_THRESHOLD)
+ else if (n < MUL_TOOM3_THRESHOLD)
{
/* Allocate workspace of fixed size on stack: fast! */
#if TUNE_PROGRAM_BUILD
- mp_limb_t ws[MPN_KARA_MUL_N_TSIZE (TOOM3_MUL_THRESHOLD_LIMIT-1)];
+ mp_limb_t ws[MPN_KARA_MUL_N_TSIZE (MUL_TOOM3_THRESHOLD_LIMIT-1)];
#else
- mp_limb_t ws[MPN_KARA_MUL_N_TSIZE (TOOM3_MUL_THRESHOLD-1)];
+ mp_limb_t ws[MPN_KARA_MUL_N_TSIZE (MUL_TOOM3_THRESHOLD-1)];
#endif
mpn_kara_mul_n (p, a, b, n, ws);
}
#if WANT_FFT || TUNE_PROGRAM_BUILD
- else if (n < FFT_MUL_THRESHOLD)
+ else if (n < MUL_FFT_THRESHOLD)
#else
else
#endif
{
/* Use workspace of unknown size in heap, as stack space may
- * be limited. Since n is at least TOOM3_MUL_THRESHOLD, the
+ * be limited. Since n is at least MUL_TOOM3_THRESHOLD, the
* multiplication will take much longer than malloc()/free(). */
mp_limb_t wsLen, *ws;
wsLen = MPN_TOOM3_MUL_N_TSIZE (n);
diff --git a/mpn/generic/sb_divrem_mn.c b/mpn/generic/sb_divrem_mn.c
index b5e92a461..817f1ca3f 100644
--- a/mpn/generic/sb_divrem_mn.c
+++ b/mpn/generic/sb_divrem_mn.c
@@ -40,8 +40,8 @@ MA 02111-1307, USA. */
tuned thresholds. Note in particular that preinv should certainly be
used if that's the only division available (USE_PREINV_ALWAYS). */
-#ifndef SB_PREINV_THRESHOLD
-#define SB_PREINV_THRESHOLD 0
+#ifndef DIV_SB_PREINV_THRESHOLD
+#define DIV_SB_PREINV_THRESHOLD 0
#endif
@@ -96,7 +96,7 @@ mpn_sb_divrem_mn (mp_ptr qp,
/* use_preinv is possibly a constant, but it's left to the compiler to
optimize away the unused code in that case. */
- use_preinv = ABOVE_THRESHOLD (qsize, SB_PREINV_THRESHOLD);
+ use_preinv = ABOVE_THRESHOLD (qsize, DIV_SB_PREINV_THRESHOLD);
if (use_preinv)
invert_limb (dxinv, dx);
diff --git a/mpn/generic/sqr_basecase.c b/mpn/generic/sqr_basecase.c
index c105335b7..82daeaaeb 100644
--- a/mpn/generic/sqr_basecase.c
+++ b/mpn/generic/sqr_basecase.c
@@ -5,7 +5,7 @@
SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
-Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2000, 2001 Free Software
+Copyright 1991, 1992, 1993, 1994, 1996, 1997, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -48,12 +48,12 @@ mpn_sqr_basecase (mp_ptr prodp, mp_srcptr up, mp_size_t n)
}
if (n > 1)
{
- mp_limb_t tarr[2 * KARATSUBA_SQR_THRESHOLD];
+ mp_limb_t tarr[2 * SQR_KARATSUBA_THRESHOLD];
mp_ptr tp = tarr;
mp_limb_t cy;
/* must fit 2*n limbs in tarr */
- ASSERT (n <= KARATSUBA_SQR_THRESHOLD);
+ ASSERT (n <= SQR_KARATSUBA_THRESHOLD);
cy = mpn_mul_1 (tp, up + 1, n - 1, up[0]);
tp[n - 1] = cy;
diff --git a/mpn/generic/tdiv_qr.c b/mpn/generic/tdiv_qr.c
index f984b64e0..efb2de465 100644
--- a/mpn/generic/tdiv_qr.c
+++ b/mpn/generic/tdiv_qr.c
@@ -12,7 +12,7 @@
The time complexity of this is O(qn*qn+M(dn,qn)), where M(m,n) is the time
complexity of multiplication.
-Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1997, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -140,7 +140,7 @@ mpn_tdiv_qr (mp_ptr qp, mp_ptr rp, mp_size_t qxn,
if (dn == 2)
mpn_divrem_2 (qp, 0L, n2p, nn, d2p);
- else if (dn < DC_THRESHOLD)
+ else if (dn < DIV_DC_THRESHOLD)
mpn_sb_divrem_mn (qp, n2p, nn, d2p, dn);
else
{
@@ -294,7 +294,7 @@ mpn_tdiv_qr (mp_ptr qp, mp_ptr rp, mp_size_t qxn,
}
else if (qn == 2)
mpn_divrem_2 (qp, 0L, n2p, 4L, d2p);
- else if (qn < DC_THRESHOLD)
+ else if (qn < DIV_DC_THRESHOLD)
mpn_sb_divrem_mn (qp, n2p, 2 * qn, d2p, qn);
else
mpn_dc_divrem_n (qp, n2p, d2p, qn);
diff --git a/mpn/hppa/gmp-mparam.h b/mpn/hppa/gmp-mparam.h
index 32a8e65d3..2fec625c3 100644
--- a/mpn/hppa/gmp-mparam.h
+++ b/mpn/hppa/gmp-mparam.h
@@ -1,6 +1,7 @@
/* HP-PA 1.0 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -25,22 +26,22 @@ MA 02111-1307, USA. */
/* These values are for the PA7100 using GCC. */
/* Generated by tuneup.c, 2000-10-27. */
-#ifndef KARATSUBA_MUL_THRESHOLD
-#define KARATSUBA_MUL_THRESHOLD 30
+#ifndef MUL_KARATSUBA_THRESHOLD
+#define MUL_KARATSUBA_THRESHOLD 30
#endif
-#ifndef TOOM3_MUL_THRESHOLD
-#define TOOM3_MUL_THRESHOLD 141
+#ifndef MUL_TOOM3_THRESHOLD
+#define MUL_TOOM3_THRESHOLD 141
#endif
-#ifndef KARATSUBA_SQR_THRESHOLD
-#define KARATSUBA_SQR_THRESHOLD 59
+#ifndef SQR_KARATSUBA_THRESHOLD
+#define SQR_KARATSUBA_THRESHOLD 59
#endif
-#ifndef TOOM3_SQR_THRESHOLD
-#define TOOM3_SQR_THRESHOLD 177
+#ifndef SQR_TOOM3_THRESHOLD
+#define SQR_TOOM3_THRESHOLD 177
#endif
-#ifndef DC_THRESHOLD
-#define DC_THRESHOLD 108
+#ifndef DIV_DC_THRESHOLD
+#define DIV_DC_THRESHOLD 108
#endif
#ifndef POWM_THRESHOLD
diff --git a/mpn/hppa/hppa1_1/gmp-mparam.h b/mpn/hppa/hppa1_1/gmp-mparam.h
index 90258b06c..e636dffed 100644
--- a/mpn/hppa/hppa1_1/gmp-mparam.h
+++ b/mpn/hppa/hppa1_1/gmp-mparam.h
@@ -1,6 +1,7 @@
/* HP-PA 1.1 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -24,15 +25,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-26, gcc 2.8 */
-#define KARATSUBA_MUL_THRESHOLD 31
-#define TOOM3_MUL_THRESHOLD 172
+#define MUL_KARATSUBA_THRESHOLD 31
+#define MUL_TOOM3_THRESHOLD 172
-#define BASECASE_SQR_THRESHOLD 4
-#define KARATSUBA_SQR_THRESHOLD 55
-#define TOOM3_SQR_THRESHOLD 185
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_KARATSUBA_THRESHOLD 55
+#define SQR_TOOM3_THRESHOLD 185
-#define SB_PREINV_THRESHOLD 4
-#define DC_THRESHOLD 108
+#define DIV_SB_PREINV_THRESHOLD 4
+#define DIV_DC_THRESHOLD 108
#define POWM_THRESHOLD 142
#define GCD_ACCEL_THRESHOLD 3
@@ -47,10 +48,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 592, 1440, 2688, 5632, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 656
-#define FFT_MUL_THRESHOLD 5888
+#define MUL_FFT_TABLE { 592, 1440, 2688, 5632, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 656
+#define MUL_FFT_THRESHOLD 5888
-#define FFT_SQR_TABLE { 624, 1504, 2688, 6656, 18432, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 640
-#define FFT_SQR_THRESHOLD 5376
+#define SQR_FFT_TABLE { 624, 1504, 2688, 6656, 18432, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 640
+#define SQR_FFT_THRESHOLD 5376
diff --git a/mpn/hppa/hppa2_0/gmp-mparam.h b/mpn/hppa/hppa2_0/gmp-mparam.h
index 770ef440f..f2306773c 100644
--- a/mpn/hppa/hppa2_0/gmp-mparam.h
+++ b/mpn/hppa/hppa2_0/gmp-mparam.h
@@ -1,6 +1,7 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -24,15 +25,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-02-18, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 16
-#define TOOM3_MUL_THRESHOLD 129
+#define MUL_KARATSUBA_THRESHOLD 16
+#define MUL_TOOM3_THRESHOLD 129
-#define BASECASE_SQR_THRESHOLD 6
-#define KARATSUBA_SQR_THRESHOLD 48
-#define TOOM3_SQR_THRESHOLD 153
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_KARATSUBA_THRESHOLD 48
+#define SQR_TOOM3_THRESHOLD 153
-#define SB_PREINV_THRESHOLD 6
-#define DC_THRESHOLD 102
+#define DIV_SB_PREINV_THRESHOLD 6
+#define DIV_DC_THRESHOLD 102
#define POWM_THRESHOLD 166
#define GCD_ACCEL_THRESHOLD 4
@@ -47,10 +48,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 656, 928, 1920, 3584, 14336, 24576, 0 }
-#define FFT_MODF_MUL_THRESHOLD 584
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 656, 928, 1920, 3584, 14336, 24576, 0 }
+#define MUL_FFT_MODF_THRESHOLD 584
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 656, 928, 1920, 3584, 14336, 24576, 0 }
-#define FFT_MODF_SQR_THRESHOLD 616
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 656, 928, 1920, 3584, 14336, 24576, 0 }
+#define SQR_FFT_MODF_THRESHOLD 616
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/ia64/gmp-mparam.h b/mpn/ia64/gmp-mparam.h
index 9b609d68f..2368d4189 100644
--- a/mpn/ia64/gmp-mparam.h
+++ b/mpn/ia64/gmp-mparam.h
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -24,15 +24,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-12, gcc 2.96 */
-#define KARATSUBA_MUL_THRESHOLD 47
-#define TOOM3_MUL_THRESHOLD 288
+#define MUL_KARATSUBA_THRESHOLD 47
+#define MUL_TOOM3_THRESHOLD 288
-#define BASECASE_SQR_THRESHOLD 25
-#define KARATSUBA_SQR_THRESHOLD 128
-#define TOOM3_SQR_THRESHOLD 250
+#define SQR_BASECASE_THRESHOLD 25
+#define SQR_KARATSUBA_THRESHOLD 128
+#define SQR_TOOM3_THRESHOLD 250
-#define SB_PREINV_THRESHOLD 0 /* (preinv always) */
-#define DC_THRESHOLD 48
+#define DIV_SB_PREINV_THRESHOLD 0 /* (preinv always) */
+#define DIV_DC_THRESHOLD 48
#define POWM_THRESHOLD 520
#define GCD_ACCEL_THRESHOLD 3
@@ -49,14 +49,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 14
+#define GET_STR_DC_THRESHOLD 14
#define GET_STR_PRECOMPUTE_THRESHOLD 19
#define SET_STR_THRESHOLD 24003
-#define FFT_MUL_TABLE { 912, 1696, 3904, 7424, 19456, 45056, 0 }
-#define FFT_MODF_MUL_THRESHOLD 944
-#define FFT_MUL_THRESHOLD 7808
+#define MUL_FFT_TABLE { 912, 1696, 3904, 7424, 19456, 45056, 0 }
+#define MUL_FFT_MODF_THRESHOLD 944
+#define MUL_FFT_THRESHOLD 7808
-#define FFT_SQR_TABLE { 848, 1696, 3648, 7424, 15360, 45056, 0 }
-#define FFT_MODF_SQR_THRESHOLD 864
-#define FFT_SQR_THRESHOLD 6272
+#define SQR_FFT_TABLE { 848, 1696, 3648, 7424, 15360, 45056, 0 }
+#define SQR_FFT_MODF_THRESHOLD 864
+#define SQR_FFT_THRESHOLD 6272
diff --git a/mpn/m68k/gmp-mparam.h b/mpn/m68k/gmp-mparam.h
index 505c2e958..8e03e5797 100644
--- a/mpn/m68k/gmp-mparam.h
+++ b/mpn/m68k/gmp-mparam.h
@@ -1,6 +1,6 @@
/* 68040 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -26,15 +26,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-04-20, gcc 2.91 */
-#define KARATSUBA_MUL_THRESHOLD 14
-#define TOOM3_MUL_THRESHOLD 129
+#define MUL_KARATSUBA_THRESHOLD 14
+#define MUL_TOOM3_THRESHOLD 129
-#define BASECASE_SQR_THRESHOLD 5
-#define KARATSUBA_SQR_THRESHOLD 30
-#define TOOM3_SQR_THRESHOLD 151
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_KARATSUBA_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 151
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
-#define DC_THRESHOLD 60
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_DC_THRESHOLD 60
#define POWM_THRESHOLD 43
#define FIB_THRESHOLD 104
@@ -50,10 +50,10 @@ MA 02111-1307, USA. */
#define DIVREM_2_THRESHOLD MP_SIZE_T_MAX
#define MODEXACT_1_ODD_THRESHOLD MP_SIZE_T_MAX
-#define FFT_MUL_TABLE { 464, 928, 1664, 3584, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 480
-#define FFT_MUL_THRESHOLD 3328
+#define MUL_FFT_TABLE { 464, 928, 1664, 3584, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 480
+#define MUL_FFT_THRESHOLD 3328
-#define FFT_SQR_TABLE { 432, 928, 1920, 4608, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 448
-#define FFT_SQR_THRESHOLD 3328
+#define SQR_FFT_TABLE { 432, 928, 1920, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 448
+#define SQR_FFT_THRESHOLD 3328
diff --git a/mpn/mips32/gmp-mparam.h b/mpn/mips32/gmp-mparam.h
index ff4d941a6..2fb9a93e1 100644
--- a/mpn/mips32/gmp-mparam.h
+++ b/mpn/mips32/gmp-mparam.h
@@ -27,15 +27,15 @@ USA. */
/* Generated by tuneup.c, 2002-02-17, system compiler (R3000) */
-#define KARATSUBA_MUL_THRESHOLD 18
-#define TOOM3_MUL_THRESHOLD 65
+#define MUL_KARATSUBA_THRESHOLD 18
+#define MUL_TOOM3_THRESHOLD 65
-#define BASECASE_SQR_THRESHOLD 12
-#define KARATSUBA_SQR_THRESHOLD 49
-#define TOOM3_SQR_THRESHOLD 56
+#define SQR_BASECASE_THRESHOLD 12
+#define SQR_KARATSUBA_THRESHOLD 49
+#define SQR_TOOM3_THRESHOLD 56
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DC_THRESHOLD 29
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 29
#define POWM_THRESHOLD 146
#define GCD_ACCEL_THRESHOLD 3
@@ -52,14 +52,14 @@ USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 11
+#define GET_STR_DC_THRESHOLD 11
#define GET_STR_PRECOMPUTE_THRESHOLD 17
#define SET_STR_THRESHOLD 3014
-#define FFT_MUL_TABLE { 496, 928, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 624
-#define FFT_MUL_THRESHOLD 4864
+#define MUL_FFT_TABLE { 496, 928, 1664, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 624
+#define MUL_FFT_THRESHOLD 4864
-#define FFT_SQR_TABLE { 464, 800, 1664, 3584, 10240, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 496
-#define FFT_SQR_THRESHOLD 4352
+#define SQR_FFT_TABLE { 464, 800, 1664, 3584, 10240, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 496
+#define SQR_FFT_THRESHOLD 4352
diff --git a/mpn/mips64/gmp-mparam.h b/mpn/mips64/gmp-mparam.h
index 9e3782947..0ee836813 100644
--- a/mpn/mips64/gmp-mparam.h
+++ b/mpn/mips64/gmp-mparam.h
@@ -27,15 +27,15 @@ USA. */
/* Generated by tuneup.c, 2002-02-12, MIPSpro C 7.2.1 (R10000) */
-#define KARATSUBA_MUL_THRESHOLD 13
-#define TOOM3_MUL_THRESHOLD 82
+#define MUL_KARATSUBA_THRESHOLD 13
+#define MUL_TOOM3_THRESHOLD 82
-#define BASECASE_SQR_THRESHOLD 6
-#define KARATSUBA_SQR_THRESHOLD 28
-#define TOOM3_SQR_THRESHOLD 93
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_KARATSUBA_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 93
-#define SB_PREINV_THRESHOLD 4
-#define DC_THRESHOLD 48
+#define DIV_SB_PREINV_THRESHOLD 4
+#define DIV_DC_THRESHOLD 48
#define POWM_THRESHOLD 97
#define GCD_ACCEL_THRESHOLD 3
@@ -52,14 +52,14 @@ USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 10
+#define GET_STR_DC_THRESHOLD 10
#define GET_STR_PRECOMPUTE_THRESHOLD 12
#define SET_STR_THRESHOLD 3664
-#define FFT_MUL_TABLE { 464, 992, 2112, 4352, 9216, 28672, 0 }
-#define FFT_MODF_MUL_THRESHOLD 480
-#define FFT_MUL_THRESHOLD 3456
+#define MUL_FFT_TABLE { 464, 992, 2112, 4352, 9216, 28672, 0 }
+#define MUL_FFT_MODF_THRESHOLD 480
+#define MUL_FFT_THRESHOLD 3456
-#define FFT_SQR_TABLE { 432, 864, 1984, 3840, 9216, 28672, 0 }
-#define FFT_MODF_SQR_THRESHOLD 448
-#define FFT_SQR_THRESHOLD 2944
+#define SQR_FFT_TABLE { 432, 864, 1984, 3840, 9216, 28672, 0 }
+#define SQR_FFT_MODF_THRESHOLD 448
+#define SQR_FFT_THRESHOLD 2944
diff --git a/mpn/pa64/gmp-mparam.h b/mpn/pa64/gmp-mparam.h
index a3a9c2505..d2e0b60cf 100644
--- a/mpn/pa64/gmp-mparam.h
+++ b/mpn/pa64/gmp-mparam.h
@@ -1,6 +1,7 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -28,15 +29,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-12, system compiler */
-#define KARATSUBA_MUL_THRESHOLD 16
-#define TOOM3_MUL_THRESHOLD 105
+#define MUL_KARATSUBA_THRESHOLD 16
+#define MUL_TOOM3_THRESHOLD 105
-#define BASECASE_SQR_THRESHOLD 5
-#define KARATSUBA_SQR_THRESHOLD 30
-#define TOOM3_SQR_THRESHOLD 114
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_KARATSUBA_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 114
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 56
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 56
#define POWM_THRESHOLD 110
#define GCD_ACCEL_THRESHOLD 3
@@ -53,14 +54,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 21
+#define GET_STR_DC_THRESHOLD 21
#define GET_STR_PRECOMPUTE_THRESHOLD 23
#define SET_STR_THRESHOLD 6589
-#define FFT_MUL_TABLE { 464, 928, 2112, 3840, 9216, 28672, 0 }
-#define FFT_MODF_MUL_THRESHOLD 328
-#define FFT_MUL_THRESHOLD 2432
+#define MUL_FFT_TABLE { 464, 928, 2112, 3840, 9216, 28672, 0 }
+#define MUL_FFT_MODF_THRESHOLD 328
+#define MUL_FFT_THRESHOLD 2432
-#define FFT_SQR_TABLE { 464, 992, 2240, 4352, 9216, 28672, 0 }
-#define FFT_MODF_SQR_THRESHOLD 344
-#define FFT_SQR_THRESHOLD 2432
+#define SQR_FFT_TABLE { 464, 992, 2240, 4352, 9216, 28672, 0 }
+#define SQR_FFT_MODF_THRESHOLD 344
+#define SQR_FFT_THRESHOLD 2432
diff --git a/mpn/pa64w/gmp-mparam.h b/mpn/pa64w/gmp-mparam.h
index abe14b3cc..6d195121a 100644
--- a/mpn/pa64w/gmp-mparam.h
+++ b/mpn/pa64w/gmp-mparam.h
@@ -1,6 +1,7 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -28,15 +29,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-12, system compiler */
-#define KARATSUBA_MUL_THRESHOLD 17
-#define TOOM3_MUL_THRESHOLD 92
+#define MUL_KARATSUBA_THRESHOLD 17
+#define MUL_TOOM3_THRESHOLD 92
-#define BASECASE_SQR_THRESHOLD 4
-#define KARATSUBA_SQR_THRESHOLD 32
-#define TOOM3_SQR_THRESHOLD 117
+#define SQR_BASECASE_THRESHOLD 4
+#define SQR_KARATSUBA_THRESHOLD 32
+#define SQR_TOOM3_THRESHOLD 117
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 64
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 64
#define POWM_THRESHOLD 104
#define GCD_ACCEL_THRESHOLD 3
@@ -53,14 +54,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 21
+#define GET_STR_DC_THRESHOLD 21
#define GET_STR_PRECOMPUTE_THRESHOLD 23
#define SET_STR_THRESHOLD 6336
-#define FFT_MUL_TABLE { 496, 1056, 2368, 4352, 11264, 36864, 0 }
-#define FFT_MODF_MUL_THRESHOLD 392
-#define FFT_MUL_THRESHOLD 2432
+#define MUL_FFT_TABLE { 496, 1056, 2368, 4352, 11264, 36864, 0 }
+#define MUL_FFT_MODF_THRESHOLD 392
+#define MUL_FFT_THRESHOLD 2432
-#define FFT_SQR_TABLE { 496, 1120, 2624, 4864, 11264, 28672, 0 }
-#define FFT_MODF_SQR_THRESHOLD 376
-#define FFT_SQR_THRESHOLD 2688
+#define SQR_FFT_TABLE { 496, 1120, 2624, 4864, 11264, 28672, 0 }
+#define SQR_FFT_MODF_THRESHOLD 376
+#define SQR_FFT_THRESHOLD 2688
diff --git a/mpn/powerpc32/gmp-mparam.h b/mpn/powerpc32/gmp-mparam.h
index e7c010517..dd5394bfa 100644
--- a/mpn/powerpc32/gmp-mparam.h
+++ b/mpn/powerpc32/gmp-mparam.h
@@ -1,6 +1,7 @@
/* PowerPC-32 604e gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -31,15 +32,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-08, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 20
-#define TOOM3_MUL_THRESHOLD 226
+#define MUL_KARATSUBA_THRESHOLD 20
+#define MUL_TOOM3_THRESHOLD 226
-#define BASECASE_SQR_THRESHOLD 6
-#define KARATSUBA_SQR_THRESHOLD 40
-#define TOOM3_SQR_THRESHOLD 274
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_KARATSUBA_THRESHOLD 40
+#define SQR_TOOM3_THRESHOLD 274
-#define SB_PREINV_THRESHOLD 0 /* always */
-#define DC_THRESHOLD 51
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 51
#define POWM_THRESHOLD 104
#define GCD_ACCEL_THRESHOLD 3
@@ -56,15 +57,15 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 24
+#define GET_STR_DC_THRESHOLD 24
#define GET_STR_PRECOMPUTE_THRESHOLD 37
#define SET_STR_THRESHOLD 11401
-#define FFT_MUL_TABLE { 528, 1184, 2176, 5632, 14336, 57344, 0 }
-#define FFT_MODF_MUL_THRESHOLD 544
-#define FFT_MUL_THRESHOLD 6912
+#define MUL_FFT_TABLE { 528, 1184, 2176, 5632, 14336, 57344, 0 }
+#define MUL_FFT_MODF_THRESHOLD 544
+#define MUL_FFT_THRESHOLD 6912
-#define FFT_SQR_TABLE { 528, 1184, 2176, 5632, 14336, 57344, 0 }
-#define FFT_MODF_SQR_THRESHOLD 544
-#define FFT_SQR_THRESHOLD 5888
+#define SQR_FFT_TABLE { 528, 1184, 2176, 5632, 14336, 57344, 0 }
+#define SQR_FFT_MODF_THRESHOLD 544
+#define SQR_FFT_THRESHOLD 5888
diff --git a/mpn/powerpc64/gmp-mparam.h b/mpn/powerpc64/gmp-mparam.h
index 2c2f6e0f0..eb3be90ce 100644
--- a/mpn/powerpc64/gmp-mparam.h
+++ b/mpn/powerpc64/gmp-mparam.h
@@ -1,7 +1,7 @@
/* PowerPC-64 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1995, 1999, 2000, 2001 Free Software Foundation,
-Inc.
+Copyright 1991, 1993, 1994, 1995, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,15 +28,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-12, gcc 3.0 */
-#define KARATSUBA_MUL_THRESHOLD 8
-#define TOOM3_MUL_THRESHOLD 57
+#define MUL_KARATSUBA_THRESHOLD 8
+#define MUL_TOOM3_THRESHOLD 57
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 14
-#define TOOM3_SQR_THRESHOLD 81
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 14
+#define SQR_TOOM3_THRESHOLD 81
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 28
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 28
#define POWM_THRESHOLD 40
#define GCD_ACCEL_THRESHOLD 3
@@ -53,14 +53,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 21
+#define GET_STR_DC_THRESHOLD 21
#define GET_STR_PRECOMPUTE_THRESHOLD 25
#define SET_STR_THRESHOLD 1815
-#define FFT_MUL_TABLE { 336, 672, 960, 2816, 7168, 20480, 0 }
-#define FFT_MODF_MUL_THRESHOLD 296
-#define FFT_MUL_THRESHOLD 1120
+#define MUL_FFT_TABLE { 336, 672, 960, 2816, 7168, 20480, 0 }
+#define MUL_FFT_MODF_THRESHOLD 296
+#define MUL_FFT_THRESHOLD 1120
-#define FFT_SQR_TABLE { 336, 736, 1600, 2816, 5120, 20480, 0 }
-#define FFT_MODF_SQR_THRESHOLD 296
-#define FFT_SQR_THRESHOLD 1120
+#define SQR_FFT_TABLE { 336, 736, 1600, 2816, 5120, 20480, 0 }
+#define SQR_FFT_MODF_THRESHOLD 296
+#define SQR_FFT_THRESHOLD 1120
diff --git a/mpn/s390/gmp-mparam.h b/mpn/s390/gmp-mparam.h
index 81a607841..15ba96d20 100644
--- a/mpn/s390/gmp-mparam.h
+++ b/mpn/s390/gmp-mparam.h
@@ -1,6 +1,6 @@
/* IBM s370 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -25,15 +25,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-12-03, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 18
-#define TOOM3_MUL_THRESHOLD 210
+#define MUL_KARATSUBA_THRESHOLD 18
+#define MUL_TOOM3_THRESHOLD 210
-#define BASECASE_SQR_THRESHOLD 8
-#define KARATSUBA_SQR_THRESHOLD 40
-#define TOOM3_SQR_THRESHOLD 250
+#define SQR_BASECASE_THRESHOLD 8
+#define SQR_KARATSUBA_THRESHOLD 40
+#define SQR_TOOM3_THRESHOLD 250
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 63
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 63
#define POWM_THRESHOLD 63
#define GCD_ACCEL_THRESHOLD 3
@@ -48,10 +48,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 432, 992, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 448
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 432, 992, 1664, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 448
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 400, 992, 1664, 4608, 10240, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 416
-#define FFT_SQR_THRESHOLD 3328
+#define SQR_FFT_TABLE { 400, 992, 1664, 4608, 10240, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 416
+#define SQR_FFT_THRESHOLD 3328
diff --git a/mpn/sparc32/v8/gmp-mparam.h b/mpn/sparc32/v8/gmp-mparam.h
index 03af1ae3b..742bb10e7 100644
--- a/mpn/sparc32/v8/gmp-mparam.h
+++ b/mpn/sparc32/v8/gmp-mparam.h
@@ -1,6 +1,7 @@
/* SPARC v8 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -27,15 +28,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-17, gcc 2.8 */
-#define KARATSUBA_MUL_THRESHOLD 14
-#define TOOM3_MUL_THRESHOLD 105
+#define MUL_KARATSUBA_THRESHOLD 14
+#define MUL_TOOM3_THRESHOLD 105
-#define BASECASE_SQR_THRESHOLD 6
-#define KARATSUBA_SQR_THRESHOLD 30
-#define TOOM3_SQR_THRESHOLD 173
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_KARATSUBA_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 173
-#define SB_PREINV_THRESHOLD 0 /* always */
-#define DC_THRESHOLD 54
+#define DIV_SB_PREINV_THRESHOLD 0 /* always */
+#define DIV_DC_THRESHOLD 54
#define POWM_THRESHOLD 125
#define GCD_ACCEL_THRESHOLD 3
@@ -52,14 +53,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 38
+#define GET_STR_DC_THRESHOLD 38
#define GET_STR_PRECOMPUTE_THRESHOLD 47
#define SET_STR_THRESHOLD 3524
-#define FFT_MUL_TABLE { 432, 1056, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 448
-#define FFT_MUL_THRESHOLD 4352
+#define MUL_FFT_TABLE { 432, 1056, 1664, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 448
+#define MUL_FFT_THRESHOLD 4352
-#define FFT_SQR_TABLE { 400, 992, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 416
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 400, 992, 1664, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 416
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/sparc32/v8/supersparc/gmp-mparam.h b/mpn/sparc32/v8/supersparc/gmp-mparam.h
index eb45a8556..e59966083 100644
--- a/mpn/sparc32/v8/supersparc/gmp-mparam.h
+++ b/mpn/sparc32/v8/supersparc/gmp-mparam.h
@@ -1,6 +1,7 @@
/* SuperSPARC gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -27,15 +28,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-26, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 14
-#define TOOM3_MUL_THRESHOLD 105
+#define MUL_KARATSUBA_THRESHOLD 14
+#define MUL_TOOM3_THRESHOLD 105
-#define BASECASE_SQR_THRESHOLD 5
-#define KARATSUBA_SQR_THRESHOLD 28
-#define TOOM3_SQR_THRESHOLD 113
+#define SQR_BASECASE_THRESHOLD 5
+#define SQR_KARATSUBA_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 113
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 44
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 44
#define POWM_THRESHOLD 104
#define GCD_ACCEL_THRESHOLD 3
@@ -50,10 +51,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 432, 1056, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 448
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 432, 1056, 1664, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 448
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 432, 992, 1664, 4608, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 448
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 432, 992, 1664, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 448
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/sparc32/v9/gmp-mparam.h b/mpn/sparc32/v9/gmp-mparam.h
index bac27d856..435e4dd1c 100644
--- a/mpn/sparc32/v9/gmp-mparam.h
+++ b/mpn/sparc32/v9/gmp-mparam.h
@@ -1,6 +1,7 @@
/* SPARC v9 32-bit gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -24,15 +25,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-08, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 40
-#define TOOM3_MUL_THRESHOLD 222
+#define MUL_KARATSUBA_THRESHOLD 40
+#define MUL_TOOM3_THRESHOLD 222
-#define BASECASE_SQR_THRESHOLD 15
-#define KARATSUBA_SQR_THRESHOLD 80
-#define TOOM3_SQR_THRESHOLD 238
+#define SQR_BASECASE_THRESHOLD 15
+#define SQR_KARATSUBA_THRESHOLD 80
+#define SQR_TOOM3_THRESHOLD 238
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DC_THRESHOLD 155
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_DC_THRESHOLD 155
#define POWM_THRESHOLD 175
#define GCD_ACCEL_THRESHOLD 4
@@ -49,14 +50,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 4
-#define GET_STR_BASECASE_THRESHOLD 21
+#define GET_STR_DC_THRESHOLD 21
#define GET_STR_PRECOMPUTE_THRESHOLD 26
#define SET_STR_THRESHOLD 6852
-#define FFT_MUL_TABLE { 496, 1184, 2432, 4608, 10240, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 512
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 496, 1184, 2432, 4608, 10240, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 512
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 496, 1120, 1920, 4608, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 512
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 496, 1120, 1920, 4608, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 512
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/sparc64/gmp-mparam.h b/mpn/sparc64/gmp-mparam.h
index 448e5c598..b0fcb28c0 100644
--- a/mpn/sparc64/gmp-mparam.h
+++ b/mpn/sparc64/gmp-mparam.h
@@ -1,6 +1,7 @@
/* Sparc64 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 1999, 2000, 2001, 2002 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -33,15 +34,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2002-02-08, Sun C 5.0 */
-#define KARATSUBA_MUL_THRESHOLD 22
-#define TOOM3_MUL_THRESHOLD 98
+#define MUL_KARATSUBA_THRESHOLD 22
+#define MUL_TOOM3_THRESHOLD 98
-#define BASECASE_SQR_THRESHOLD 6
-#define KARATSUBA_SQR_THRESHOLD 48
-#define TOOM3_SQR_THRESHOLD 153
+#define SQR_BASECASE_THRESHOLD 6
+#define SQR_KARATSUBA_THRESHOLD 48
+#define SQR_TOOM3_THRESHOLD 153
-#define SB_PREINV_THRESHOLD 6
-#define DC_THRESHOLD 56
+#define DIV_SB_PREINV_THRESHOLD 6
+#define DIV_DC_THRESHOLD 56
#define POWM_THRESHOLD 243
#define GCD_ACCEL_THRESHOLD 3
@@ -58,14 +59,14 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define MODEXACT_1_ODD_THRESHOLD 0 /* always */
-#define GET_STR_BASECASE_THRESHOLD 10
+#define GET_STR_DC_THRESHOLD 10
#define GET_STR_PRECOMPUTE_THRESHOLD 13
#define SET_STR_THRESHOLD 7411
-#define FFT_MUL_TABLE { 432, 864, 1856, 3328, 9216, 20480, 0 }
-#define FFT_MODF_MUL_THRESHOLD 328
-#define FFT_MUL_THRESHOLD 2176
+#define MUL_FFT_TABLE { 432, 864, 1856, 3328, 9216, 20480, 0 }
+#define MUL_FFT_MODF_THRESHOLD 328
+#define MUL_FFT_THRESHOLD 2176
-#define FFT_SQR_TABLE { 432, 864, 2112, 3840, 9216, 20480, 0 }
-#define FFT_MODF_SQR_THRESHOLD 312
-#define FFT_SQR_THRESHOLD 2176
+#define SQR_FFT_TABLE { 432, 864, 2112, 3840, 9216, 20480, 0 }
+#define SQR_FFT_MODF_THRESHOLD 312
+#define SQR_FFT_THRESHOLD 2176
diff --git a/mpn/x86/i486/gmp-mparam.h b/mpn/x86/i486/gmp-mparam.h
index 2296a09c3..dfe95561a 100644
--- a/mpn/x86/i486/gmp-mparam.h
+++ b/mpn/x86/i486/gmp-mparam.h
@@ -1,6 +1,6 @@
/* 80486 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -27,14 +27,14 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-02-03. */
-#define KARATSUBA_MUL_THRESHOLD 22
-#define TOOM3_MUL_THRESHOLD 278
+#define MUL_KARATSUBA_THRESHOLD 22
+#define MUL_TOOM3_THRESHOLD 278
-#define KARATSUBA_SQR_THRESHOLD 58
-#define TOOM3_SQR_THRESHOLD 226
+#define SQR_KARATSUBA_THRESHOLD 58
+#define SQR_TOOM3_THRESHOLD 226
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
-#define DC_THRESHOLD 92
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_DC_THRESHOLD 92
#define POWM_THRESHOLD 125
#define GCD_ACCEL_THRESHOLD 3
diff --git a/mpn/x86/k6/gmp-mparam.h b/mpn/x86/k6/gmp-mparam.h
index 936ec2b0d..7f66aed0e 100644
--- a/mpn/x86/k6/gmp-mparam.h
+++ b/mpn/x86/k6/gmp-mparam.h
@@ -27,15 +27,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-29, gcc 3.0 */
-#define KARATSUBA_MUL_THRESHOLD 20
-#define TOOM3_MUL_THRESHOLD 129
+#define MUL_KARATSUBA_THRESHOLD 20
+#define MUL_TOOM3_THRESHOLD 129
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 30
-#define TOOM3_SQR_THRESHOLD 186
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 30
+#define SQR_TOOM3_THRESHOLD 186
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
-#define DC_THRESHOLD 69
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_DC_THRESHOLD 69
#define POWM_THRESHOLD 91
#define GCD_ACCEL_THRESHOLD 3
@@ -46,10 +46,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 496, 1184, 1920, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 440
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 496, 1184, 1920, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 440
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 528, 1184, 2176, 5632, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 472
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 528, 1184, 2176, 5632, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 472
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/x86/k6/sqr_basecase.asm b/mpn/x86/k6/sqr_basecase.asm
index f1195ba39..a86013acf 100644
--- a/mpn/x86/k6/sqr_basecase.asm
+++ b/mpn/x86/k6/sqr_basecase.asm
@@ -5,7 +5,7 @@ dnl product (measured on the speed difference between 17 and 33 limbs,
dnl which is roughly the Karatsuba recursing range).
-dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+dnl Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -28,35 +28,35 @@ dnl Suite 330, Boston, MA 02111-1307, USA.
include(`../config.m4')
-dnl KARATSUBA_SQR_THRESHOLD_MAX is the maximum KARATSUBA_SQR_THRESHOLD this
+dnl SQR_KARATSUBA_THRESHOLD_MAX is the maximum SQR_KARATSUBA_THRESHOLD this
dnl code supports. This value is used only by the tune program to know
dnl what it can go up to. (An attempt to compile with a bigger value will
dnl trigger some m4_assert()s in the code, making the build fail.)
dnl
dnl The value is determined by requiring the displacements in the unrolled
dnl addmul to fit in single bytes. This means a maximum UNROLL_COUNT of
-dnl 63, giving a maximum KARATSUBA_SQR_THRESHOLD of 66.
+dnl 63, giving a maximum SQR_KARATSUBA_THRESHOLD of 66.
-deflit(KARATSUBA_SQR_THRESHOLD_MAX, 66)
+deflit(SQR_KARATSUBA_THRESHOLD_MAX, 66)
dnl Allow a value from the tune program to override config.m4.
-ifdef(`KARATSUBA_SQR_THRESHOLD_OVERRIDE',
-`define(`KARATSUBA_SQR_THRESHOLD',KARATSUBA_SQR_THRESHOLD_OVERRIDE)')
+ifdef(`SQR_KARATSUBA_THRESHOLD_OVERRIDE',
+`define(`SQR_KARATSUBA_THRESHOLD',SQR_KARATSUBA_THRESHOLD_OVERRIDE)')
dnl UNROLL_COUNT is the number of code chunks in the unrolled addmul. The
-dnl number required is determined by KARATSUBA_SQR_THRESHOLD, since
-dnl mpn_sqr_basecase only needs to handle sizes < KARATSUBA_SQR_THRESHOLD.
+dnl number required is determined by SQR_KARATSUBA_THRESHOLD, since
+dnl mpn_sqr_basecase only needs to handle sizes < SQR_KARATSUBA_THRESHOLD.
dnl
dnl The first addmul is the biggest, and this takes the second least
dnl significant limb and multiplies it by the third least significant and
-dnl up. Hence for a maximum operand size of KARATSUBA_SQR_THRESHOLD-1
-dnl limbs, UNROLL_COUNT needs to be KARATSUBA_SQR_THRESHOLD-3.
+dnl up. Hence for a maximum operand size of SQR_KARATSUBA_THRESHOLD-1
+dnl limbs, UNROLL_COUNT needs to be SQR_KARATSUBA_THRESHOLD-3.
-m4_config_gmp_mparam(`KARATSUBA_SQR_THRESHOLD')
-deflit(UNROLL_COUNT, eval(KARATSUBA_SQR_THRESHOLD-3))
+m4_config_gmp_mparam(`SQR_KARATSUBA_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_KARATSUBA_THRESHOLD-3))
C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
diff --git a/mpn/x86/k7/gmp-mparam.h b/mpn/x86/k7/gmp-mparam.h
index 81a0ea4c0..10d11852b 100644
--- a/mpn/x86/k7/gmp-mparam.h
+++ b/mpn/x86/k7/gmp-mparam.h
@@ -27,15 +27,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-28, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 26
-#define TOOM3_MUL_THRESHOLD 202
+#define MUL_KARATSUBA_THRESHOLD 26
+#define MUL_TOOM3_THRESHOLD 202
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 50
-#define TOOM3_SQR_THRESHOLD 226
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 50
+#define SQR_TOOM3_THRESHOLD 226
-#define SB_PREINV_THRESHOLD 0
-#define DC_THRESHOLD 92
+#define DIV_SB_PREINV_THRESHOLD 0
+#define DIV_DC_THRESHOLD 92
#define POWM_THRESHOLD 142
#define GCD_ACCEL_THRESHOLD 3
@@ -46,10 +46,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 816, 1696, 3456, 7680, 22528, 0 }
-#define FFT_MODF_MUL_THRESHOLD 832
-#define FFT_MUL_THRESHOLD 8448
+#define MUL_FFT_TABLE { 816, 1696, 3456, 7680, 22528, 0 }
+#define MUL_FFT_MODF_THRESHOLD 832
+#define MUL_FFT_THRESHOLD 8448
-#define FFT_SQR_TABLE { 784, 1760, 3456, 7680, 18432, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 800
-#define FFT_SQR_THRESHOLD 8448
+#define SQR_FFT_TABLE { 784, 1760, 3456, 7680, 18432, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 800
+#define SQR_FFT_THRESHOLD 8448
diff --git a/mpn/x86/k7/sqr_basecase.asm b/mpn/x86/k7/sqr_basecase.asm
index 8f20ea11d..d987df2ab 100644
--- a/mpn/x86/k7/sqr_basecase.asm
+++ b/mpn/x86/k7/sqr_basecase.asm
@@ -5,7 +5,7 @@ dnl (measured on the speed difference between 25 and 50 limbs, which is
dnl roughly the Karatsuba recursing range).
-dnl Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+dnl Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -31,18 +31,18 @@ include(`../config.m4')
dnl These are the same as mpn/x86/k6/sqr_basecase.asm, see that code for
dnl some comments.
-deflit(KARATSUBA_SQR_THRESHOLD_MAX, 66)
+deflit(SQR_KARATSUBA_THRESHOLD_MAX, 66)
-ifdef(`KARATSUBA_SQR_THRESHOLD_OVERRIDE',
-`define(`KARATSUBA_SQR_THRESHOLD',KARATSUBA_SQR_THRESHOLD_OVERRIDE)')
+ifdef(`SQR_KARATSUBA_THRESHOLD_OVERRIDE',
+`define(`SQR_KARATSUBA_THRESHOLD',SQR_KARATSUBA_THRESHOLD_OVERRIDE)')
-m4_config_gmp_mparam(`KARATSUBA_SQR_THRESHOLD')
-deflit(UNROLL_COUNT, eval(KARATSUBA_SQR_THRESHOLD-3))
+m4_config_gmp_mparam(`SQR_KARATSUBA_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_KARATSUBA_THRESHOLD-3))
C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
C
-C With a KARATSUBA_SQR_THRESHOLD around 50 this code is about 1500 bytes,
+C With a SQR_KARATSUBA_THRESHOLD around 50 this code is about 1500 bytes,
C which is quite a bit, but is considered good value since squares big
C enough to use most of the code will be spending quite a few cycles in it.
diff --git a/mpn/x86/p6/gmp-mparam.h b/mpn/x86/p6/gmp-mparam.h
index cd35a91fe..64b065a94 100644
--- a/mpn/x86/p6/gmp-mparam.h
+++ b/mpn/x86/p6/gmp-mparam.h
@@ -29,15 +29,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-28, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 23
-#define TOOM3_MUL_THRESHOLD 164
+#define MUL_KARATSUBA_THRESHOLD 23
+#define MUL_TOOM3_THRESHOLD 164
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 50
-#define TOOM3_SQR_THRESHOLD 202
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 50
+#define SQR_TOOM3_THRESHOLD 202
-#define SB_PREINV_THRESHOLD 4
-#define DC_THRESHOLD 111
+#define DIV_SB_PREINV_THRESHOLD 4
+#define DIV_DC_THRESHOLD 111
#define POWM_THRESHOLD 142
#define GCD_ACCEL_THRESHOLD 3
@@ -48,10 +48,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 592, 1440, 2688, 5632, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 608
-#define FFT_MUL_THRESHOLD 5376
+#define MUL_FFT_TABLE { 592, 1440, 2688, 5632, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 608
+#define MUL_FFT_THRESHOLD 5376
-#define FFT_SQR_TABLE { 656, 1504, 2944, 6656, 18432, 57344, 0 }
-#define FFT_MODF_SQR_THRESHOLD 672
-#define FFT_SQR_THRESHOLD 5376
+#define SQR_FFT_TABLE { 656, 1504, 2944, 6656, 18432, 57344, 0 }
+#define SQR_FFT_MODF_THRESHOLD 672
+#define SQR_FFT_THRESHOLD 5376
diff --git a/mpn/x86/p6/sqr_basecase.asm b/mpn/x86/p6/sqr_basecase.asm
index a3f7887ca..9a2aa2b60 100644
--- a/mpn/x86/p6/sqr_basecase.asm
+++ b/mpn/x86/p6/sqr_basecase.asm
@@ -5,7 +5,7 @@ dnl product (measured on the speed difference between 20 and 40 limbs,
dnl which is the Karatsuba recursing range).
-dnl Copyright 1999, 2000 Free Software Foundation, Inc.
+dnl Copyright 1999, 2000, 2002 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -30,15 +30,15 @@ include(`../config.m4')
dnl These are the same as in mpn/x86/k6/sqr_basecase.asm, see that file for
dnl a description. The only difference here is that UNROLL_COUNT can go up
-dnl to 64 (not 63) making KARATSUBA_SQR_THRESHOLD_MAX 67.
+dnl to 64 (not 63) making SQR_KARATSUBA_THRESHOLD_MAX 67.
-deflit(KARATSUBA_SQR_THRESHOLD_MAX, 67)
+deflit(SQR_KARATSUBA_THRESHOLD_MAX, 67)
-ifdef(`KARATSUBA_SQR_THRESHOLD_OVERRIDE',
-`define(`KARATSUBA_SQR_THRESHOLD',KARATSUBA_SQR_THRESHOLD_OVERRIDE)')
+ifdef(`SQR_KARATSUBA_THRESHOLD_OVERRIDE',
+`define(`SQR_KARATSUBA_THRESHOLD',SQR_KARATSUBA_THRESHOLD_OVERRIDE)')
-m4_config_gmp_mparam(`KARATSUBA_SQR_THRESHOLD')
-deflit(UNROLL_COUNT, eval(KARATSUBA_SQR_THRESHOLD-3))
+m4_config_gmp_mparam(`SQR_KARATSUBA_THRESHOLD')
+deflit(UNROLL_COUNT, eval(SQR_KARATSUBA_THRESHOLD-3))
C void mpn_sqr_basecase (mp_ptr dst, mp_srcptr src, mp_size_t size);
diff --git a/mpn/x86/pentium/gmp-mparam.h b/mpn/x86/pentium/gmp-mparam.h
index c1112ad03..43444d382 100644
--- a/mpn/x86/pentium/gmp-mparam.h
+++ b/mpn/x86/pentium/gmp-mparam.h
@@ -33,15 +33,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-28, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 16
-#define TOOM3_MUL_THRESHOLD 188
+#define MUL_KARATSUBA_THRESHOLD 16
+#define MUL_TOOM3_THRESHOLD 188
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 26
-#define TOOM3_SQR_THRESHOLD 171
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 26
+#define SQR_TOOM3_THRESHOLD 171
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
-#define DC_THRESHOLD 52
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_DC_THRESHOLD 52
#define POWM_THRESHOLD 71
#define GCD_ACCEL_THRESHOLD 3
@@ -52,10 +52,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 496, 928, 1920, 5632, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 512
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 496, 928, 1920, 5632, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 512
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 624, 928, 1920, 5632, 10240, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 568
-#define FFT_SQR_THRESHOLD 2496
+#define SQR_FFT_TABLE { 624, 928, 1920, 5632, 10240, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 568
+#define SQR_FFT_THRESHOLD 2496
diff --git a/mpn/x86/pentium/mmx/gmp-mparam.h b/mpn/x86/pentium/mmx/gmp-mparam.h
index 9a16b7022..2afcd8d50 100644
--- a/mpn/x86/pentium/mmx/gmp-mparam.h
+++ b/mpn/x86/pentium/mmx/gmp-mparam.h
@@ -33,15 +33,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-28, gcc 2.95 */
-#define KARATSUBA_MUL_THRESHOLD 16
-#define TOOM3_MUL_THRESHOLD 105
+#define MUL_KARATSUBA_THRESHOLD 16
+#define MUL_TOOM3_THRESHOLD 105
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 22
-#define TOOM3_SQR_THRESHOLD 149
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 22
+#define SQR_TOOM3_THRESHOLD 149
-#define SB_PREINV_THRESHOLD 4
-#define DC_THRESHOLD 44
+#define DIV_SB_PREINV_THRESHOLD 4
+#define DIV_DC_THRESHOLD 44
#define POWM_THRESHOLD 62
#define GCD_ACCEL_THRESHOLD 3
@@ -52,10 +52,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 464, 928, 1920, 4608, 14336, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 440
-#define FFT_MUL_THRESHOLD 3840
+#define MUL_FFT_TABLE { 464, 928, 1920, 4608, 14336, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 440
+#define MUL_FFT_THRESHOLD 3840
-#define FFT_SQR_TABLE { 496, 1120, 2176, 5632, 14336, 40960, 0 }
-#define FFT_MODF_SQR_THRESHOLD 424
-#define FFT_SQR_THRESHOLD 3840
+#define SQR_FFT_TABLE { 496, 1120, 2176, 5632, 14336, 40960, 0 }
+#define SQR_FFT_MODF_THRESHOLD 424
+#define SQR_FFT_THRESHOLD 3840
diff --git a/mpn/x86/pentium4/sse2/gmp-mparam.h b/mpn/x86/pentium4/sse2/gmp-mparam.h
index 075f5a52f..6df06d150 100644
--- a/mpn/x86/pentium4/sse2/gmp-mparam.h
+++ b/mpn/x86/pentium4/sse2/gmp-mparam.h
@@ -1,6 +1,6 @@
/* Intel Pentium-4 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 2000, 2001 Free Software Foundation, Inc.
+Copyright 1991, 1993, 1994, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -27,15 +27,15 @@ MA 02111-1307, USA. */
/* Generated by tuneup.c, 2001-11-29, gcc 2.95.3 */
-#define KARATSUBA_MUL_THRESHOLD 18
-#define TOOM3_MUL_THRESHOLD 139
+#define MUL_KARATSUBA_THRESHOLD 18
+#define MUL_TOOM3_THRESHOLD 139
-#define BASECASE_SQR_THRESHOLD 0
-#define KARATSUBA_SQR_THRESHOLD 68
-#define TOOM3_SQR_THRESHOLD 108
+#define SQR_BASECASE_THRESHOLD 0
+#define SQR_KARATSUBA_THRESHOLD 68
+#define SQR_TOOM3_THRESHOLD 108
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
-#define DC_THRESHOLD 48
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_DC_THRESHOLD 48
#define POWM_THRESHOLD 104
#define GCD_ACCEL_THRESHOLD 7
@@ -46,10 +46,10 @@ MA 02111-1307, USA. */
#define DIVEXACT_1_THRESHOLD 0
#define MODEXACT_1_ODD_THRESHOLD 0
-#define FFT_MUL_TABLE { 624, 1568, 2688, 7680, 18432, 40960, 0 }
-#define FFT_MODF_MUL_THRESHOLD 456
-#define FFT_MUL_THRESHOLD 5888
+#define MUL_FFT_TABLE { 624, 1568, 2688, 7680, 18432, 40960, 0 }
+#define MUL_FFT_MODF_THRESHOLD 456
+#define MUL_FFT_THRESHOLD 5888
-#define FFT_SQR_TABLE { 624, 992, 2432, 5632, 22528, 57344, 0 }
-#define FFT_MODF_SQR_THRESHOLD 584
-#define FFT_SQR_THRESHOLD 6400
+#define SQR_FFT_TABLE { 624, 992, 2432, 5632, 22528, 57344, 0 }
+#define SQR_FFT_MODF_THRESHOLD 584
+#define SQR_FFT_THRESHOLD 6400
diff --git a/mpn/x86/t-zdisp2.pl b/mpn/x86/t-zdisp2.pl
index 237491ffc..c6f2df9ba 100755
--- a/mpn/x86/t-zdisp2.pl
+++ b/mpn/x86/t-zdisp2.pl
@@ -1,6 +1,6 @@
#!/usr/bin/perl -w
#
-# Copyright 2001 Free Software Foundation, Inc.
+# Copyright 2001, 2002 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
@@ -73,7 +73,7 @@ sub process {
}
}
-# Ensure we're using the right KARATSUBA_SQR_THRESHOLD for the part of the
+# Ensure we're using the right SQR_KARATSUBA_THRESHOLD for the part of the
# tree being processed.
sub process_mparam {
my $file = "$File::Find::dir/gmp-mparam.h";
@@ -81,10 +81,10 @@ sub process_mparam {
print "$file\n" if $opt{'t'};
open MPARAM, "<$file" or die;
while (<MPARAM>) {
- if (/^#define KARATSUBA_SQR_THRESHOLD[ \t]*([0-9][0-9]*)/) {
+ if (/^#define SQR_KARATSUBA_THRESHOLD[ \t]*([0-9][0-9]*)/) {
open KARA, ">$tempfile" or die;
- print KARA "define(\`KARATSUBA_SQR_THRESHOLD',$1)\n\n";
- print "define(\`KARATSUBA_SQR_THRESHOLD',$1)\n" if $opt{'t'};
+ print KARA "define(\`SQR_KARATSUBA_THRESHOLD',$1)\n\n";
+ print "define(\`SQR_KARATSUBA_THRESHOLD',$1)\n" if $opt{'t'};
close KARA or die;
last;
}
diff --git a/mpz/powm.c b/mpz/powm.c
index 7943099e6..9f1dcd18e 100644
--- a/mpz/powm.c
+++ b/mpz/powm.c
@@ -1,7 +1,7 @@
/* mpz_powm(res,base,exp,mod) -- Set RES to (base**exp) mod MOD.
-Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001 Free Software Foundation,
-Inc. Contributed by Paul Zimmermann.
+Copyright 1991, 1993, 1994, 1996, 1997, 2000, 2001, 2002 Free Software
+Foundation, Inc. Contributed by Paul Zimmermann.
This file is part of the GNU MP Library.
@@ -134,14 +134,14 @@ phi (mp_limb_t t)
using usual reduction it costs 3*K(n), where K(n) is the cost of a
multiplication using Karatsuba, and a division is assumed to cost 2*K(n),
for example using Burnikel-Ziegler's algorithm. This gives a theoretical
- threshold of a*KARATSUBA_SQR_THRESHOLD, with a=(3/2)^(1/(2-ln(3)/ln(2))) ~
+ threshold of a*SQR_KARATSUBA_THRESHOLD, with a=(3/2)^(1/(2-ln(3)/ln(2))) ~
2.66. */
/* For now, also disable REDC when MOD is even, as the inverse can't handle
that. At some point, we might want to make the code faster for that case,
perhaps using CRR. */
#ifndef POWM_THRESHOLD
-#define POWM_THRESHOLD ((8 * KARATSUBA_SQR_THRESHOLD) / 3)
+#define POWM_THRESHOLD ((8 * SQR_KARATSUBA_THRESHOLD) / 3)
#endif
#define HANDLE_NEGATIVE_EXPONENT 1
diff --git a/tune/Makefile.am b/tune/Makefile.am
index c451cc94d..6f9e8f904 100644
--- a/tune/Makefile.am
+++ b/tune/Makefile.am
@@ -137,7 +137,7 @@ mod_1.c:
echo "#include \"mpn/generic/mod_1.c\"" >>mod_1.c
sqr_asm.asm: $(top_builddir)/mpn/sqr_basecase.asm
- echo 'define(KARATSUBA_SQR_THRESHOLD_OVERRIDE,KARATSUBA_SQR_THRESHOLD_MAX)' >sqr_asm.asm
+ echo 'define(SQR_KARATSUBA_THRESHOLD_OVERRIDE,SQR_KARATSUBA_THRESHOLD_MAX)' >sqr_asm.asm
echo 'include(../mpn/sqr_basecase.asm)' >>sqr_asm.asm
diff --git a/tune/Makefile.in b/tune/Makefile.in
index 8a8fb8b73..ff95bdd2d 100644
--- a/tune/Makefile.in
+++ b/tune/Makefile.in
@@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.5 from Makefile.am.
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -668,7 +668,7 @@ mod_1.c:
echo "#include \"mpn/generic/mod_1.c\"" >>mod_1.c
sqr_asm.asm: $(top_builddir)/mpn/sqr_basecase.asm
- echo 'define(KARATSUBA_SQR_THRESHOLD_OVERRIDE,KARATSUBA_SQR_THRESHOLD_MAX)' >sqr_asm.asm
+ echo 'define(SQR_KARATSUBA_THRESHOLD_OVERRIDE,SQR_KARATSUBA_THRESHOLD_MAX)' >sqr_asm.asm
echo 'include(../mpn/sqr_basecase.asm)' >>sqr_asm.asm
# .s assembler, no preprocessing.
diff --git a/tune/README b/tune/README
index 3830910e0..a6cda1240 100644
--- a/tune/README
+++ b/tune/README
@@ -1,4 +1,4 @@
-Copyright 2000, 2001 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -87,7 +87,7 @@ SCO OpenUNIX 8 /etc/hw
PARAMETER TUNING
The "tuneup" program runs some tests designed to find the best settings for
-various thresholds, like KARATSUBA_MUL_THRESHOLD. Its output can be put
+various thresholds, like MUL_KARATSUBA_THRESHOLD. Its output can be put
into gmp-mparam.h. The program is built and run with
make tune
@@ -280,7 +280,7 @@ up to twice as fast as mul_basecase. In practice loop overheads and the
products on the diagonal mean it falls short of this. Here's an example
running the two and showing by what factor an NxN mul_basecase is slower
than an NxN sqr_basecase. (Some versions of sqr_basecase only allow sizes
-below KARATSUBA_SQR_THRESHOLD, so if it crashes at that point don't worry.)
+below SQR_KARATSUBA_THRESHOLD, so if it crashes at that point don't worry.)
./speed -s 1-20 -r mpn_sqr_basecase mpn_mul_basecase
@@ -437,12 +437,12 @@ normal libgmp.la.
Note further that the various routines may recurse into themselves on sizes
far enough above applicable thresholds. For example, mpn_kara_mul_n will
recurse into itself on sizes greater than twice the compiled-in
-KARATSUBA_MUL_THRESHOLD.
+MUL_KARATSUBA_THRESHOLD.
When doing the above comparison between mul_basecase and kara_mul_n what's
probably of interest is mul_basecase versus a kara_mul_n that does one level
of Karatsuba then calls to mul_basecase, but this only happens on sizes less
-than twice the compiled KARATSUBA_MUL_THRESHOLD. A larger value for that
+than twice the compiled MUL_KARATSUBA_THRESHOLD. A larger value for that
setting can be compiled-in to avoid the problem if necessary. The same
applies to toom3 and DC, though in a trickier fashion.
diff --git a/tune/sb_div.c b/tune/sb_div.c
index c93bf1b9c..232422d8f 100644
--- a/tune/sb_div.c
+++ b/tune/sb_div.c
@@ -1,7 +1,7 @@
/* mpn/generic/sb_divrem_mn.c forced to use plain udiv_qrnnd. */
/*
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -24,10 +24,10 @@ MA 02111-1307, USA.
#include "gmp.h"
#include "gmp-impl.h"
-#ifdef SB_PREINV_THRESHOLD
-#undef SB_PREINV_THRESHOLD
+#ifdef DIV_SB_PREINV_THRESHOLD
+#undef DIV_SB_PREINV_THRESHOLD
#endif
-#define SB_PREINV_THRESHOLD MP_SIZE_T_MAX
+#define DIV_SB_PREINV_THRESHOLD MP_SIZE_T_MAX
#define __gmpn_sb_divrem_mn mpn_sb_divrem_mn_div
#include "mpn/generic/sb_divrem_mn.c"
diff --git a/tune/sb_inv.c b/tune/sb_inv.c
index 88ef5aea5..5eb6112fb 100644
--- a/tune/sb_inv.c
+++ b/tune/sb_inv.c
@@ -1,7 +1,7 @@
/* mpn/generic/sb_divrem_mn.c forced to use udiv_qrnnd_preinv. */
/*
-Copyright 2001 Free Software Foundation, Inc.
+Copyright 2001, 2002 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -24,10 +24,10 @@ MA 02111-1307, USA.
#include "gmp.h"
#include "gmp-impl.h"
-#ifdef SB_PREINV_THRESHOLD
-#undef SB_PREINV_THRESHOLD
+#ifdef DIV_SB_PREINV_THRESHOLD
+#undef DIV_SB_PREINV_THRESHOLD
#endif
-#define SB_PREINV_THRESHOLD 0
+#define DIV_SB_PREINV_THRESHOLD 0
#define __gmpn_sb_divrem_mn mpn_sb_divrem_mn_inv
#include "mpn/generic/sb_divrem_mn.c"
diff --git a/tune/tuneup.c b/tune/tuneup.c
index 58291b829..97db79621 100644
--- a/tune/tuneup.c
+++ b/tune/tuneup.c
@@ -147,8 +147,8 @@ mp_size_t set_str_threshold[2] = { MP_SIZE_T_MAX };
mp_size_t fft_modf_sqr_threshold = MP_SIZE_T_MAX;
mp_size_t fft_modf_mul_threshold = MP_SIZE_T_MAX;
-#ifndef TUNE_KARATSUBA_SQR_MAX
-#define TUNE_KARATSUBA_SQR_MAX 0 /* meaning no limit */
+#ifndef TUNE_SQR_KARATSUBA_MAX
+#define TUNE_SQR_KARATSUBA_MAX 0 /* meaning no limit */
#endif
struct param_t {
@@ -382,7 +382,7 @@ print_define_remark (const char *name, mp_size_t value, const char *remark)
/* table[i+1] needs to be set to a sensible value when testing method i+1
- because mpn_mul_n uses TOOM3_MUL_THRESHOLD to size the temporary
+ because mpn_mul_n uses MUL_TOOM3_THRESHOLD to size the temporary
workspace for mpn_kara_mul_n. */
void
@@ -836,16 +836,16 @@ void
tune_mul (void)
{
static struct param_t param;
- param.name[0] = "KARATSUBA_MUL_THRESHOLD";
- param.name[1] = "TOOM3_MUL_THRESHOLD";
+ param.name[0] = "MUL_KARATSUBA_THRESHOLD";
+ param.name[1] = "MUL_TOOM3_THRESHOLD";
param.function = speed_mpn_mul_n;
param.min_size[0] = MAX (4, MPN_KARA_MUL_N_MINSIZE);
- param.max_size[0] = TOOM3_MUL_THRESHOLD_LIMIT-1;
- param.max_size[1] = TOOM3_MUL_THRESHOLD_LIMIT-1;
+ param.max_size[0] = MUL_TOOM3_THRESHOLD_LIMIT-1;
+ param.max_size[1] = MUL_TOOM3_THRESHOLD_LIMIT-1;
one (mul_threshold, 2, &param);
/* disabled until tuned */
- FFT_MUL_THRESHOLD = MP_SIZE_T_MAX;
+ MUL_FFT_THRESHOLD = MP_SIZE_T_MAX;
}
@@ -856,21 +856,21 @@ void
tune_sqr (void)
{
static struct param_t param;
- param.name[0] = "BASECASE_SQR_THRESHOLD";
- param.name[1] = "KARATSUBA_SQR_THRESHOLD";
- param.name[2] = "TOOM3_SQR_THRESHOLD";
+ param.name[0] = "SQR_BASECASE_THRESHOLD";
+ param.name[1] = "SQR_KARATSUBA_THRESHOLD";
+ param.name[2] = "SQR_TOOM3_THRESHOLD";
param.function = speed_mpn_sqr_n;
param.min_is_always = 1;
param.second_start_min = 1;
param.min_size[0] = 3;
param.min_size[1] = MAX (4, MPN_KARA_SQR_N_MINSIZE);
param.min_size[2] = MPN_TOOM3_SQR_N_MINSIZE;
- param.max_size[0] = TUNE_KARATSUBA_SQR_MAX;
- param.max_size[1] = TUNE_KARATSUBA_SQR_MAX;
+ param.max_size[0] = TUNE_SQR_KARATSUBA_MAX;
+ param.max_size[1] = TUNE_SQR_KARATSUBA_MAX;
one (sqr_threshold, 3, &param);
/* disabled until tuned */
- FFT_SQR_THRESHOLD = MP_SIZE_T_MAX;
+ SQR_FFT_THRESHOLD = MP_SIZE_T_MAX;
}
@@ -881,7 +881,7 @@ tune_sb_preinv (void)
if (UDIV_PREINV_ALWAYS)
{
- print_define_remark ("SB_PREINV_THRESHOLD", 0L, "preinv always");
+ print_define_remark ("DIV_SB_PREINV_THRESHOLD", 0L, "preinv always");
return;
}
@@ -890,7 +890,7 @@ tune_sb_preinv (void)
param.min_is_always = 1;
param.size_extra = 3;
param.stop_factor = 2.0;
- param.name[0] = "SB_PREINV_THRESHOLD";
+ param.name[0] = "DIV_SB_PREINV_THRESHOLD";
param.function = speed_mpn_sb_divrem_m3;
one (sb_preinv_threshold, 1, &param);
}
@@ -900,7 +900,7 @@ void
tune_dc (void)
{
static struct param_t param;
- param.name[0] = "DC_THRESHOLD";
+ param.name[0] = "DIV_DC_THRESHOLD";
param.function = speed_mpn_dc_tdiv_qr;
one (dc_threshold, 1, &param);
}
@@ -1398,7 +1398,7 @@ tune_get_str (void)
{
static struct param_t param;
get_str_precompute_threshold[0] = 0;
- param.name[0] = "GET_STR_BASECASE_THRESHOLD";
+ param.name[0] = "GET_STR_DC_THRESHOLD";
param.function = speed_mpn_get_str;
param.min_size[0] = 2;
param.max_size[0] = GET_STR_THRESHOLD_LIMIT;
@@ -1439,12 +1439,12 @@ tune_fft_mul (void)
if (option_fft_max_size == 0)
return;
- param.table_name = "FFT_MUL_TABLE";
- param.threshold_name = "FFT_MUL_THRESHOLD";
- param.p_threshold = &FFT_MUL_THRESHOLD;
- param.modf_threshold_name = "FFT_MODF_MUL_THRESHOLD";
- param.p_modf_threshold = &FFT_MODF_MUL_THRESHOLD;
- param.first_size = TOOM3_MUL_THRESHOLD / 2;
+ param.table_name = "MUL_FFT_TABLE";
+ param.threshold_name = "MUL_FFT_THRESHOLD";
+ param.p_threshold = &MUL_FFT_THRESHOLD;
+ param.modf_threshold_name = "MUL_FFT_MODF_THRESHOLD";
+ param.p_modf_threshold = &MUL_FFT_MODF_THRESHOLD;
+ param.first_size = MUL_TOOM3_THRESHOLD / 2;
param.max_size = option_fft_max_size;
param.function = speed_mpn_mul_fft;
param.mul_function = speed_mpn_mul_n;
@@ -1461,12 +1461,12 @@ tune_fft_sqr (void)
if (option_fft_max_size == 0)
return;
- param.table_name = "FFT_SQR_TABLE";
- param.threshold_name = "FFT_SQR_THRESHOLD";
- param.p_threshold = &FFT_SQR_THRESHOLD;
- param.modf_threshold_name = "FFT_MODF_SQR_THRESHOLD";
- param.p_modf_threshold = &FFT_MODF_SQR_THRESHOLD;
- param.first_size = TOOM3_SQR_THRESHOLD / 2;
+ param.table_name = "SQR_FFT_TABLE";
+ param.threshold_name = "SQR_FFT_THRESHOLD";
+ param.p_threshold = &SQR_FFT_THRESHOLD;
+ param.modf_threshold_name = "SQR_FFT_MODF_THRESHOLD";
+ param.p_modf_threshold = &SQR_FFT_MODF_THRESHOLD;
+ param.first_size = SQR_TOOM3_THRESHOLD / 2;
param.max_size = option_fft_max_size;
param.function = speed_mpn_mul_fft_sqr;
param.mul_function = speed_mpn_sqr_n;