summaryrefslogtreecommitdiff
path: root/tune
diff options
context:
space:
mode:
authorNiels M?ller <nisse@lysator.liu.se>2014-01-16 21:30:22 +0100
committerNiels M?ller <nisse@lysator.liu.se>2014-01-16 21:30:22 +0100
commit2b6b73f02de74025082f82f5f167ff78f0e899d7 (patch)
treedb9a1aeee70d13fd6518fa06a58fb616be3ddf41 /tune
parentc7956cad5ad0bd836097c7404c04eaffee40a13b (diff)
downloadgmp-2b6b73f02de74025082f82f5f167ff78f0e899d7.tar.gz
speed support for mpn_sec_minvert.
Diffstat (limited to 'tune')
-rw-r--r--tune/common.c6
-rw-r--r--tune/speed.c1
-rw-r--r--tune/speed.h38
3 files changed, 45 insertions, 0 deletions
diff --git a/tune/common.c b/tune/common.c
index 6984217ea..6561946df 100644
--- a/tune/common.c
+++ b/tune/common.c
@@ -931,6 +931,12 @@ speed_mpn_ni_invertappr (struct speed_params *s)
}
double
+speed_mpn_sec_minvert (struct speed_params *s)
+{
+ SPEED_ROUTINE_MPN_SEC_MINVERT (mpn_sec_minvert, mpn_sec_minvert_itch);
+}
+
+double
speed_mpn_redc_1 (struct speed_params *s)
{
SPEED_ROUTINE_REDC_1 (mpn_redc_1);
diff --git a/tune/speed.c b/tune/speed.c
index 048a8900f..1f6ead190 100644
--- a/tune/speed.c
+++ b/tune/speed.c
@@ -361,6 +361,7 @@ const struct routine_t {
{ "mpn_invertappr", speed_mpn_invertappr },
{ "mpn_ni_invertappr", speed_mpn_ni_invertappr },
{ "mpn_binvert", speed_mpn_binvert },
+ { "mpn_sec_minvert", speed_mpn_sec_minvert },
{ "mpn_sbpi1_div_qr", speed_mpn_sbpi1_div_qr, FLAG_R_OPTIONAL},
{ "mpn_dcpi1_div_qr", speed_mpn_dcpi1_div_qr, FLAG_R_OPTIONAL},
diff --git a/tune/speed.h b/tune/speed.h
index ca57ae754..e5cb75f0c 100644
--- a/tune/speed.h
+++ b/tune/speed.h
@@ -291,6 +291,7 @@ double speed_mpn_brootinv (struct speed_params *);
double speed_mpn_invert (struct speed_params *);
double speed_mpn_invertappr (struct speed_params *);
double speed_mpn_ni_invertappr (struct speed_params *);
+double speed_mpn_sec_minvert (struct speed_params *s);
double speed_mpn_binvert (struct speed_params *);
double speed_mpn_redc_1 (struct speed_params *);
double speed_mpn_redc_2 (struct speed_params *);
@@ -2290,6 +2291,43 @@ int speed_routine_count_zeros_setup (struct speed_params *, mp_ptr, int, int);
return t; \
}
+#define SPEED_ROUTINE_MPN_SEC_MINVERT(function,itchfn) \
+ { \
+ long i; \
+ mp_ptr up, mp, tp, ip; \
+ double t; \
+ TMP_DECL; \
+ \
+ SPEED_RESTRICT_COND (s->size >= 1); \
+ \
+ TMP_MARK; \
+ SPEED_TMP_ALLOC_LIMBS (ip, s->size, s->align_xp); \
+ SPEED_TMP_ALLOC_LIMBS (up, s->size, s->align_yp); \
+ SPEED_TMP_ALLOC_LIMBS (mp, s->size, s->align_yp); \
+ SPEED_TMP_ALLOC_LIMBS (tp, itchfn (s->size), s->align_wp); \
+ \
+ speed_operand_src (s, up, s->size); \
+ speed_operand_dst (s, tp, s->size); \
+ speed_operand_dst (s, ip, s->size); \
+ speed_cache_fill (s); \
+ \
+ MPN_COPY (mp, s->yp, s->size); \
+ /* Must be odd */ \
+ mp[0] |= 1; \
+ speed_starttime (); \
+ i = s->reps; \
+ do \
+ { \
+ MPN_COPY (up, s->xp, s->size); \
+ function (ip, up, mp, s->size, 2*s->size*GMP_NUMB_BITS, tp); \
+ } \
+ while (--i != 0); \
+ t = speed_endtime (); \
+ \
+ TMP_FREE; \
+ return t; \
+ }
+
#define SPEED_ROUTINE_REDC_1(function) \
{ \
unsigned i; \