Small operands gcd improvements

Niels Möller nisse at lysator.liu.se
Thu Aug 8 11:00:37 UTC 2019


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

> Should we brave to return struct{mp_limb_t g0; mp_limb_t g1;} instead of
> having an rp parameter?

Does any other gmp functions do that? If we

1. Do that,

2. Arrange that g0 is put in the "primary" return register

3. Ensure that the register used for returning g1 isn't clobbered by
   gcd_11 assembly

then most assembly implementations of gcd_22 could tail call, aka jump
to, gcd_11. Which would be convenient if, e.g, we want a single
x86_64/gcd_22.asm to jumping into the right x86_64/foo/gcd_11.asm
depending on configuration.

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