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

mercurial at gmplib.org mercurial at gmplib.org
Wed Dec 30 01:53:12 CET 2009


details:   /home/hgfiles/gmp/rev/123449bc5673
changeset: 13263:123449bc5673
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Dec 30 01:52:42 2009 +0100
description:
Don't overwrite rp with unnecessary temporary alloc.

details:   /home/hgfiles/gmp/rev/2124e87fb35e
changeset: 13264:2124e87fb35e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Dec 30 01:53:05 2009 +0100
description:
Minor cleanup.

diffstat:

 ChangeLog               |  5 +++++
 mpn/generic/mu_div_qr.c |  2 +-
 mpn/generic/tdiv_qr.c   |  5 +----
 3 files changed, 7 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 9cf9c125c00d -r 2124e87fb35e ChangeLog
--- a/ChangeLog	Wed Dec 30 00:10:32 2009 +0100
+++ b/ChangeLog	Wed Dec 30 01:53:05 2009 +0100
@@ -1,3 +1,8 @@
+2009-12-30  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
+	alloc.
+
 2009-12-29  Torbjorn Granlund  <tege at gmplib.org>
 
 	* tune/tuneup.c (tune_mu_div): Tune MUPI_DIV_QR_THRESHOLD.
diff -r 9cf9c125c00d -r 2124e87fb35e mpn/generic/mu_div_qr.c
--- a/mpn/generic/mu_div_qr.c	Wed Dec 30 00:10:32 2009 +0100
+++ b/mpn/generic/mu_div_qr.c	Wed Dec 30 01:53:05 2009 +0100
@@ -236,7 +236,6 @@
 
   qh = mpn_preinv_mu_div_qr (qp, rp, np, nn, dp, dn, ip, in, scratch + in);
 
-/*  return qh; */
   return qh;
 }
 
@@ -371,6 +370,7 @@
 
       qn -= in;
     }
+
   return qh;
 }
 
diff -r 9cf9c125c00d -r 2124e87fb35e mpn/generic/tdiv_qr.c
--- a/mpn/generic/tdiv_qr.c	Wed Dec 30 00:10:32 2009 +0100
+++ b/mpn/generic/tdiv_qr.c	Wed Dec 30 01:53:05 2009 +0100
@@ -140,9 +140,8 @@
 	      {
 		mp_size_t itch = mpn_mu_div_qr_itch (nn, dn, 0);
 		mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
-		rp = n2p + nn - dn;
 		mpn_mu_div_qr (qp, rp, n2p, nn, d2p, dn, scratch);
-		MPN_COPY (n2p, rp, dn);
+		n2p = rp;
 	      }
 
 	    if (cnt != 0)
@@ -259,7 +258,6 @@
 	      mpn_divrem_2 (qp, 0L, n2p, 4L, d2p); /* FIXME: obsolete function */
 	    else
 	      {
-		gmp_pi1_t dinv;
 		invert_pi1 (dinv, d2p[qn - 1], d2p[qn - 2]);
 		if (BELOW_THRESHOLD (qn, DC_DIV_QR_THRESHOLD))
 		  mpn_sbpi1_div_qr (qp, n2p, 2 * qn, d2p, qn, dinv.inv32);
@@ -269,7 +267,6 @@
 		  {
 		    mp_size_t itch = mpn_mu_div_qr_itch (2 * qn, qn, 0);
 		    mp_ptr scratch = TMP_ALLOC_LIMBS (itch);
-		    rp = n2p + 2 * qn - qn;
 		    mpn_mu_div_qr (qp, rp, n2p, 2 * qn, d2p, qn, scratch);
 		    MPN_COPY (n2p, rp, qn);
 		  }


More information about the gmp-commit mailing list