Small limb-size in mini-gmp?
bodrato at mail.dm.unipi.it
Tue Nov 19 17:10:04 UTC 2019
Il Mar, 19 Novembre 2019 5:02 pm, Torbjörn Granlund ha scritto:
> "Marco Bodrato" <bodrato at mail.dm.unipi.it> writes:
> The generic code (for mpn_invert_3by2) works only when "unsigned" is
> the size of "mp_limb_t" or has the same size... this means that large
> types for mp_limb_t are not supported (e.g. no uint128_t). Smaller types
> should be handled by some of the shortcuts.
> If soo, why did asl8 work?
For asl8, one of the existing shortcuts is used, not the generic code.
In particular, mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0) reduces to:
return (((unsigned) 1 << 24) - 1) / (((unsigned) u1 << 8) + u0);
More information about the gmp-devel