[Gmp-commit] /var/hg/gmp: 3 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Tue May 12 17:27:31 UTC 2015


details:   /var/hg/gmp/rev/9fd8135a840a
changeset: 16618:9fd8135a840a
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue May 12 19:26:09 2015 +0200
description:
mpn/generic/hgcd_reduce.c: remove a branch

details:   /var/hg/gmp/rev/f5bd41dcb9b6
changeset: 16619:f5bd41dcb9b6
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue May 12 19:26:33 2015 +0200
description:
b/mpn/generic/mu_div_qr.c: remove a branch

details:   /var/hg/gmp/rev/342c4df09416
changeset: 16620:342c4df09416
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Tue May 12 19:27:20 2015 +0200
description:
-typo in a comment

diffstat:

 mpn/generic/hgcd_reduce.c |  8 ++------
 mpn/generic/mu_div_qr.c   |  4 ++--
 mpn/generic/mulmod_bnm1.c |  2 +-
 3 files changed, 5 insertions(+), 9 deletions(-)

diffs (44 lines):

diff -r c35b6149498b -r 342c4df09416 mpn/generic/hgcd_reduce.c
--- a/mpn/generic/hgcd_reduce.c	Sun May 10 08:44:04 2015 +0200
+++ b/mpn/generic/hgcd_reduce.c	Tue May 12 19:27:20 2015 +0200
@@ -54,12 +54,8 @@
   tp = TMP_ALLOC_LIMBS (an + bn);
 
   mpn_mul (tp, ap, an, bp, bn);
-  if (an + bn > rn)
-    {
-      ASSERT (tp[rn] == 0);
-      bn--;
-    }
-  ASSERT_NOCARRY (mpn_sub (rp, rp, rn, tp, an + bn));
+  ASSERT ((an + bn <= rn) || (tp[rn] == 0));
+  ASSERT_NOCARRY (mpn_sub (rp, rp, rn, tp, an + bn - (an + bn > rn)));
   TMP_FREE;
 
   while (rn > an && (rp[rn-1] == 0))
diff -r c35b6149498b -r 342c4df09416 mpn/generic/mu_div_qr.c
--- a/mpn/generic/mu_div_qr.c	Sun May 10 08:44:04 2015 +0200
+++ b/mpn/generic/mu_div_qr.c	Tue May 12 19:27:20 2015 +0200
@@ -260,8 +260,8 @@
   else
     MPN_COPY_INCR (rp, np, dn);
 
-  if (qn == 0)
-    return qh;			/* Degenerate use.  Should we allow this? */
+  /* if (qn == 0) */			/* The while below handles this case */
+  /*   return qh; */			/* Degenerate use.  Should we allow this? */
 
   while (qn > 0)
     {
diff -r c35b6149498b -r 342c4df09416 mpn/generic/mulmod_bnm1.c
--- a/mpn/generic/mulmod_bnm1.c	Sun May 10 08:44:04 2015 +0200
+++ b/mpn/generic/mulmod_bnm1.c	Tue May 12 19:27:20 2015 +0200
@@ -133,7 +133,7 @@
 
       /* We need at least an + bn >= n, to be able to fit one of the
 	 recursive products at rp. Requiring strict inequality makes
-	 the coded slightly simpler. If desired, we could avoid this
+	 the code slightly simpler. If desired, we could avoid this
 	 restriction by initially halving rn as long as rn is even and
 	 an + bn <= rn/2. */
 


More information about the gmp-commit mailing list