I'm wondering if Microsofts SSE intrinsics are a little different than the norm because I tried compiling this code with GCC with flags -msse -msse2 -msse3 -msse4
#include <stdio.h>
#include <smmintrin.h>
int main ()
{
__m128i a, b;
a.m128i_u64[0] = 0x000000000000000;
b.m128i_u64[0] = 0xFFFFFFFFFFFFFFF;
a.m128i_u64[1] = 0x000000000000000;
b.m128i_u64[1] = 0x000000000000000;
int res1 = _mm_testnzc_si128(a, b);
a.m128i_u64[0] = 0x000000000000001;
int res2 = _mm_testnzc_si128(a, b);
printf_s("First result should be 0: %d\nSecond result should be 1: %d\n",
res1, res2);
return 0;
}
and it gave me the following errors:
sse_test_not_zero.c||In function 'main':|
sse_test_not_zero.c|8|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|9|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|9|warning: integer constant is too large for 'long' type|
sse_test_not_zero.c|11|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|12|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|16|error: request for member 'm128i_u64' in something not a structure or union|
sse_test_not_zero.c|20|warning: implicit declaration of function 'printf_s'|
It seems to me that I need to create struct
for __m128i
although there might be a better solution to this problem if someone else knows of one.