_mm512_mask_permute4f128_epi32
Classification
KNC, Swizzle, CPUID Test: KNCNI
Header File
immintrin.h
Instruction
VPERMF32X4 zmm {k}, m512, imm8
Synopsis
 _mm512_mask_permute4f128_epi32(__m512i src, __mmask16 k, __m512i a, _MM_PERM_ENUM imm8);
Description
Permutes 128-bit blocks of the packed 32-bit integer vector "a" using constant "imm8". The results are stored in "dst" using writemask "k" (elements are copied from "src" when the corresponding mask bit is not set).
Operation
DEFINE SELECT4(src, control)  {
	CASE control[1:0] OF
	0: tmp[127:0] := src[127:0]
	1: tmp[127:0] := src[255:128]
	2: tmp[127:0] := src[383:256]
	3: tmp[127:0] := src[511:384]
	ESAC
	RETURN tmp[127:0]
}
tmp[511:0] := 0
FOR j := 0 to 3
	i := j*128
	n := j*2
	tmp[i+127:i] := SELECT4(a[511:0], imm8[n+1:n])
ENDFOR
FOR j := 0 to 15
	IF k[j]
		dst[i+31:i] := tmp[i+31:i]
	ELSE
		dst[i+31:i] := src[i+31:i]
	FI
ENDFOR
dst[MAX:512] := 0