Use-case for _addcarryx_u64() wrapper

Mason slash.tmp@free.fr
Thu Jun 1 07:42:25 GMT 2023


Hello,

As far as I can tell, intrinsics _addcarry_u64() and _addcarryx_u64() are
plain wrappers around the same __builtin_ia32_addcarryx_u64() function.

https://github.com/gcc-mirror/gcc/blob/master/gcc/config/i386/adxintrin.h

Thus, I wonder: what is the use-case for the wrappers?
Why would a programmer not call the builtin directly?
Is it for compatibility with Intel compilers?

Also, based on the names, I would have assumed that
_addcarry_u64 generates adc
while
_addcarryx_u64 generates adcx/adox ?

Relevant past discussion:
https://gcc.gnu.org/legacy-ml/gcc-help/2017-08/msg00100.html

Regards



More information about the Gcc-help mailing list