_mm512_mask_reduce_mul_pd
Classification
KNC, Arithmetic, CPUID Test: KNCNI
Header File
immintrin.h
Synopsis
 _mm512_mask_reduce_mul_pd(__mmask8 k, __m512d a);
Description
Reduce the packed double-precision (64-bit) floating-point elements in "a" by multiplication using mask "k". Returns the product of all active elements in "a".
Operation
DEFINE REDUCE_MUL(src, len) {
	IF len == 2
		RETURN src[63:0] * src[127:64]
	FI
	len := len / 2
	FOR j:= 0 to (len-1)
		i := j*64
		src[i+63:i] := src[i+63:i] * src[i+64*len+63:i+64*len]
	ENDFOR
	RETURN REDUCE_MUL(src[64*len-1:0], len)
}
tmp := a
FOR j := 0 to 8
	i := j*64
	IF k[j]
		tmp[i+63:i] := a[i+63:i]
	ELSE
		tmp[i+63:i] := 1.0
	FI
ENDFOR
dst[63:0] := REDUCE_MUL(tmp, 8)