according to the reference here the following functions should be defined in "immintrin.h"
__m128i _mm_idiv_epi32 (__m128i a, __m128i b);
__m128i _mm_idivrem_epi32 (__m128i * mem_addr, __m128i a, __m128i b);
__m128i _mm_set_epi32 (int e3, int e2, int e1, int e0);
But according to my test program, they are not:
#include "immintrin.h"
int main() {
__m128i a = _mm_set_epi32(4,3,2,1);
__m128i b = _mm_set_epi32(1,2,3,4);
__m128i c = _mm_idiv_epi32(a,b);
__m128i d;
c = _mm_idivrem_epi32(&d, a, b);
}
This fails to compile with the following error message:
cc -g scratch.c && ./a.out
scratch.c: In function 'main':
scratch.c:11:15: warning: implicit declaration of function '_mm_idiv_epi32'; did you mean '_mm_rorv_epi32'? [-Wimplicit-function-declaration]
__m128i c = _mm_idiv_epi32(a,b);
^~~~~~~~~~~~~~
_mm_rorv_epi32
scratch.c:11:15: error: incompatible types when initializing type '__m128i {aka __vector(2) long long int}' using type 'int'
scratch.c:14:7: warning: implicit declaration of function '_mm_idivrem_epi32'; did you mean '_mm_movm_epi32'? [-Wimplicit-function-declaration]
c = _mm_idivrem_epi32(&d, a, b);
^~~~~~~~~~~~~~~~~
_mm_movm_epi32
scratch.c:14:5: error: incompatible types when assigning to type '__m128i {aka __vector(2) long long int}' from type 'int'
c = _mm_idivrem_epi32(&d, a, b);
Aparently the functions are not defined at all. So what is it then that I am doing wrong? Did I miss something?