mini-gmp

Niels Möller nisse at lysator.liu.se
Fri Dec 21 18:13:13 UTC 2018


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

> I think we should consider carefully whether mini-gmp should be
> generalised to do small limbs.  To me, it makes sense to keep to
> mini-gmp's main goal of being small en simple.

Agree, we should not compromise simplicity. To me it might make sense to

1. Add some more complexity in umul_ppmm, which is critical for
   performance. Besides small-limb support, maybe use __uint128 where
   available (#ifdef __SIZEOF_INT128__)

2. Reduce the number of places that depend on mp_limb_t == unsigned
   long, where that also makes code simpler. E.g, using init_set_ui or
   roinit_ui in more of the _ui functions.

3. Make it easy to omit remaining the functions/macros depending on
   mp_limb_t == unsigned long, to enable some separate wrapping which
   defines substitutes and then includes mini-gmp.c.

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