_mm_maskz_scalef_ph
Classification
AVX-512, Miscellaneous, CPUID Test: AVX512_FP16
Header File
immintrin.h
Instruction
VSCALEFPH xmm {z}, xmm, xmm
Synopsis
 _mm_maskz_scalef_ph(__mmask8 k, __m128h a, __m128h 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 zeromask "k" (elements are zeroed out 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 7
	IF k[i]
		dst.fp16[i] := ScaleFP16(a.fp16[i], b.fp16[i])
	ELSE
		dst.fp16[i] := 0
	FI
ENDFOR
dst[MAX:128] := 0