summaryrefslogtreecommitdiff
path: root/tune
diff options
context:
space:
mode:
authorschevill <schevill@280ebfd0-de03-0410-8827-d642c229c3f4>2010-10-15 15:18:18 +0000
committerschevill <schevill@280ebfd0-de03-0410-8827-d642c229c3f4>2010-10-15 15:18:18 +0000
commitfe1d9c40e27b2606dc2f3c2bb0979aceee52ada5 (patch)
tree7c63fa62f2fe94db2d22a2e3bd209aeb92b41ef9 /tune
parente832877ec222701b3a4d2e298980db36797c5881 (diff)
downloadmpfr-fe1d9c40e27b2606dc2f3c2bb0979aceee52ada5.tar.gz
Reorganized mparam_h.in in separate files.
Added mpfr_buildopt_tune_case function. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7201 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tune')
-rw-r--r--tune/tuneup.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/tune/tuneup.c b/tune/tuneup.c
index e97a7f2eb..7577d4aad 100644
--- a/tune/tuneup.c
+++ b/tune/tuneup.c
@@ -326,8 +326,15 @@ mpfr_speed_measure (speed_function_t fun, struct speed_params *s, char *m)
double t = -1.0;
int i;
int number_of_iterations = 5;
- for (i = 0; i < number_of_iterations && t == -1.0; i++)
- t = speed_measure (fun, s);
+ for (i = 1; i <= number_of_iterations && t == -1.0; i++)
+ {
+ t = speed_measure (fun, s);
+ if ( (t == -1.0) && (i+1 <= number_of_iterations) )
+ {
+ printf("speed_measure failed. Trying again... (%d/%d)\n",
+ i+1, number_of_iterations);
+ }
+ }
if (t == -1.0)
{
fprintf (stderr, "Failed to measure %s!\n", m);
@@ -422,14 +429,14 @@ domeasure2 (long int *threshold1, long int *threshold2, long int *threshold3,
*threshold1 = 0;
*threshold2 = 0;
*threshold3 = 0;
- t1 = mpfr_speed_measure (func, &s, "1");
+ t1 = mpfr_speed_measure (func, &s, "function 1");
if (MPFR_IS_NEG (x))
*threshold1 = INT_MIN;
else
*threshold3 = INT_MAX;
*threshold2 = INT_MAX;
- t2 = mpfr_speed_measure (func, &s, "2");
+ t2 = mpfr_speed_measure (func, &s, "function 2");
/* t1 is the time of the first algo (used for low prec) */
if (t2 >= t1)
@@ -1018,7 +1025,8 @@ all (const char *filename)
#else
fprintf (f, "system compiler */\n");
#endif
- fprintf (f, "\n");
+ fprintf (f, "\n\n");
+ fprintf (f, "#define MPFR_TUNE_CASE \"Tuned with 'make tune'\"\n");
/* Tune mulhigh */
tune_mul_mulders (f);