Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

about _mm_shuffle_epi8 ??

Gaiger_Chen
New Contributor I
984 Views
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
1 Solution
Gaiger_Chen
New Contributor I
984 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
Gaiger_Chen
New Contributor I
985 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.


0 Kudos
Reply