gcd_11 asm

Niels Möller nisse at lysator.liu.se
Fri Aug 23 19:11:38 UTC 2019


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

> (I'm not 100% happy with our private ABI between _22 and _11, but for
> now it will serve its purpose well enough, I think.)

To get some protection, maybe one could define a function with the
desired api, say

mp_double_limb_t
mpn_gcd_11_for_gcd_22(mp_limb_t u, mp_limb_t b)
{
  mp_double_limb_t g;
  g.d0 = gcd_11 (u, v);
  g.d1 = 0;
  return g;
}

Then gcd_22 could tail call that function, and gcd_11 assembly
supporting that return type could override it to just be an alias.

As a bonus, one would get a more sane behavior if for some reason one
tries to use asm gcd_22 but C gcd_11 or vice versa.

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