diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-08-05 03:08:42 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2011-08-05 03:08:42 +0000 |
commit | 3780836ef46ab89bbd4276bee266dbf54600e320 (patch) | |
tree | 84a71be8c9a27e595fcdfe9c63a78ad847999bf2 /tune | |
parent | a6dd51fbd5f9e0663d435f07d229f58bd4141723 (diff) | |
download | mpfr-3780836ef46ab89bbd4276bee266dbf54600e320.tar.gz |
[mulders.c] added a basecase code for Mulders' short division
[tuneup.c] added corresponding tuning code
[TODO] added an item
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7783 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tune')
-rw-r--r-- | tune/tuneup.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tune/tuneup.c b/tune/tuneup.c index 66bb52a81..14810584c 100644 --- a/tune/tuneup.c +++ b/tune/tuneup.c @@ -863,6 +863,12 @@ tune_div_mulders_upto (mp_size_t n) kbest = n; tbest = mpfr_speed_measure (speed_mpfr_divhigh, &s, "mpfr_divhigh"); + /* Check k == 0, i.e., mpfr_divhigh_n_basecase */ + divhigh_ktab[n] = 0; + t = mpfr_speed_measure (speed_mpfr_divhigh, &s, "mpfr_divhigh"); + if (t * TOLERANCE < tbest) + kbest = 0, tbest = t; + /* Check Mulders */ step = 1 + n / (2 * MAX_STEPS); /* we should have (n+3)/2 <= k < n, which translates into @@ -942,7 +948,7 @@ tune_div_mulders (FILE *f) if (k != MPFR_DIVHIGH_TAB_SIZE - 1) fputc (',', f); if ((k+1) % 16 == 0) - fprintf (f, " \\\n "); + fprintf (f, " /*%u-%u*/ \\\n ", k - 15, k); if (verbose) putchar ('.'); } @@ -1048,6 +1054,7 @@ all (const char *filename) /* Tune divhigh */ tune_div_mulders (f); + fflush (f); /* Tune mpfr_mul (threshold is in limbs, but it doesn't matter too much) */ if (verbose) |