[cfe-dev] clang and gcc X86 built-in functions

Alexandre Colucci alexandre at elgato.com
Thu Sep 16 10:33:40 PDT 2010


gcc 4.2 supports a bunch of X86 built-in functions (for example SSE vector instructions) that appear to not be known by clang:
http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/X86-Built_002din-Functions.html

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;
}


Thanks,
Alexandre

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100916/20152dbb/attachment.html>


More information about the cfe-dev mailing list