I tried to combine SSE2 inline assemblers and gcc inline assembler. But if I specify the variable as xmm0 / register as input, then in some cases I get a compiler error. Example:
#include <emmintrin.h> int main() { __m128i test = _mm_setzero_si128(); asm ("pxor %%xmm0, %%xmm0" : : "xmm0" (test) : ); }
When compiling with gcc version 4.6.1, I get:
>gcc asm_xmm.c asm_xmm.c: In function 'main': asm_xmm.c:10:3: error: matching constraint references invalid operand number asm_xmm.c:7:5: error: matching constraint references invalid operand number
The strange thing is that in the same cases, when I have other input variables / registers, it suddenly works with xmm0 as input, but not xmm1, etc. And in another case, I was able to specify xmm0-xmm4, but not higher. A bit confused / upset: S
Thanks:)
Jens schwarzer
source share