Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
71 Views

about _mm_shuffle_epi8 ??

Jump to solution
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.


0 Kudos

Accepted Solutions
Highlighted
New Contributor I
71 Views
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.


View solution in original post

0 Kudos
1 Reply
Highlighted
New Contributor I
72 Views
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.


View solution in original post

0 Kudos