_mm256_shuffle_epi8

Shuffles bytes in the first source vector according to the shuffle control mask in the second source vector. The corresponding Intel® AVX 2 instruction is VPSHUFB

Syntax

extern __m256i _mm256_shuffle_epi8(__m256i a, __m256i b);

Arguments

a

integer source vector

b

integer source vector

Description

Performs shuffle operations of the signed or unsigned 8-bit integers in the source vector as specified by the shuffle control mask in the second source operand.

Below is the pseudocode interpreting a, b, and r as arrays of unsigned 8-bit integers:

for (i = 0; i < 16; i++){ 
 if (b[i] & 0x80){  
  r[i] =  0; 
 } 
 else 
 {
  r[i] = a[b[i] & 0x0F]; 
 }
}	

Returns

Result of the shuffle operation.


Submit feedback on this help topic

Copyright © 1996-2011, Intel Corporation. All rights reserved.