about _mm_shuffle_epi8 ??

about _mm_shuffle_epi8 ??

Dear Everyone:

The _mm_shuffle_epi8, on msdn I do not know it means.
rn = (maskn & 0x80) ? 0 : SELECT(a, maskn & 0x0f)

SELECT(a, n) extracts the nth 8-bit parameter from a. The 0th 8-bit parameter is the least significant 8-bits.

I do not know what is the the SELECT(a, n)

the msdn exmaple, :

 a.m128i_i8[15] = -1;               ---> 1111 1111
mask.m128i_u8[15] = 0x00;   -> get  0th 8-bit


I do not know why the output is 1 ( 0000 0001).

similiar for

 a.m128i_i8[13] = -64;       ---> 1100 0000
mask.m128i_u8[13] = 0x02;  ->get 2th bit 

why the output is 4 ? (0000 0100) ??


thank you lots.
2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.
Best Reply

Dear all:

I have regonize the SELECT(a, n).

is is the the ith byte, but bit.

for example:

so the

 mask.m128i_u8[1] = 0x0E; -> select  Eth (14th) byte, it is 
a.m128i_i8[14] = -128;

 mask.m128i_u8[11] = 0x04; -> select the 4th byte, it is 
a.m128i_i8[4] = 16.

Faça login para deixar um comentário.