[Gmp-commit] /home/hgfiles/gmp: Attempt to choose between DC and MU cleverer.

mercurial at gmplib.org mercurial at gmplib.org
Wed Dec 30 19:21:57 CET 2009


details:   /home/hgfiles/gmp/rev/2b2ecb23f32a
changeset: 13270:2b2ecb23f32a
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Dec 30 19:21:47 2009 +0100
description:
Attempt to choose between DC and MU cleverer.

diffstat:

 ChangeLog             |  2 ++
 mpn/generic/tdiv_qr.c |  5 ++++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (26 lines):

diff -r 09449b4a9ea3 -r 2b2ecb23f32a ChangeLog
--- a/ChangeLog	Wed Dec 30 15:42:48 2009 +0100
+++ b/ChangeLog	Wed Dec 30 19:21:47 2009 +0100
@@ -1,5 +1,7 @@
 2009-12-30  Torbjorn Granlund  <tege at gmplib.org>
 
+	* mpn/generic/tdiv_qr.c: Attempt to choose between DC and MU cleverer.
+
 	* mpn/generic/tdiv_qr.c: Don't overwrite rp with unnecessary temporary
 	alloc.
 
diff -r 09449b4a9ea3 -r 2b2ecb23f32a mpn/generic/tdiv_qr.c
--- a/mpn/generic/tdiv_qr.c	Wed Dec 30 15:42:48 2009 +0100
+++ b/mpn/generic/tdiv_qr.c	Wed Dec 30 19:21:47 2009 +0100
@@ -134,7 +134,10 @@
 	    invert_pi1 (dinv, d2p[dn - 1], d2p[dn - 2]);
 	    if (BELOW_THRESHOLD (dn, DC_DIV_QR_THRESHOLD))
 	      mpn_sbpi1_div_qr (qp, n2p, nn, d2p, dn, dinv.inv32);
-	    else if (BELOW_THRESHOLD (dn, MU_DIV_QR_THRESHOLD))
+	    else if (BELOW_THRESHOLD (dn, MUPI_DIV_QR_THRESHOLD) ||
+		     BELOW_THRESHOLD (nn, MU_DIV_QR_THRESHOLD) ||
+		     (double) MUPI_DIV_QR_THRESHOLD * (nn-dn) +
+		     (double) MU_DIV_QR_THRESHOLD * dn > (double) dn * nn)
 	      mpn_dcpi1_div_qr (qp, n2p, nn, d2p, dn, &dinv);
 	    else
 	      {


More information about the gmp-commit mailing list