Availability of compilers supporting 128-bit arithmetic?

Hans Aberg haberg-1 at telia.com
Thu Mar 3 20:52:33 CET 2011


On 2 Mar 2011, at 04:23, Will Galway wrote:

> I understand that recent versions of the Gnu C Compiler (gcc) support 128-bit integers, declared as__int128, although I'm puzzled to read at
> 
>  http://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html
> 
> that "There is no support in GCC to express an integer constant of type __int128 for targets having long long integer with less then 128 bit width."  (In which case, why not just declare 128-bit integers to be type long long int?)

Check sizeof(long long int) and if it less than 16, then you do not have __int128, perhaps because the implementors of the compiler felt that there were no suitable hardware support, though there might be some internal registers of that length. Then on that platform it would have to be implemented by hand, or using a package, like perhaps GMP. Perhaps this article can help
  http://en.wikipedia.org/wiki/128-bit

Hans




More information about the gmp-discuss mailing list