[Gmp-commit] /home/hgfiles/gmp: Use sublsh2 in Toom-4.5 .
mercurial at gmplib.org
mercurial at gmplib.org
Sat Mar 20 09:52:53 CET 2010
details: /home/hgfiles/gmp/rev/bc2b835b4bee
changeset: 13516:bc2b835b4bee
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Sat Mar 20 09:52:48 2010 +0100
description:
Use sublsh2 in Toom-4.5 .
diffstat:
ChangeLog | 4 ++++
mpn/generic/toom_interpolate_8pts.c | 12 +++++++++---
2 files changed, 13 insertions(+), 3 deletions(-)
diffs (50 lines):
diff -r 990fa3bc1ea8 -r bc2b835b4bee ChangeLog
--- a/ChangeLog Sat Mar 20 08:51:17 2010 +0100
+++ b/ChangeLog Sat Mar 20 09:52:48 2010 +0100
@@ -1,3 +1,7 @@
+2010-03-20 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/toom_interpolate_8pts.c: Use mpn_sublsh2_n.
+
2010-03-20 Torbjorn Granlund <tege at gmplib.org>
* mpn/powerpc64/mode64/aorslshC_n.asm: New file, generlised from
diff -r 990fa3bc1ea8 -r bc2b835b4bee mpn/generic/toom_interpolate_8pts.c
--- a/mpn/generic/toom_interpolate_8pts.c Sat Mar 20 08:51:17 2010 +0100
+++ b/mpn/generic/toom_interpolate_8pts.c Sat Mar 20 09:52:48 2010 +0100
@@ -54,18 +54,24 @@
#endif
#endif
+#if HAVE_NATIVE_mpn_sublsh2_n
+#define DO_mpn_sublsh2_n(dst,src,n,ws) mpn_sublsh2_n(dst,dst,src,n)
+#else
+#define DO_mpn_sublsh2_n(dst,src,n,ws) DO_mpn_sublsh_n(dst,src,n,2,ws)
+#endif
+
#if HAVE_NATIVE_mpn_sublsh_n
#define DO_mpn_sublsh_n(dst,src,n,s,ws) mpn_sublsh_n (dst,src,n,s)
#else
static mp_limb_t
DO_mpn_sublsh_n (mp_ptr dst, mp_srcptr src, mp_size_t n, unsigned int s, mp_ptr ws)
{
-#if USE_MUL_1
+#if USE_MUL_1 && 0
return mpn_submul_1(dst,src,n,CNST_LIMB(1) <<(s));
#else
mp_limb_t __cy;
__cy = mpn_lshift (ws,src,n,s);
- return __cy + mpn_sub_n (dst,dst,ws,n);
+ return __cy + mpn_sub_n (dst,dst,ws,n);
#endif
}
#endif
@@ -146,7 +152,7 @@
ASSERT_NOCARRY(mpn_divexact_by3 (r5, r5, 3 * n + 1));
- ASSERT_NOCARRY(DO_mpn_sublsh_n (r5, r3, 3 * n + 1, 2, ws));
+ ASSERT_NOCARRY(DO_mpn_sublsh2_n (r5, r3, 3 * n + 1, ws));
/* last interpolation steps... */
/* ... are mixed with recomposition */
More information about the gmp-commit
mailing list