I'm testing on Solaris 11.3 with Sun Studio 12.2. I'm having trouble getting a SSE shuffle to compile:
solaris:$ cat test.cxx
#include <stdint.h>
#include <emmintrin.h>
int main(int argc, char* argv[])
{
__m128i a, b;
asm ("pshufb %1, %0" : "+x"(a) : "xm"(b));
return 0;
}
And then:
solaris:$ /opt/solstudio12.2/bin/CC test.cxx -o test.exe
"test.cxx", line 7: Error: The operand type "__m128i_" is not allowed for the constraint "+x".
1 Error(s) detected.
pshufb
is a SSSE3 instruction, but I'm having trouble determining if Sun Studio 12.2 supports it (too much irrelevant noise during search). I believe Sun Studio supports it. Sun Studio 12.3 and above consumes the inline assembly.
Why am I getting the error, and how do I fix it?