Small limb-size in mini-gmp?
bodrato at mail.dm.unipi.it
Sun Nov 10 11:02:07 UTC 2019
Il 2019-11-10 09:43 nisse at lysator.liu.se ha scritto:
> I noticed the recent change
> https://gmplib.org/repo/gmp/rev/d5f4f8640be9, "mini-gmp: Avoid
> behaviour with small limb sizes."
> Are you planning to do something like artificial-small-limbs
> for mini-gmp, suggested on the list a while ago?
The current code should work smoothly if you change mini-gmp.h and
typedef unsigned char mp_limb_t;
or use others unsigned types. Hopefully, both larger and smaller than
the default unsigned long should work.
It works thanks to the last corrections and to the work done last year
after the discussion on Paul's micro-gmp.
Paul also asked us "to indicate in mini-gmp.h the places to modify"
and you proposed a possible syntax in
But I'm not sure we should officially document this feature, for the
simple reason that... it is not currently tested by our great testing
So, I'm not "planning" anything more that what was already done. Except
possibly enabling an easy way to test the code with 8, 16, 32-bits
types... But it is not a priority for me, at the moment.
Maybe it works also for artificialy-small-limbs, maybe not. I did not
try, and I'm not planning any other change to support them.
> if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)
> should be equivalent, and slightly more readable, imo.
I agree! Adopted.
More information about the gmp-devel