Intel® C++ Compiler 16.0 User and Reference Guide
Gathers 2/4 doubleword values from memory referenced by the given base address, dword indices, and scale. The corresponding Intel® AVX2 instruction is VPGATHERDD.
extern __m128i _mm_i32gather_epi32(int const * base, __m128i vindex, const int scale); |
extern __m256i _mm256_i32gather_epi32(int const * base, __m256i vindex, const int scale); |
base |
the base address used to reference the loaded dword elements. |
vindex |
the vector of dword indices used to reference the loaded dword elements. |
scale |
32-bit scale used to address the loaded dword elements; it is multiplied by the corresponding element from 'vindex'. |
The intrinsics load 2/4 doubleword values from memory using the base address, qword indices, and 32-bit scale.
Below is the pseudo-code for the intrinsics:
_mm_i32gather_epi32():
result[31:0] = mem[base+vindex[31:0]*scale]; result[63:32] = mem[base+vindex[63:32]*scale]; result[95:64] = mem[base+vindex[95:64]*scale]; result127:96] = mem[base+vindex[127:96]*scale];
_mm256_i32gather_epi32():
result[31:0] = mem[base+vindex[31:0]*scale]; result[63:32] = mem[base+vindex[63:32]*scale]; result[95:64] = mem[base+vindex[95:64]*scale]; result127:96] = mem[base+vindex[127:96]*scale]; result[159:128] = mem[base+vindex[159:128]*scale]; result[191:160] = mem[base+vindex[191:160]*scale]; result[223:192] = mem[base+vindex[223:192]*scale]; result[255:224] = mem[base+vindex[255:224]*scale];
A 128/256-bit vector with unconditionally gathered integer32 values.