[PATCH] mini-gmp: Use long long limb on WIN64
Jonas Hahnfeld
hahnjo at hahnjo.de
Sun Feb 22 21:53:17 CET 2026
On Sat, 2026-02-21 at 18:37 +0100, marco.bodrato at tutanota.com wrote:
> 21 feb 2026, 14:04 da hahnjo at hahnjo.de:
> > On Tue, 2026-02-17 at 14:56 +0100, marco.bodrato at tutanota.com wrote:
> >
> > > Yes, the current mini-gmp and mini-mpq code are designed to work with
> > > both larger (long long) and smaller (short, or char, ...) limb types,
> > > compared to the _ui type: unsigned long int.
> >
> > ... which is super useful, but sometimes client code makes assumptions
> > that mp_limb_t has a certain range and can be used to pass arguments
> > directly to the low-level mpn_ functions.
>
> Can I comment that from my point of view this is a bug on that code
> side? At least a portability bug.
> All the work to adapt mini-gmp to work with different limb sizes was
> started by Paul Zimmermam, to test the MPFR library more deeply.
> Their library is now both more robust on the portability side, and
> more tested.
Yes, I'm 50% with you here, except that it's really convenient if
"small" integers can be directly passed to mpn_ functions. I wonder if
there's an "established" pattern if mp_limb_t is not sufficient for the
value at hand? Ideally without allocating dynamic memory.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <https://gmplib.org/list-archives/gmp-devel/attachments/20260222/9e6f42a6/attachment.bin>
More information about the gmp-devel
mailing list