[Gmp-commit] /home/hgfiles/gmp: Make MUPI_DIV_QR_THRESHOLD tuning more reliable.

mercurial at gmplib.org mercurial at gmplib.org
Thu Dec 31 00:14:50 CET 2009


details:   /home/hgfiles/gmp/rev/b746141353c9
changeset: 13275:b746141353c9
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Dec 31 00:14:45 2009 +0100
description:
Make MUPI_DIV_QR_THRESHOLD tuning more reliable.

diffstat:

 ChangeLog     |   5 +++++
 tune/tuneup.c |  12 +++++++++++-
 2 files changed, 16 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r dff4fe2efe60 -r b746141353c9 ChangeLog
--- a/ChangeLog	Wed Dec 30 23:37:00 2009 +0100
+++ b/ChangeLog	Thu Dec 31 00:14:45 2009 +0100
@@ -1,3 +1,8 @@
+2009-12-31  Torbjorn Granlund  <tege at gmplib.org>
+
+	* tune/tuneup.c (speed_mpn_sbordcpi1_div_qr): New function.
+	(tune_mu_div): Use it.
+
 2009-12-30  Torbjorn Granlund  <tege at gmplib.org>
 
 	* tune/tuneup.c (tune_mu_bdiv, tune_dc_bdiv, tune_mu_div)
diff -r dff4fe2efe60 -r b746141353c9 tune/tuneup.c
--- a/tune/tuneup.c	Wed Dec 30 23:37:00 2009 +0100
+++ b/tune/tuneup.c	Thu Dec 31 00:14:45 2009 +0100
@@ -1101,6 +1101,15 @@
   }
 }
 
+static double
+speed_mpn_sbordcpi1_div_qr (struct speed_params *s)
+{
+  if (s->size < DC_DIV_QR_THRESHOLD)
+    return speed_mpn_sbpi1_div_qr (s);
+  else
+    return speed_mpn_dcpi1_div_qr (s);
+}
+
 void
 tune_mu_div (void)
 {
@@ -1128,9 +1137,10 @@
   {
     static struct param_t  param;
     param.name = "MUPI_DIV_QR_THRESHOLD";
-    param.function = speed_mpn_dcpi1_div_qr;
+    param.function = speed_mpn_sbordcpi1_div_qr;
     param.function2 = speed_mpn_mupi_div_qr;
     param.min_size = 6;
+    param.min_is_always = 1;
     param.max_size = 1000;
     param.step_factor = 0.02;
     one (&mupi_div_qr_threshold, &param);


More information about the gmp-commit mailing list