Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

_mm_mask_i64gather_ps, _mm256_mask_i64gather_ps

Gathers 2/4 packed single-precision floating point values from memory referenced by the given base address, qword indices and scale, and using the given single-precision FP mask values. The corresponding Intel® AVX2 instruction is VGATHERQPS.

Syntax

extern __m128 _mm_mask_i64gather_ps(__m128 def_vals, float const * base, __m128i vindex, __m128 vmask, const int scale);

extern __m128 _mm256_mask_i64gather_ps(float const * base, __m256i vindex, __m256i vmask, const int scale);

Arguments

def_vals

the vector of single-precision FP values copied to the destination when the corresponding element of the single-precision FP mask is '0'.

base

the base address used to reference the loaded FP elements.

vindex

the vector of qword indices used to reference the loaded FP elements.

vmask

the vector of FP elements used as a vector mask; only the most significant bit of each data element is used as a mask.

scale

The compilation time literal constant, which is used as the vector indices scale to address the loaded elements. Possible values are one of the following: 1, 2, 4, 8.

Description

The intrinsics conditionally load 2/4 packed single-precision floating-point values from memory using qword indices and updates the destination operand. The intrinsic _mm_mask_i64gather_ps() also sets the upper 64-bits of the result to '0'.

Below is the pseudo-code for the intrinsics:

_mm_mask_i64gather_ps():

result[31:0] = (vmask[31]==1) ? (mem[base+vindex[63:0]*scale]) : (def_vals[31:0]);
result[63:32] = (vmask[63]==1) ? (mem[base+vindex[127:64]*scale]) : (def_vals[63:32]);
result[127:64] = 0;

_mm256_mask_i64gather_ps():

result[31:0] = (vmask[31]==1) ? (mem[base+vindex[63:0]*scale]) : (def_vals[31:0]);
result[63:32] = (vmask[63]==1) ? (mem[base+vindex[127:64]*scale]) : (def_vals[63:32]);
result[95:64] = (vmask[95]==1) ? (mem[base+vindex[191:128]*scale]) : (def_vals[95:64]);
result[127:96] = (vmask[127]==1) ? (mem[base+vindex[255:192]*scale]) : (def_vals[127:96]);

Returns

A 256/128-bit vector with conditionally gathered single-precision FP values.