summaryrefslogtreecommitdiff
path: root/tune
diff options
context:
space:
mode:
authorTorbjorn Granlund <tg@gmplib.org>2017-01-24 22:41:36 +0100
committerTorbjorn Granlund <tg@gmplib.org>2017-01-24 22:41:36 +0100
commitad002a7167396ebff6f0efb715d60ac16cc49ef4 (patch)
treec21a644dd3dc172930c8bf2afad9a61609f5dee7 /tune
parent95191e92820b0da63fdb4a0f681168345ca91876 (diff)
downloadgmp-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')
-rw-r--r--tune/set_strb.c1
-rw-r--r--tune/set_strs.c1
-rw-r--r--tune/tuneup.c5
3 files changed, 3 insertions, 4 deletions
diff --git a/tune/set_strb.c b/tune/set_strb.c
index 4712bbe7b..128c41b9b 100644
--- a/tune/set_strb.c
+++ b/tune/set_strb.c
@@ -31,7 +31,6 @@ see https://www.gnu.org/licenses/. */
#define __gmpn_set_str mpn_set_str_basecase
#define __gmpn_bc_set_str mpn_bc_set_str_basecase
#define __gmpn_dc_set_str mpn_dc_set_str_basecase
-#define __gmpn_set_str_compute_powtab mpn_set_str_compute_powtab_basecase
#include "gmp-impl.h"
diff --git a/tune/set_strs.c b/tune/set_strs.c
index 6a0346fbc..d2a9fc2f8 100644
--- a/tune/set_strs.c
+++ b/tune/set_strs.c
@@ -31,7 +31,6 @@ see https://www.gnu.org/licenses/. */
#define __gmpn_set_str mpn_set_str_subquad
#define __gmpn_bc_set_str mpn_bc_set_str_subquad
#define __gmpn_dc_set_str mpn_dc_set_str_subquad
-#define __gmpn_set_str_compute_powtab mpn_set_str_compute_powtab_subquad
#include "gmp-impl.h"
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 ();