Hi everyone I'm trying to use the intel intrinsics like so
void test()
{
uint16_t n1 = 5;
uint16_t n2 = 2;
__m64 vec1, vec2, res;
vec1 = _mm_set_pi16(n1, n1, n1, n1);
vec2 = _mm_set_pi16(n2, n2, n2, n2);
res = _mm_add_pi16(vec1, vec2);
printf("%u %u %u %u \n", vec1[0], vec1[1], vec1[2], vec1[3]);
printf("%u %u %u %u \n", vec2[0], vec2[1], vec2[2], vec2[3]);
printf("%u %u %u %u \n", res[0], res[1], res[2], res[3]);
}
but the weird thing that I'm getting this results :
327685 327685 131074 131074
131074 131074 458759 458759
458759 458759 327685 327685
I'm using eclipse Mars... and I'm including the mmintrin.h, xmmintrin.h, emmintrin.h.
Please can someone explain what's wrong with this
__m128i
SSE vectors in new code, not 64 bit MMX. SSE2 support is pretty safe to assume as a baseline even in 32-bit code, and is guaranteed for x86-64. – Peter Cordes