Ciao Niels!

Il 2019-11-10 09:43 ni...@lysator.liu.se ha scritto:
I noticed the recent change
https://gmplib.org/repo/gmp/rev/d5f4f8640be9, "mini-gmp: Avoid undefined
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" (https://gmplib.org/list-archives/gmp-devel/2018-December/005123.html) and you proposed a possible syntax in https://gmplib.org/list-archives/gmp-devel/2018-December/005126.html

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 framework.

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.

Also,

  if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)

should be equivalent, and slightly more readable, imo.

I agree! Adopted.

Ĝis,
m
_______________________________________________
gmp-devel mailing list
gmp-devel@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-devel

Reply via email to