gcc128-bitextended-precision

What gcc versions support the __int128 intrinsic type?


Under the gcc docs 128-bit integers is:

As an extension the integer scalar type __int128 is supported for targets which have an integer mode wide enough to hold 128 bits. Simply write __int128 for a signed 128-bit integer, or unsigned __int128 for an unsigned 128-bit integer.

There is no support in GCC for expressing an integer constant of type __int128 for targets with long long integer less than 128 bits wide.

I was wondering what gcc version added support for this type, or if there's a macro that can be used directly to test for its existence.


Solution

  • Not sure about the first version, but you can test for the __SIZEOF_INT128__ macro - which is (typically) 16 if defined.