Hi.
I am asked to use following four X86 intrinsics to code split function.
__m128i _mm_blendv_epi8 (__m128i a, __m128i b, __m128i mask)
__m128i _mm_shuffle_epi8 (__m128i a, __m128i b)
__m128i _mm_load_si128 (__m128i const* mem_addr)
void _mm_store_si128 (__m128i* mem_addr, __m128i a)
Given array is Arr[] = {1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3}.
I need to split this array into three arrays.
a[] = {1,1,1,1,1,1,1,1,1}
b[] = {2,2,2,2,2,2,2,2,2}
c[] = {3,3,3,3,3,3,3,3,3}
I have no experience of Intel SSE intrinsics..I only have C programming experience..
Please help me to solve this problem.
Thanks.
What I have tried:
In C, I would do like this...
for(int i = 0; i <size ; i++)
{
a[i] = arr[i*3+0];
b[i] = arr[i*3+1];
c[i] = arr[i*3+2];
}