summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2013-02-07 15:17:38 +0100
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2013-02-07 15:17:38 +0100
commit3d35c791878818acf5e45bbae8e1bc38a95d1564 (patch)
treef457375a7ef95e220d99d5a9d636a37d61a59487
parent634b51d9e41fefe46776cd79bcd6069e7c7035fd (diff)
downloadgmp-3d35c791878818acf5e45bbae8e1bc38a95d1564.tar.gz
tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
-rw-r--r--ChangeLog5
-rw-r--r--tune/README12
-rw-r--r--tune/speed.h14
3 files changed, 21 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 47481a073..0086c61c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-07 Marco Bodrato <bodrato@mail.dm.unipi.it>
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
+ * tune/README: Document new parameter syntax mpn_mul.<#> .
+
2013-02-06 Niels Möller <nisse@lysator.liu.se>
* tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
diff --git a/tune/README b/tune/README
index b6e41eda0..80acd7b1e 100644
--- a/tune/README
+++ b/tune/README
@@ -287,10 +287,16 @@ mpn_divrem_1, using division by 32 as an example.
EXAMPLE COMPARISONS - MULTIPLICATION
-mul_basecase takes a ".<r>" parameter which is the first (larger) size
-parameter. For example to show speeds for 20x1 up to 20x15 in cycles,
+mul_basecase takes a ".<r>" parameter. If positivie, it gives the second
+(smaller) operand size. For example to show speeds for 3x3 up to 20x3 in
+cycles,
- ./speed -s 1-15 -c mpn_mul_basecase.20
+ ./speed -s 3-20 -c mpn_mul_basecase.3
+
+A negative ".<-r>" parameter fixes the size of the product to the absolute
+value r. For example to show speeds for 10x10 up to 19x1 in cycles,
+
+ ./speed -s 10-19 -c mpn_mul_basecase.-20
mul_basecase with no parameter does an NxN multiply, so for example to show
speeds in cycles for 1x1, 2x2, 3x3, etc, up to 20x20, in cycles,
diff --git a/tune/speed.h b/tune/speed.h
index 5dd91f2cc..3ab12d63d 100644
--- a/tune/speed.h
+++ b/tune/speed.h
@@ -1022,30 +1022,30 @@ int speed_routine_count_zeros_setup (struct speed_params *, mp_ptr, int, int);
/* For mpn_mul, mpn_mul_basecase, xsize=r, ysize=s->size. */
#define SPEED_ROUTINE_MPN_MUL(function) \
{ \
- mp_ptr wp, xp; \
+ mp_ptr wp; \
mp_size_t size1; \
unsigned i; \
double t; \
TMP_DECL; \
\
size1 = (s->r == 0 ? s->size : s->r); \
+ if (size1 < 0) size1 = -size1 - s->size; \
\
- SPEED_RESTRICT_COND (s->size >= 1); \
- SPEED_RESTRICT_COND (size1 >= s->size); \
+ SPEED_RESTRICT_COND (size1 >= 1); \
+ SPEED_RESTRICT_COND (s->size >= size1); \
\
TMP_MARK; \
SPEED_TMP_ALLOC_LIMBS (wp, size1 + s->size, s->align_wp); \
- SPEED_TMP_ALLOC_LIMBS (xp, size1, s->align_xp); \
\
- speed_operand_src (s, xp, size1); \
- speed_operand_src (s, s->yp, s->size); \
+ speed_operand_src (s, s->xp, s->size); \
+ speed_operand_src (s, s->yp, size1); \
speed_operand_dst (s, wp, size1 + s->size); \
speed_cache_fill (s); \
\
speed_starttime (); \
i = s->reps; \
do \
- function (wp, xp, size1, s->yp, s->size); \
+ function (wp, s->xp, s->size, s->yp, size1); \
while (--i != 0); \
t = speed_endtime (); \
\