clang and gcc X86 built-in functions

gcc 4.2 supports a bunch of X86 built-in functions (for example SSE vector instructions) that appear to not be known by clang:

Is it a known incompatibility with gcc? Is there a plan to implement these built-in functions in clang? Or clang has some built-in replacements? Or did I simply miss something?
Here is a sample code that does not build with clang on 10.6 but compile with gcc 4.2:

#include <stdio.h>

int main (int argc, const char * argv[])
typedef short _SSE_VecS16 attribute ((vector_size (16)));

register _SSE_VecS16 b;
register _SSE_VecS16 c;
__builtin_ia32_paddw128(b, c);

return 0;


IIRC, Clang intentionally doesn’t have any built-ins for operations which are naturally modeled by operators. Either use the official SSE intrinsics, or use operators. Each built-in has a maintenance overhead, and such redundant ones aren’t worth it, when b + c (or b += c?) does the same thing.


More specifically, please use the <xmmintrin.h> and related headers. Those are the public, documented interfaces to the X86 vector instructions. Using generic vectors is also a great option if you only care about targeting clang, not other compilers like GCC, ICC, MSVC etc.


Thanks for the info. We switched to <xmmintrin.h> and it now works as expected.