On Wednesday, April 29th, 2026 at 1:59 AM, Rainer Deyke via Boost <boost@lists.boost.org> 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