Suggested tune/tuneup.c patch

Niels Möller nisse at lysator.liu.se
Fri Sep 13 20:29:16 UTC 2019


tg at gmplib.org (Torbjörn Granlund) writes:

> nisse at lysator.liu.se (Niels Möller) writes:
>
>   Below patch adds a helper function for tuning *_METHOD values,
>   evaluated at some fix size. What do you think?
>
> It helps with some function comments, outlining what a function does,
> and what its arguments mean.
>
> Please consider adding that before committing.

Done and pushed.

> And please take a screenshot of the affected parameters before and
> after this change, as a sanity check.

Looks reasonable to me:

Before:

size=1, mpn_hgcd2_1 0.000001154
size=1, mpn_hgcd2_2 0.000001552
size=1, mpn_hgcd2_3 0.000001138
#define HGCD2_METHOD                     ...
#define HGCD2_METHOD                         3  /* 1.38% faster than 1 */

After: 

size=1, mpn_hgcd2, method 1 0.000001160
size=1, mpn_hgcd2, method 2 0.000001548
size=1, mpn_hgcd2, method 3 0.000001146
#define HGCD2_METHOD                     ...
#define HGCD2_METHOD                         3  /* 1.20% faster than 1 */

I only get this _METHOD and JACOBI_BASE_METHOD on my machine, though.
DIV_QR_1N_PI1_METHOD and MOD_1_1P_METHOD which also use the new helper
are both skipped.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.


More information about the gmp-devel mailing list