[Gmp-commit] /home/hgfiles/gmp: Call mpn_fft_mul instead of mpn_mul_fft_full....
mercurial at gmplib.org
mercurial at gmplib.org
Sun Dec 20 20:01:30 CET 2009
details: /home/hgfiles/gmp/rev/7e02a6efa052
changeset: 13145:7e02a6efa052
user: Torbjorn Granlund <tege at gmplib.org>
date: Sun Dec 20 20:01:25 2009 +0100
description:
Call mpn_fft_mul instead of mpn_mul_fft_full. Make mpn_fft_mul an alias for mpn_nussbaumer_mul.
diffstat:
ChangeLog | 6 ++++++
gmp-impl.h | 6 ++++++
mpn/generic/mul.c | 12 ++++++------
mpn/generic/mul_n.c | 2 +-
mpn/generic/mullo_n.c | 2 +-
mpn/generic/sqr_n.c | 2 +-
6 files changed, 21 insertions(+), 9 deletions(-)
diffs (116 lines):
diff -r 0898d36d4806 -r 7e02a6efa052 ChangeLog
--- a/ChangeLog Sun Dec 20 18:51:48 2009 +0100
+++ b/ChangeLog Sun Dec 20 20:01:25 2009 +0100
@@ -1,5 +1,11 @@
2009-12-20 Torbjorn Granlund <tege at gmplib.org>
+ * gmp-impl.h: Define mpn_fft_mul as an alias for mpn_nussbaumer_mul.
+ * mpn/generic/mul.c: Refer Call_fft_mul.
+ * mpn/generic/mul_n.c: Likewise.
+ * mpn/generic/sqr_n.c: Likewise.
+ * mpn/generic/mullo_n.c: Likewise.
+
* mpn/generic/mul.c: Loop also over mpn_nussbaumer_mul, as suggested by
Marco. Use TMP_SALLOC_LIMBS in more places. Clean up ws allocation.
diff -r 0898d36d4806 -r 7e02a6efa052 gmp-impl.h
--- a/gmp-impl.h Sun Dec 20 18:51:48 2009 +0100
+++ b/gmp-impl.h Sun Dec 20 20:01:25 2009 +0100
@@ -4478,6 +4478,12 @@
return 9 * n + 3;
}
+#if 0
+#define mpn_fft_mul mpn_mul_fft_full
+#else
+#define mpn_fft_mul mpn_nussbaumer_mul
+#endif
+
#ifdef __cplusplus
/* A little helper for a null-terminated __gmp_allocate_func string.
diff -r 0898d36d4806 -r 7e02a6efa052 mpn/generic/mul.c
--- a/mpn/generic/mul.c Sun Dec 20 18:51:48 2009 +0100
+++ b/mpn/generic/mul.c Sun Dec 20 20:01:25 2009 +0100
@@ -63,8 +63,8 @@
mul_basecase for slightly larger operands for toom32 than for toom22, and
even larger for toom42.
- * That problem is even more prevalent for toomX3. We therefore have a
- special THRESHOLD variables there.
+ * That problem is even more prevalent for toomX3. We therefore use special
+ THRESHOLD variables there.
* Is our ITCH allocation correct?
*/
@@ -126,7 +126,7 @@
mp_limb_t tp[MUL_TOOM22_THRESHOLD_LIMIT];
mp_limb_t cy;
- ASSERT (MUL_TOOM22_THRESHOLD <= MUL_TOOM22_THRESHOLD_LIMIT);
+ ASSERT (MUL_TOOM22_THRESHOLD <= MUL_TOOM22_THRESHOLD_LIMIT);
mpn_mul_basecase (prodp, up, MUL_BASECASE_MAX_UN, vp, vn);
prodp += MUL_BASECASE_MAX_UN;
@@ -331,14 +331,14 @@
/* The maximum ws usage is for the mpn_mul result. */
ws = TMP_BALLOC_LIMBS (9 * vn >> 1);
- mpn_nussbaumer_mul (prodp, up, 3 * vn, vp, vn);
+ mpn_fft_mul (prodp, up, 3 * vn, vp, vn);
un -= 3 * vn;
up += 3 * vn;
prodp += 3 * vn;
while (2 * un >= 7 * vn) /* un >= 3.5vn */
{
- mpn_nussbaumer_mul (ws, up, 3 * vn, vp, vn);
+ mpn_fft_mul (ws, up, 3 * vn, vp, vn);
un -= 3 * vn;
up += 3 * vn;
cy = mpn_add_n (prodp, prodp, ws, vn);
@@ -361,7 +361,7 @@
TMP_FREE;
}
else
- mpn_nussbaumer_mul (prodp, up, un, vp, vn);
+ mpn_fft_mul (prodp, up, un, vp, vn);
}
return prodp[un + vn - 1]; /* historic */
diff -r 0898d36d4806 -r 7e02a6efa052 mpn/generic/mul_n.c
--- a/mpn/generic/mul_n.c Sun Dec 20 18:51:48 2009 +0100
+++ b/mpn/generic/mul_n.c Sun Dec 20 20:01:25 2009 +0100
@@ -68,7 +68,7 @@
{
/* The current FFT code allocates its own space. That should probably
change. */
- mpn_mul_fft_full (p, a, n, b, n);
+ mpn_fft_mul (p, a, n, b, n);
}
#else
{
diff -r 0898d36d4806 -r 7e02a6efa052 mpn/generic/mullo_n.c
--- a/mpn/generic/mullo_n.c Sun Dec 20 18:51:48 2009 +0100
+++ b/mpn/generic/mullo_n.c Sun Dec 20 20:01:25 2009 +0100
@@ -205,7 +205,7 @@
tp = TMP_ALLOC_LIMBS (2 * n);
#if !TUNE_PROGRAM_BUILD && WANT_FFT && (MULLO_MUL_N_THRESHOLD >= MUL_FFT_THRESHOLD)
- mpn_mul_fft_full (tp, xp, n, yp, n);
+ mpn_fft_mul (tp, xp, n, yp, n);
#else
mpn_mul_n (tp, xp, yp, n);
#endif
diff -r 0898d36d4806 -r 7e02a6efa052 mpn/generic/sqr_n.c
--- a/mpn/generic/sqr_n.c Sun Dec 20 18:51:48 2009 +0100
+++ b/mpn/generic/sqr_n.c Sun Dec 20 20:01:25 2009 +0100
@@ -70,7 +70,7 @@
{
/* The current FFT code allocates its own space. That should probably
change. */
- mpn_mul_fft_full (p, a, n, a, n);
+ mpn_fft_mul (p, a, n, a, n);
}
#else
{
More information about the gmp-commit
mailing list