Small operands gcd improvements

Niels Möller nisse at
Mon Aug 5 05:37:10 UTC 2019

tg at (Torbjörn Granlund) writes:

>   I hope we don't we have to do that all at once, but can the mpn_gcd_11
>   entry point be optional (via HAVE_NATIVE_*)?
> Yes, otherwise it'll never happen!

It's not obvious to me how to organize that. Can we do it like this?

* gcd_11.c and gcd_1.c as separate source files.

* There's no reason to override gcd_1 in assembly without also
  overriding gcd_11. To do that one can have either separate gcd_11.asm
  and gcd_1.asm, or have a single gcd_1.asm with both entrypoints. To
  support the latter case, gcd_11.c (which is still built)
  must put its implementation inside #if !HAVE_NATIVE_gcd_11.

Does that work? Is there any simpler way? One could require separate asm
files, but then existing files need to be split when gcd_11 is added.

Longer term, maybe there's no need to have assembly gcd_1 at all.

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