_mm256_mask_scalef_ph
Classification
AVX-512, Miscellaneous, CPUID Test: AVX512_FP16
Header File
immintrin.h
Instruction
VSCALEFPH ymm {k}, ymm, ymm
Synopsis
 _mm256_mask_scalef_ph(__m256h src, __mmask16 k, __m256h a, __m256h b);
Description
Scale the packed half-precision (16-bit) floating-point elements in "a" using values from "b", and store the results in "dst" using writemask "k" (elements are copied from "src" when the corresponding mask bit is not set).
Operation
DEFINE ScaleFP16(src1, src2) {
	denormal1 := (a.exp == 0) and (a.fraction != 0)
	denormal2 := (b.exp == 0) and (b.fraction != 0)
	tmp1 := src1
	tmp2 := src2
	IF MXCSR.DAZ
		IF denormal1
			tmp1 := 0
		FI
		IF denormal2
			tmp2 := 0
		FI
	FI
	RETURN tmp1 * POW(2.0, FLOOR(tmp2))
}
FOR i := 0 to 15
	IF k[i]
		dst.fp16[i] := ScaleFP16(a.fp16[i], b.fp16[i])
	ELSE
		dst.fp16[i] := src.fp16[i]
	FI
ENDFOR
dst[MAX:256] := 0