[Gmp-commit] /home/hgfiles/gmp: 2 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Sat Jan 2 23:05:35 CET 2010


details:   /home/hgfiles/gmp/rev/968e3835876c
changeset: 13301:968e3835876c
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 02 23:04:24 2010 +0100
description:
(MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to INV_MULMOD_BNM1_THRESHOLD.

details:   /home/hgfiles/gmp/rev/31029f8dc100
changeset: 13302:31029f8dc100
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jan 02 23:05:33 2010 +0100
description:
Trivial merge.

diffstat:

 ChangeLog                            |   9 +++++++++
 gmp-impl.h                           |   2 +-
 mpn/generic/invert.c                 |  10 ++++------
 mpn/generic/toom_interpolate_16pts.c |   8 ++++----
 4 files changed, 18 insertions(+), 11 deletions(-)

diffs (88 lines):

diff -r 307df5de3f24 -r 31029f8dc100 ChangeLog
--- a/ChangeLog	Fri Jan 01 23:29:24 2010 +0100
+++ b/ChangeLog	Sat Jan 02 23:05:33 2010 +0100
@@ -1,3 +1,12 @@
+2010-01-02  Torbjorn Granlund  <tege at gmplib.org>
+
+	* gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to
+	INV_MULMOD_BNM1_THRESHOLD.
+
+2010-01-02  Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+	* mpn/generic/invert.c: Remove duplicated code.
+
 2010-01-01  Torbjorn Granlund  <tege at gmplib.org>
 
 	* gmp-impl.h (MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD): Default to 0.
diff -r 307df5de3f24 -r 31029f8dc100 gmp-impl.h
--- a/gmp-impl.h	Fri Jan 01 23:29:24 2010 +0100
+++ b/gmp-impl.h	Sat Jan 02 23:05:33 2010 +0100
@@ -1819,7 +1819,7 @@
 #endif
 
 #ifndef MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD
-#define MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD 0
+#define MUL_TO_MULMOD_BNM1_FOR_2NXN_THRESHOLD  INV_MULMOD_BNM1_THRESHOLD
 #endif
 
 #if HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2
diff -r 307df5de3f24 -r 31029f8dc100 mpn/generic/invert.c
--- a/mpn/generic/invert.c	Fri Jan 01 23:29:24 2010 +0100
+++ b/mpn/generic/invert.c	Sat Jan 02 23:05:33 2010 +0100
@@ -32,7 +32,7 @@
 #include "longlong.h"
 
 #ifndef INV_APPR_THRESHOLD
-#define INV_APPR_THRESHOLD (INV_NEWTON_THRESHOLD)
+#define INV_APPR_THRESHOLD INV_NEWTON_THRESHOLD
 #endif
 
 void
@@ -53,10 +53,8 @@
     if (scratch == NULL)
       scratch = TMP_ALLOC_LIMBS (mpn_invert_itch (n));
 
-    if (BELOW_THRESHOLD (n, INV_APPR_THRESHOLD)) {
-      if (n == 1)
-	invert_limb (*ip, *dp);
-      else {
+    if (BELOW_THRESHOLD (n, INV_APPR_THRESHOLD))
+      {
 	/* Maximum scratch needed by this branch: 2*n */
 	mp_size_t i;
 	mp_ptr xp;
@@ -74,7 +72,7 @@
 	  mpn_sbpi1_div_q (ip, xp, 2 * n, dp, n, inv.inv32);
 	}
       }
-    } else { /* Use approximated inverse; correct the result if needed. */
+    else { /* Use approximated inverse; correct the result if needed. */
       mp_limb_t e; /* The possible error in the approximate inverse */
 
       ASSERT ( mpn_invert_itch (n) >= mpn_invertappr_itch (n) );
diff -r 307df5de3f24 -r 31029f8dc100 mpn/generic/toom_interpolate_16pts.c
--- a/mpn/generic/toom_interpolate_16pts.c	Fri Jan 01 23:29:24 2010 +0100
+++ b/mpn/generic/toom_interpolate_16pts.c	Sat Jan 02 23:05:33 2010 +0100
@@ -123,9 +123,9 @@
 #define BINVERT_255x188513325H CNST_LIMB(0x06DB993A)
 #else /* GMP_NAIL_BITS != 0 */
 #define BINVERT_255x182712915H \
-  (GMP_NUMB_MASK & CNST_LIMB((0x1B649A07<<GMP_NAIL_BITS) || (0x6FC4CB25>>GMP_NUMB_BITS)))
+  (GMP_NUMB_MASK & CNST_LIMB((0x1B649A07<<GMP_NAIL_BITS) | (0x6FC4CB25>>GMP_NUMB_BITS)))
 #define BINVERT_255x188513325H \
-  (GMP_NUMB_MASK & CNST_LIMB((0x06DB993A<<GMP_NAIL_BITS) || (0x6864275B>>GMP_NUMB_BITS)))
+  (GMP_NUMB_MASK & CNST_LIMB((0x06DB993A<<GMP_NAIL_BITS) | (0x6864275B>>GMP_NUMB_BITS)))
 #endif
 #else
 #if GMP_LIMB_BITS == 64
@@ -183,8 +183,8 @@
 
 #ifndef  mpn_divexact_by255x182712915
 #if GMP_NUMB_BITS < 36
-#if HAVE_NATIVE_mpn_bdiv_q_1_pi2 && defined(BINVERT_255x182712915H)
-/* FIXME: use mpn_bdiv_q_1_pi2 */
+#if HAVE_NATIVE_mpn_bdiv_q_2_pi2 && defined(BINVERT_255x182712915H)
+/* FIXME: use mpn_bdiv_q_2_pi2 */
 #endif
 #if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && defined(BINVERT_182712915)
 #define mpn_divexact_by255x182712915(dst,src,size)				\


More information about the gmp-commit mailing list