gmp's c++ interface / mpz_class

Pedro Alves
Mon Oct 17 11:29:51 GMT 2022

On 2022-10-17 11:44 a.m., Luis Machado wrote:
> On 10/14/22 19:11, Pedro Alves wrote:
>> Hi!
>> Zoran and I found a potential need for an integer type with precision of 64-bit + 8-bit, in order to
>> store bit offsets that can span a whole 64-bits address space.  Instead of rolling our own,
>> I guess it makes sense to use libgmp, since, well, we already depend on it.  I see that we have:
> Is uint128_t an option (at least temporarily)?

That is not portable, unfortunately.  It doesn't exist in all compilers, and/or all architectures.

So it's useful to prototype things, but it's not something we can use, because we need this in
core code (DWARF expression evaluation).

We may end up with something like a typedef that maps to int128_t when available,
and to a C++ class emulation when not available, though.

More information about the Gdb mailing list