diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | tune/README | 12 | ||||
-rw-r--r-- | tune/speed.h | 14 |
3 files changed, 21 insertions, 10 deletions
@@ -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 (); \ \ |