_mm256_mask_reduce_pd
Classification
AVX-512, Miscellaneous, CPUID Test: AVX512DQ
Header File
immintrin.h
Instruction
VREDUCEPD ymm {k}, ymm, imm8
Synopsis
 _mm256_mask_reduce_pd(__m256d src, __mmask8 k, __m256d a, int imm8);
Description
Extract the reduced argument of packed double-precision (64-bit) floating-point elements in "a" by the number of bits specified by "imm8", and store the results in "dst" using writemask "k" (elements are copied from "src" when the corresponding mask bit is not set). [round_imm_note]
Operation
DEFINE ReduceArgumentPD(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])
	tmp[63:0] := src1[63:0] - tmp[63:0]
	IF IsInf(tmp[63:0])
		tmp[63:0] := FP64(0.0)
	FI
	RETURN tmp[63:0]
}
FOR j := 0 to 3
	i := j*64
	IF k[j]
		dst[i+63:i] := ReduceArgumentPD(a[i+63:i], imm8[7:0])
	ELSE
		dst[i+63:i] := src[i+63:i]
	FI
ENDFOR
dst[MAX:256] := 0