Small limb-size in mini-gmp?

Marco Bodrato bodrato at
Tue Nov 19 19:57:14 UTC 2019


Il Mar, 19 Novembre 2019 7:50 pm, Torbjörn Granlund ha scritto:
> If there is special code for several asl cases, doesn't that defeat the
> purpose of asl, at least to some extent?

Of course, to some extent you are right.

There are two functions that contain really special code for smaller sizes:
the gmp_umul_ppmm macro, and the function mpn_invert_3by2.

It is possible (and not really difficult, I think) to adapt the default
code and remove any special shortcut from both those functions too. The
price would be to slow down both the asl version and the default
(mp_limb_t = unsigned long) one.

I think that special code to use plain unsigned long multiplication and
plain unsigned long division for those two critical macros, when limbs are
small enough, is a reasonable compromise.

> (Testing was successful now.  Let me know if mati's weekly testing is
> sufficient or if additional or more frequent testing would be

I think it is sufficient. We will decide if the testing was enough before
releasing... In the yes case, we will document the feature; in the no
case, we will not :-)


More information about the gmp-devel mailing list