Re: Seeking Endorsement: Boost.int128

Matt Borland via Boost <[email protected]>
Newsgroups gmane.comp.lib.boost.devel
Message-ID <KSpbX1p7rwDqHJi4xrmJl00n3WwnmPcg1d_6M1_G-Nv8cwgkkPPG51Ff9fX-IaVWT1AFz1JJbPBesPR4LiNh9G_tphQkk_HOu9taYYnWCf0=@mattborland.com>



On Wednesday, April 29th, 2026 at 1:59 AM, Rainer Deyke via Boost <[email protected]> wrote:

> On 4/28/26 19:02, Matt Borland via Boost wrote:
> > Dear All,
> >
> > I am seeking endorsement for review of my library int128 [1]. The library requires only C++14, is header only, and has no mandatory dependencies. What does int128 provide? Two portable and performant types: a 128-bit signed integer and a 128-bit unsigned integer, as well as a standard library for them. The performance of these types have been tuned and tested on a variety of architectures to include: x64, x32, s390x, ARM64, ARM32, PPC64LE. Both of the types and most of their library functions also work inside CUDA kernels. Benchmarks against Boost.Multiprecision, Absl, MSVC's software 128-bit integers, and built-ins, are available [2].
> 

> I have mixed feelings about this.  What I really want is a true
> std::int128_t using native CPU instructions that is a true integral type
> and can be used in switch statements.  The proposed library looks good
> from a performance perspective, but that could all change when true 128
> bit integer CPU instructions arrive, and as a class type it can't be
> used with switch statements.
> 


Here is the paper that I referenced earlier about the std::int_least128_t proposal being replaced by _BitInt: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2026/p3666r3.html. Hopefully an unsigned _BitInt(128) does as you describe, but I have not looked at the existing implementations to see if that's true. The max required width is only 64-bits, so we may very well end up in a situation where 128-bit still is not cross-platform.

> Despite my reservations, I endorse this library.  It's available now, it
> runs on current CPUs, and I can always hide it behind a typedef so that
> I can switch to another int128 implementation when a true native one
> becomes available.
> 


Thank you!

Matt

_______________________________________________
Boost mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.boost.org/mailman3/lists/boost.lists.boost.org/
Archived at: https://lists.boost.org/archives/list/[email protected]/message/LF6QV6L4HCTRFPJ4VGG3TUZMMDG3YRVO/
publickey - [email protected] - 0xC1382EAD.asc (application/pgp-keys, 653 B)
-----BEGIN PGP PUBLIC KEY BLOCK-----

xjMEX2wgdBYJKwYBBAHaRw8BAQdAUHOh0KpbZCszhdvKztWj4C6FR1ozMBQE
waBi3m2PJHLNK21hdHRAbWF0dGJvcmxhbmQuY29tIDxtYXR0QG1hdHRib3Js
YW5kLmNvbT7CjwQQFgoAIAUCX2wgdAYLCQcIAwIEFQgKAgQWAgEAAhkBAhsD
Ah4BACEJEFmBWlVCFaWlFiEEwTgurTcoHwbdSbIsWYFaVUIVpaVWuwEA77rm
OA4TB6Xxe6q8gI42bEICMhMyZKSMcakz39/djYkBAMJOG+IGQC/d0n3dsl10
Kg/oxX88kFO1oPKn4/XW+ToBzjgEX2wgdBIKKwYBBAGXVQEFAQEHQOsmo6wR
UuXRAvFIiqmQkzYrPyvKYKna2z4ZtmnTQMkMAwEIB8J4BBgWCAAJBQJfbCB0
AhsMACEJEFmBWlVCFaWlFiEEwTgurTcoHwbdSbIsWYFaVUIVpaWUJwEA5G0c
ZRnG5WGNErI+y90iQrTv02i4Ivhv7twoFcLD/zwA/jKypw+vehE99mEj1/uI
EkoDFlNzQZqNldbjRcPyI5UH
=462S
-----END PGP PUBLIC KEY BLOCK-----
signature.asc (application/pgp-signature, 343 B)
-----BEGIN PGP SIGNATURE-----
Version: ProtonMail

wrsEARYKAG0Fgmnx/LsJEFmBWlVCFaWlRRQAAAAAABwAIHNhbHRAbm90YXRp
b25zLm9wZW5wZ3Bqcy5vcmdA35O0EZjikP2EIthbSErHG5GzLfN7Lp0R56lK
uB+pyRYhBME4Lq03KB8G3UmyLFmBWlVCFaWlAABOnAEA7VrInE0L0bMw29N7
4Rj1WsziD+YEjIx4u7ewxcyj8ewA+gJs6ARrugKH3PeXV1Kl3/H3V7SkwFCf
TMAP4vPZBO4A
=BYjQ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.