summaryrefslogtreecommitdiff
path: root/mpn
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2000-07-29 01:13:13 +0200
committerKevin Ryde <user42@zip.com.au>2000-07-29 01:13:13 +0200
commitd9de2e3f76c268307f83ae67dace13eea2a1b58a (patch)
tree3f8853693638d2c5df42e841bf2182aa49ec618b /mpn
parentb89c821415e03bc3a5dadc06e4d40de98e570772 (diff)
downloadgmp-d9de2e3f76c268307f83ae67dace13eea2a1b58a.tar.gz
* configure.in (--enable-fft): New option, default "no".
* mpn/generic/{mul,mul_n}.c [WANT_FFT]: Use it.
Diffstat (limited to 'mpn')
-rw-r--r--mpn/generic/mul.c6
-rw-r--r--mpn/generic/mul_n.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/mpn/generic/mul.c b/mpn/generic/mul.c
index 431420e41..cecfa19ca 100644
--- a/mpn/generic/mul.c
+++ b/mpn/generic/mul.c
@@ -67,7 +67,11 @@ mpn_sqr_n (prodp, up, un)
mpn_kara_sqr_n (prodp, up, un, tspace);
TMP_FREE (marker);
}
+#if WANT_FFT || TUNE_PROGRAM_BUILD
else if (un < FFT_SQR_THRESHOLD)
+#else
+ else
+#endif
{ /* toom3 multiplication */
mp_ptr tspace;
TMP_DECL (marker);
@@ -76,11 +80,13 @@ mpn_sqr_n (prodp, up, un)
mpn_toom3_sqr_n (prodp, up, un, tspace);
TMP_FREE (marker);
}
+#if WANT_FFT || TUNE_PROGRAM_BUILD
else
{
/* schoenhage multiplication */
mpn_mul_fft_full (prodp, up, un, up, un);
}
+#endif
}
mp_limb_t
diff --git a/mpn/generic/mul_n.c b/mpn/generic/mul_n.c
index c11320b58..b7563be2d 100644
--- a/mpn/generic/mul_n.c
+++ b/mpn/generic/mul_n.c
@@ -1319,7 +1319,11 @@ mpn_mul_n (p, a, b, n)
#endif
mpn_kara_mul_n (p, a, b, n, ws);
}
+#if WANT_FFT || TUNE_PROGRAM_BUILD
else if (n < FFT_MUL_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
@@ -1330,8 +1334,10 @@ mpn_mul_n (p, a, b, n)
mpn_toom3_mul_n (p, a, b, n, ws);
(*_mp_free_func) (ws, (size_t) wsLen * sizeof (mp_limb_t));
}
+#if WANT_FFT || TUNE_PROGRAM_BUILD
else
{
mpn_mul_fft_full (p, a, n, b, n);
}
+#endif
}