FreeBSD 9.0-CUR/amd64 CLANG: howto use gcc __builtin_ia32?

O. Hartmann ohartman at
Thu Jun 16 07:04:15 UTC 2011

On 06/15/11 20:36, Doug Rabson wrote:
> You could try using the standard<xmmintrin.h>  header - that has inline
> functions which should cover all the SSE instructions.
> On 12 June 2011 17:43, Hartmann, O.<ohartman at>  wrote:
>> I use some numerical code utilizing the SIMD units of modern X86
>> architectures. Code compiles well using gcc/gcc46,
>> but clang does not know about the __builtin_ia32_xxxxx() statements. How to
>> treat those in clang and how to make
>> C code compiling with clang utilizing those __builtin_ia32 statements?
>> Thanks,
>> Oliver

Thanks for this hint.

I tried, and its a negative. I'm quite new to the usage of builtins and 
I oriented myself using gcc style __builtins. Especially 
__builtin_ia32_mulpd(()), __builtin_ia32_addpd(()). The aim is to add, 
mul, div and sub two 64 Bit doubles residing in a 128 Bit xmm register; 
by doing this, a struct contains two unions, each 128 bit, to simulate a 
4d vector, so I' capable of adding, multiplying etc. vectors using the 
SIMD units. It seems that there is a more 'sophisticated' way than 
simply apllying the __builtin assembly equivalences.


More information about the freebsd-current mailing list