_mm256_mask2_permutex2var_epi8
Classification
AVX-512, Swizzle, CPUID Test: AVX512_VBMI
Header File
immintrin.h
Instruction
VPERMI2B ymm {k}, ymm, ymm
Synopsis
 _mm256_mask2_permutex2var_epi8(__m256i a, __m256i idx, __mmask32 k, __m256i b);
Description
Shuffle 8-bit integers in "a" and "b" across lanes using the corresponding selector and index in "idx", and store the results in "dst" using writemask "k" (elements are copied from "a" when the corresponding mask bit is not set).
Operation
FOR j := 0 to 31
	i := j*8
	IF k[j]
		off := 8*idx[i+4:i]
		dst[i+7:i] := idx[i+5] ? b[off+7:off] : a[off+7:off]
	ELSE
		dst[i+7:i] := idx[i+7:i]
	FI
ENDFOR
dst[MAX:256] := 0