_mm512_maskz_roundscale_round_pd
Classification
AVX-512, Miscellaneous, CPUID Test: AVX512F
Header File
Instruction
VRNDSCALEPD zmm {z}, zmm, imm8 {sae}
Synopsis
_mm512_maskz_roundscale_round_pd(__mmask8 k, __m512d a, int imm8, int sae);
Description
Round packed double-precision (64-bit) floating-point elements in "a" to the number of fraction bits specified by "imm8", and store the results in "dst" using zeromask "k" (elements are zeroed out when the corresponding mask bit is not set). [round_imm_note][sae_note]
Operation
DEFINE RoundScaleFP64(src1[63:0], imm8[7:0]) {
m[63:0] := FP64(imm8[7:4]) // number of fraction bits after the binary point to be preserved
tmp[63:0] := POW(2.0, -m) * ROUND(POW(2.0, m) * src1[63:0], imm8[3:0])
IF IsInf(tmp[63:0])
tmp[63:0] := src1[63:0]
FI
RETURN tmp[63:0]
}
FOR j := 0 to 7
i := j*64
IF k[j]
dst[i+63:i] := RoundScaleFP64(a[i+63:i], imm8[7:0])
ELSE
dst[i+63:i] := 0
FI
ENDFOR
dst[MAX:512] := 0