diff options
author | Torbjorn Granlund <tg@gmplib.org> | 2017-01-24 22:41:36 +0100 |
---|---|---|
committer | Torbjorn Granlund <tg@gmplib.org> | 2017-01-24 22:41:36 +0100 |
commit | ad002a7167396ebff6f0efb715d60ac16cc49ef4 (patch) | |
tree | c21a644dd3dc172930c8bf2afad9a61609f5dee7 /tune/tuneup.c | |
parent | 95191e92820b0da63fdb4a0f681168345ca91876 (diff) | |
download | gmp-ad002a7167396ebff6f0efb715d60ac16cc49ef4.tar.gz |
Break out and optimise powtab computation from mpn/generic/get_str.c and mpn/generic/set_str.c.
Diffstat (limited to 'tune/tuneup.c')
-rw-r--r-- | tune/tuneup.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tune/tuneup.c b/tune/tuneup.c index b254d4788..1b561e836 100644 --- a/tune/tuneup.c +++ b/tune/tuneup.c @@ -2719,14 +2719,15 @@ speed_mpn_pre_set_str (struct speed_params *s) chars_per_limb = mp_bases[base].chars_per_limb; un = s->size / chars_per_limb + 1; powtab_mem = TMP_BALLOC_LIMBS (mpn_dc_set_str_powtab_alloc (un)); - mpn_set_str_compute_powtab (powtab, powtab_mem, un, base); + size_t n_pows = mpn_compute_powtab (powtab, powtab_mem, un, base); + powers_t *pt = powtab + n_pows; tp = TMP_BALLOC_LIMBS (mpn_dc_set_str_itch (un)); speed_starttime (); i = s->reps; do { - mpn_pre_set_str (wp, str, s->size, powtab, tp); + mpn_pre_set_str (wp, str, s->size, pt, tp); } while (--i != 0); t = speed_endtime (); |