Rate This Document
Findability
Accuracy
Completeness
Readability

Replacing the _mm_shuffle_epi8 Function

This function is used to shift data based on the shuffle_mask binary mask and store the shifted data in the results variable.

For details about _mm_shuffle_epi8, see Intrinsics Guide.

  • Code on x86:
    __m128i results = _mm_shuffle_epi8(data, shuffle_mask);
  • Alternative for Kunpeng processors:
    #include <arm_neon.h>
    #define int8x16_to_8x8x2(v) ((int8x8x2_t) { vget_low_s8(v), vget_high_s8(v) }) 
    int8x16_t results = vcombine_s8(vtbl2_s8(int8x16_to_8x8x2(data),vget_low_s8(shuffle_mask)),vtbl2_s8(int8x16_to_8x8x2(data),vget_high_s8(shuffle_mask)));