Small operands gcd improvements

Niels Möller nisse at lysator.liu.se
Mon Aug 5 20:22:49 UTC 2019


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

> nisse at lysator.liu.se (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: <https://gmplib.org/list-archives/gmp-devel/attachments/20190805/5ec9fc2a/attachment.bin>
-------------- next part --------------

Seems to pass existing tests/mpz/t_gcd_ui.

Regards,
/Niels

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
gotos.

-- 
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