Question

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.

Était-ce utile?

La solution

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

Autres conseils

Get the source and:

git log --reverse --grep='__int128'

to see the first occurrence of the word on a commit message.

This leads us to: https://github.com/gcc-mirror/gcc/commit/6388cfe24f7ecbdc2ba2d4c80638ea6c95ba07c2 which says:

Add __int128 keyword.

Then list all tags that contain that commit with:

git tag --contains 6388cfe24f7ecbdc2ba2d4c80638ea6c95ba07c2

and the earliest one is:

gcc-4_6_0-release

TODO: there is also an earlier reference to __int128_t which I did not understand. What is the difference between __int128 and _int128_t?

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top