[Gmp-commit] /var/hg/gmp: tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands ...
mercurial at gmplib.org
mercurial at gmplib.org
Thu Feb 7 15:17:50 CET 2013
details: /var/hg/gmp/rev/c3378d7c80de
changeset: 15381:c3378d7c80de
user: Marco Bodrato <bodrato at mail.dm.unipi.it>
date: Thu Feb 07 15:17:38 2013 +0100
description:
tune/speed.h (SPEED_ROUTINE_MPN_MUL): Use operands from struct s.
diffstat:
ChangeLog | 5 +++++
tune/README | 12 +++++++++---
tune/speed.h | 18 +++++++++---------
3 files changed, 23 insertions(+), 12 deletions(-)
diffs (78 lines):
diff -r 9d8aa5124b82 -r c3378d7c80de ChangeLog
--- a/ChangeLog Wed Feb 06 22:22:52 2013 +0100
+++ b/ChangeLog Thu Feb 07 15:17:38 2013 +0100
@@ -1,3 +1,8 @@
+2013-02-07 Marco Bodrato <bodrato at 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 at lysator.liu.se>
* tests/mpz/t-jac.c (check_large_quotients): Rewrote. Now uses a
diff -r 9d8aa5124b82 -r c3378d7c80de tune/README
--- a/tune/README Wed Feb 06 22:22:52 2013 +0100
+++ b/tune/README Thu Feb 07 15:17:38 2013 +0100
@@ -287,10 +287,16 @@
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 -r 9d8aa5124b82 -r c3378d7c80de tune/speed.h
--- a/tune/speed.h Wed Feb 06 22:22:52 2013 +0100
+++ b/tune/speed.h Thu Feb 07 15:17:38 2013 +0100
@@ -1022,30 +1022,30 @@
/* 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); \
- \
- SPEED_RESTRICT_COND (s->size >= 1); \
- SPEED_RESTRICT_COND (size1 >= s->size); \
+ if (size1 < 0) size1 = -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 (); \
\
More information about the gmp-commit
mailing list