diff options
Diffstat (limited to 'tune')
-rw-r--r-- | tune/common.c | 5 | ||||
-rw-r--r-- | tune/speed.c | 3 | ||||
-rw-r--r-- | tune/speed.h | 10 |
3 files changed, 15 insertions, 3 deletions
diff --git a/tune/common.c b/tune/common.c index 9855e8845..88f0099e8 100644 --- a/tune/common.c +++ b/tune/common.c @@ -461,6 +461,11 @@ speed_mpn_com (struct speed_params *s) { SPEED_ROUTINE_MPN_COPY (mpn_com); } +double +speed_mpn_tabselect (struct speed_params *s) +{ + SPEED_ROUTINE_MPN_TABSELECT (mpn_tabselect); +} double diff --git a/tune/speed.c b/tune/speed.c index cffed35b6..704d82772 100644 --- a/tune/speed.c +++ b/tune/speed.c @@ -283,7 +283,7 @@ const struct routine_t { { "mpn_hgcd_reduce", speed_mpn_hgcd_reduce }, { "mpn_hgcd_reduce_1", speed_mpn_hgcd_reduce_1 }, { "mpn_hgcd_reduce_2", speed_mpn_hgcd_reduce_2 }, - + { "mpn_gcd_1", speed_mpn_gcd_1, FLAG_R_OPTIONAL }, { "mpn_gcd_1N", speed_mpn_gcd_1N, FLAG_R_OPTIONAL }, @@ -412,6 +412,7 @@ const struct routine_t { #if HAVE_NATIVE_mpn_copyd { "mpn_copyd", speed_mpn_copyd }, #endif + { "mpn_tabselect", speed_mpn_tabselect, FLAG_R_OPTIONAL }, #if HAVE_NATIVE_mpn_addlsh1_n { "mpn_addlsh1_n", speed_mpn_addlsh1_n, FLAG_R_OPTIONAL }, #endif diff --git a/tune/speed.h b/tune/speed.h index 329c09783..20daad2dd 100644 --- a/tune/speed.h +++ b/tune/speed.h @@ -175,6 +175,7 @@ double speed_mpn_copyi __GMP_PROTO ((struct speed_params *s)); double speed_MPN_COPY __GMP_PROTO ((struct speed_params *s)); double speed_MPN_COPY_DECR __GMP_PROTO ((struct speed_params *s)); double speed_MPN_COPY_INCR __GMP_PROTO ((struct speed_params *s)); +double speed_mpn_tabselect __GMP_PROTO ((struct speed_params *s)); double speed_mpn_divexact_1 __GMP_PROTO ((struct speed_params *s)); double speed_mpn_divexact_by3 __GMP_PROTO ((struct speed_params *s)); double speed_mpn_bdiv_q_1 __GMP_PROTO ((struct speed_params *)); @@ -613,7 +614,7 @@ int speed_routine_count_zeros_setup #define SPEED_RESTRICT_COND(cond) if (!(cond)) return -1.0; /* For mpn_copy or similar. */ -#define SPEED_ROUTINE_MPN_COPY(function) \ +#define SPEED_ROUTINE_MPN_COPY_CALL(call) \ { \ mp_ptr wp; \ unsigned i; \ @@ -632,13 +633,18 @@ int speed_routine_count_zeros_setup speed_starttime (); \ i = s->reps; \ do \ - function (wp, s->xp, s->size); \ + call; \ while (--i != 0); \ t = speed_endtime (); \ \ TMP_FREE; \ return t; \ } +#define SPEED_ROUTINE_MPN_COPY(function) \ + SPEED_ROUTINE_MPN_COPY_CALL (function (wp, s->xp, s->size)) + +#define SPEED_ROUTINE_MPN_TABSELECT(function) \ + SPEED_ROUTINE_MPN_COPY_CALL (function (wp, s->xp, s->size, 1, s->r)) #define SPEED_ROUTINE_MPN_COPYC(function) \ { \ |