Small operands gcd improvements

Niels Möller nisse at
Mon Aug 5 20:22:49 UTC 2019

tg at (Torbjörn Granlund) writes:

> nisse at (Niels Möller) writes:
>   So I see no strong reason to do it one way or the other. Maybe start
>   with requiring both u and v odd, and relax requirements later in case we
>   find any more tangible benefit from doing that?
> Makes sense.

Here's a patch to take out gcd_11 to it's own C file, and call it from
gcd_1.c. Needs documentation (if you agree it should be a public
function), and it would be nice with separate tests for this function.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcd_11.diff
Type: text/x-diff
Size: 6008 bytes
Desc: not available
URL: <>
-------------- next part --------------

Seems to pass existing tests/mpz/t_gcd_ui.


PS. It seems I tried something similar back in 2014, but that was before
the cleanup where we deleted unused gcd_1 code variants and tricky

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