https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111209
--- Comment #3 from cqwrteur <unlvsur at live dot com> --- (In reply to Jakub Jelinek from comment #1) > Just use __int128 addition if all you want is double-word addition (or long > long for 32-bit arches)? Well, I've presented this merely as an illustrative example. The length can actually be arbitrary. I've directly taken the code from the GCC documentation, but it doesn't appear to perform as the document asserts. " Built-in Function: unsigned int __builtin_addc (unsigned int a, unsigned int b, unsigned int carry_in, unsigned int *carry_out) Built-in Function: unsigned long int __builtin_addcl (unsigned long int a, unsigned long int b, unsigned int carry_in, unsigned long int *carry_out) Built-in Function: unsigned long long int __builtin_addcll (unsigned long long int a, unsigned long long int b, unsigned long long int carry_in, unsigned long long int *carry_out) These built-in functions are equivalent to: ({ __typeof__ (a) s; \ __typeof__ (a) c1 = __builtin_add_overflow (a, b, &s); \ __typeof__ (a) c2 = __builtin_add_overflow (s, carry_in, &s); \ *(carry_out) = c1 | c2; \ s; }) i.e. they add 3 unsigned values, set what the last argument points to to 1 if any of the two additions overflowed (otherwise 0) and return the sum of those 3 unsigned values. Note, while all the first 3 arguments can have arbitrary values, better code will be emitted if one of them (preferrably the third one) has only values 0 or 1 (i.e. carry-in). " Additionally, it's advisable to steer clear of using __uint128_t in certain situations. This data type is not compatible with the Microsoft compiler and 32-bit machines. Moreover, the compiler does not effectively optimize the associated costs.