summaryrefslogtreecommitdiff
path: root/tune/common.c
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2000-04-29 22:18:44 +0200
committerKevin Ryde <user42@zip.com.au>2000-04-29 22:18:44 +0200
commita4cee87a4b5e152f9e379c1986fde70ac6b47e8a (patch)
tree4e9f70c3892902fb778ca766777fc68e337569de /tune/common.c
parentbc277bdf99f0beaa2b04981dc090c793ca3eafd9 (diff)
downloadgmp-a4cee87a4b5e152f9e379c1986fde70ac6b47e8a.tar.gz
Add hamdist, gcd and gcdext.
Switch from needing 2 or 3 same measurements to 3 or 4.
Diffstat (limited to 'tune/common.c')
-rw-r--r--tune/common.c51
1 files changed, 34 insertions, 17 deletions
diff --git a/tune/common.c b/tune/common.c
index b3934ac6f..9e3180834 100644
--- a/tune/common.c
+++ b/tune/common.c
@@ -100,8 +100,8 @@ double_cmp_ptr (const double *p, const double *q)
speed_precision * speed_unittime. This aims to minimize the effects of a
limited accuracy time base and the overhead of the measuring itself.
- Measurements are made looking for 3 results within TOLERANCE of each
- other (or 2 for routines taking longer than 2 seconds). This aims to get
+ Measurements are made looking for 4 results within TOLERANCE of each
+ other (or 3 for routines taking longer than 2 seconds). This aims to get
an accurate reading even if some runs are bloated by interrupts or task
switches or whatever.
@@ -157,11 +157,11 @@ speed_measure (double (*fun) _PROTO ((struct speed_params *s)),
if (speed_precision == 0)
return t[i];
- /* require 2 values within TOLERANCE when >= 2 secs, 3 when below */
+ /* require 3 values within TOLERANCE when >= 2 secs, 4 when below */
if (t[0] >= 2.0)
- e = 2;
- else
e = 3;
+ else
+ e = 4;
/* Look for e many t[]'s within TOLERANCE of each other to consider a
valid measurement. Return smallest among them. */
@@ -452,6 +452,11 @@ speed_mpn_popcount (struct speed_params *s)
{
SPEED_ROUTINE_MPN_POPCOUNT (mpn_popcount);
}
+double
+speed_mpn_hamdist (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPN_HAMDIST (mpn_hamdist);
+}
@@ -522,18 +527,6 @@ speed_mpn_xnor_n (struct speed_params *s)
double
-speed_mpz_fac_ui (struct speed_params *s)
-{
- SPEED_ROUTINE_MPZ_UI (mpz_fac_ui);
-}
-double
-speed_mpz_fib_ui (struct speed_params *s)
-{
- SPEED_ROUTINE_MPZ_UI (mpz_fib_ui);
-}
-
-
-double
speed_mpn_mul_n (struct speed_params *s)
{
SPEED_ROUTINE_MPN_MUL_N (mpn_mul_n);
@@ -591,6 +584,30 @@ speed_mpn_toom3_sqr_n (struct speed_params *s)
double
+speed_mpn_gcd (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPN_GCD (mpn_gcd);
+}
+double
+speed_mpn_gcdext (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPN_GCDEXT (mpn_gcdext);
+}
+
+
+double
+speed_mpz_fac_ui (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPZ_UI (mpz_fac_ui);
+}
+double
+speed_mpz_fib_ui (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPZ_UI (mpz_fib_ui);
+}
+
+
+double
speed_noop (struct speed_params *s)
{
unsigned i;