I'm working under Sun Studio 12.3 on SunOS 5.11 (Solaris 11.3). Its providing a compile error that I don't quite understand:
$ /opt/solarisstudio12.3/bin/CC -xarch=sse2 -xarch=aes -xarch=sse4_2 -c test.cxx
"test.cxx", line 11: ube: error: _mm_aeskeygenassist_si128 intrinsic requires at least -xarch=aes.
CC: ube failed for test.cxx
Adding -m64 produces the same error.
There's not much to the test program. It simply exercises a SSE2 intrinsic, and an AES intrinsic:
$ cat test.cxx
#include <stdint.h>
#include <wmmintrin.h>
#include <emmintrin.h>
int main(int argc, char* argv[])
{
// SSE2
int64_t x[2];
__m128i y = _mm_loadu_si128((__m128i*)x);
// AES
__m128i z = _mm_aeskeygenassist_si128(y,0);
return 0;
}
I've been trying to work through the manual and learn how to specify multiple cpu architecture features, like SSE2, SSSE3, AES and SSE4. But I can't seem to determine how to specify multiple ones. Here's one of the more complete pages I have found: Oracle Man Page CC.1, but I'm obviously missing something with respect to -xarch.
What am I doing wrong, and how do I fix it?
This command line
will use the last of
-xarch=sse2 -xarch=aes -xarch=sse4_2and cause the compiler to emitsse4_2-compatible binaries.This is documented in Chapter 3 of the C++ User's Guide:
This is done so you can do things like override the expansion of arguments like
-fast, which expands to about 10 separate arguments.You should use the
-xarch=aesflag - either last or as the only-xarch=...option.