diff options
author | Niels M?ller <nisse@lysator.liu.se> | 2019-08-16 08:21:42 +0200 |
---|---|---|
committer | Niels M?ller <nisse@lysator.liu.se> | 2019-08-16 08:21:42 +0200 |
commit | 5638f7afc35f4d04fa748d261213be67f3cf28d3 (patch) | |
tree | 15640fc0636346ea92ffd9aed8610a2fc46591db /tune/speed.h | |
parent | c6fa69d38787f4b2dbfcf89ed46c133f87c87728 (diff) | |
download | gmp-5638f7afc35f4d04fa748d261213be67f3cf28d3.tar.gz |
Speed support for gcd_22.
Calls mpn_gcd_22(al, al, bl, bl), so that B+1 is a common factor.
* tune/speed.h (SPEED_ROUTINE_MPN_GCD_22): New macro.
* tune/speed.c (routine): Add mpn_gcd_22.
* tune/common.c (speed_mpn_gcd_22): New function.
Diffstat (limited to 'tune/speed.h')
-rw-r--r-- | tune/speed.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tune/speed.h b/tune/speed.h index 41df4c675..25b154203 100644 --- a/tune/speed.h +++ b/tune/speed.h @@ -225,6 +225,7 @@ double speed_mpn_gcd (struct speed_params *); double speed_mpn_gcd_1 (struct speed_params *); double speed_mpn_gcd_11 (struct speed_params *); double speed_mpn_gcd_1N (struct speed_params *); +double speed_mpn_gcd_22 (struct speed_params *); double speed_mpn_gcdext (struct speed_params *); double speed_mpn_gcdext_double (struct speed_params *); double speed_mpn_gcdext_one_double (struct speed_params *); @@ -2825,6 +2826,12 @@ int speed_routine_count_zeros_setup (struct speed_params *, mp_ptr, int, int); SPEED_ROUTINE_MPN_GCD_1_CALL((px[i] |= 1, py[i] |= 1), \ function (px[j-1], py[j-1])) +/* Multiply limbs by (B+1). Then we get a gcd exceeding one limb, so + we can measure gcd_22 loop only, without gcd_11. */ +#define SPEED_ROUTINE_MPN_GCD_22(function) \ + SPEED_ROUTINE_MPN_GCD_1_CALL((px[i] |= 1, py[i] |= 1), \ + function (px[j-1], px[j-1], py[j-1], py[j-1])) + #define SPEED_ROUTINE_MPN_JACBASE(function) \ SPEED_ROUTINE_MPN_GCD_1_CALL \ ({ \ |