_mm512_extpackstorelo_ps
Classification
KNC, Store, CPUID Test: KNCNI
Header File
immintrin.h
Instruction
VPACKSTORELPS m512, zmm
Synopsis
 _mm512_extpackstorelo_ps(void * mt, __m512 v1, _MM_DOWNCONV_PS_ENUM conv, int hint);
Description
Down-converts and stores packed single-precision (32-bit) floating-point elements of "v1" into a byte/word/doubleword stream according to "conv" at a logically mapped starting address "mt", storing the low-64-byte elements of that stream (those elements of the stream that map before the first 64-byte-aligned address follwing "mt"). "hint" indicates to the processor whether the data is non-temporal.
Operation
DEFINE DOWNCONVERT(element, convertTo) {
	CASE convertTo OF
	_MM_UPCONV_PS_NONE:
		RETURN element[31:0]
	_MM_UPCONV_PS_FLOAT16:
		RETURN Convert_FP32_To_FP16(element[31:0])
	_MM_UPCONV_PS_UINT8:
		RETURN Truncate8(element[31:0])
	_MM_UPCONV_PS_SINT8:
		RETURN Saturate8(element[31:0])
	_MM_UPCONV_PS_UINT16:
		RETURN Truncate16(element[31:0])
	_MM_UPCONV_PS_SINT16:
		RETURN Saturate16(element[31:0])
	ESAC
}
DEFINE DOWNCONVERTSIZE(convertTo) {
	CASE convertTo OF
	_MM_UPCONV_PS_NONE:
		RETURN 4
	_MM_UPCONV_PS_FLOAT16:
		RETURN 2
	_MM_UPCONV_PS_UINT8:
		RETURN 1
	_MM_UPCONV_PS_SINT8:
		RETURN 1
	_MM_UPCONV_PS_UINT16:
		RETURN 2
	_MM_UPCONV_PS_SINT16:
		RETURN 2
	ESAC
}
storeOffset := 0
downSize := DOWNCONVERTSIZE(conv)
addr := mt
FOR j := 0 to 15
	i := j*32
	tmp := DOWNCONVERT(v1[i+31:i], conv)
	storeAddr := addr + storeOffset * downSize
	CASE downSize OF
	4: MEM[storeAddr] := tmp[31:0]
	2: MEM[storeAddr] := tmp[15:0]
	1: MEM[storeAddr] := tmp[7:0]
	ESAC
	storeOffset := storeOffset + 1
	IF ((addr + storeOffset * downSize) % 64) == 0
		BREAK
	FI
ENDFOR
dst[MAX:512] := 0