[Gmp-commit] /home/hgfiles/gmp: Tune SQRMOD_BNM1_THRESHOLD constant.

mercurial at gmplib.org mercurial at gmplib.org
Thu Dec 17 16:42:58 CET 2009


details:   /home/hgfiles/gmp/rev/e1f87ead7745
changeset: 13112:e1f87ead7745
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Thu Dec 17 16:42:54 2009 +0100
description:
Tune SQRMOD_BNM1_THRESHOLD constant.

diffstat:

 ChangeLog     |   2 ++
 tune/tuneup.c |  14 ++++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)

diffs (50 lines):

diff -r 207c2e42f269 -r e1f87ead7745 ChangeLog
--- a/ChangeLog	Thu Dec 17 16:28:21 2009 +0100
+++ b/ChangeLog	Thu Dec 17 16:42:54 2009 +0100
@@ -40,6 +40,8 @@
 	* tests/mpn/t-sqrmod_bnm1.c: New test file.
 	* tests/mpn/Makefile.am (check_PROGRAMS): Add t-sqrmod_bnm1.
 
+	* tune/tuneup.c: Tune SQRMOD_BNM1_THRESHOLD.
+
 2009-12-17  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/generic/bdiv_q.c (mpn_bdiv_q_itch): Rewrite.
diff -r 207c2e42f269 -r e1f87ead7745 tune/tuneup.c
--- a/tune/tuneup.c	Thu Dec 17 16:28:21 2009 +0100
+++ b/tune/tuneup.c	Thu Dec 17 16:42:54 2009 +0100
@@ -163,6 +163,7 @@
 mp_size_t  mullo_dc_threshold           = MP_SIZE_T_MAX;
 mp_size_t  mullo_mul_n_threshold        = MP_SIZE_T_MAX;
 mp_size_t  mulmod_bnm1_threshold        = MP_SIZE_T_MAX;
+mp_size_t  sqrmod_bnm1_threshold        = MP_SIZE_T_MAX;
 mp_size_t  div_sb_preinv_threshold      = MP_SIZE_T_MAX;
 mp_size_t  dc_div_qr_threshold          = MP_SIZE_T_MAX;
 mp_size_t  dc_divappr_q_threshold       = MP_SIZE_T_MAX;
@@ -913,6 +914,18 @@
   one (&mulmod_bnm1_threshold, &param);
 }
 
+void
+tune_sqrmod_bnm1 (void)
+{
+  static struct param_t  param;
+
+  param.name = "SQRMOD_BNM1_THRESHOLD";
+  param.function = speed_mpn_sqrmod_bnm1;
+  param.min_size = 4;
+  param.max_size = 100;
+  one (&sqrmod_bnm1_threshold, &param);
+}
+
 
 /* Start the basecase from 3, since 1 is a special case, and if mul_basecase
    is faster only at size==2 then we don't want to bother with extra code
@@ -1920,6 +1933,7 @@
   printf("\n");
 
   tune_mulmod_bnm1 ();
+  tune_sqrmod_bnm1 ();
   printf("\n");
 
   tune_dc_div ();


More information about the gmp-commit mailing list