[Gmp-commit] /home/hgfiles/gmp: Eliminated inv21 in gmp_pi1_t.

mercurial at gmplib.org mercurial at gmplib.org
Fri Dec 18 12:10:26 CET 2009


details:   /home/hgfiles/gmp/rev/664fd27fa9ae
changeset: 13125:664fd27fa9ae
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Fri Dec 18 12:10:22 2009 +0100
description:
Eliminated inv21 in gmp_pi1_t.

diffstat:

 ChangeLog  |  4 ++++
 gmp-impl.h |  5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r 4587ae5f3743 -r 664fd27fa9ae ChangeLog
--- a/ChangeLog	Fri Dec 18 12:07:10 2009 +0100
+++ b/ChangeLog	Fri Dec 18 12:10:22 2009 +0100
@@ -1,7 +1,11 @@
 2009-12-18  Niels Möller  <nisse at lysator.liu.se>
 
+	* gmp-impl.h (gmp_pi1_t): Eliminated inv21 member.
+	(invert_pi1): ...and don't store it here.
+
 	* mpn/generic/toom63_mul.c (mpn_toom63_mul): Simplified
 	calculation of block size n.
+	* gmp-impl.h (mpn_toom63_mul_itch): Likewise.
 
 	* mpn/generic/toom_eval_pm2exp.c (mpn_toom_eval_pm2exp): Fixed
 	output asserts.
diff -r 4587ae5f3743 -r 664fd27fa9ae gmp-impl.h
--- a/gmp-impl.h	Fri Dec 18 12:07:10 2009 +0100
+++ b/gmp-impl.h	Fri Dec 18 12:10:22 2009 +0100
@@ -207,7 +207,7 @@
 
 
 /* pre-inverse types for truncating division and modulo */
-typedef struct {mp_limb_t inv21, inv32;} gmp_pi1_t;
+typedef struct {mp_limb_t inv32;} gmp_pi1_t;
 typedef struct {mp_limb_t inv21, inv32, inv53;} gmp_pi2_t;
 
 
@@ -2512,7 +2512,6 @@
   do {								\
     mp_limb_t v, p, t1, t0, mask;				\
     invert_limb (v, d1);					\
-    (dinv).inv21 = v;						\
     p = d1 * v;							\
     p += d0;							\
     if (p < d0)							\
@@ -4436,7 +4435,7 @@
 static inline mp_size_t
 mpn_toom63_mul_itch (mp_size_t an, mp_size_t bn)
 {
-  mp_size_t n = 1 + (3 * an >= 6 * bn ? (an - 1) / (size_t) 6 : (bn - 1) / (size_t) 3);
+  mp_size_t n = 1 + (an >= 2 * bn ? (an - 1) / (size_t) 6 : (bn - 1) / (size_t) 3);
   return 9 * n + 3;
 }
 


More information about the gmp-commit mailing list