Intel® ISA Extensions
Use hardware-based isolation and memory encryption to provide more code protection in your solutions.

Is the guide of Gather/Scatter of AVX512 wrong?

He__Jiayuan
Beginner
879 Views

I found the following from 

https://software.intel.com/en-us/node/523826

 

_mm512_i32scatter_epi32

extern void __cdecl _mm512_i32scatter_epi32(void* base_addr, __m512i a, __m512i vindex, _MM_DOWNCONV_EPI32_ENUM downconv, int scale, int hint);

Scatters int32 from a into memory using 32-bit indices. 32-bit elements are stored at addresses starting at base_addrand offset by each 32-bit element in vindex (each index is scaled by the factor in scale).

 

When I tried _mm512_i32scatter_epi32(dst_ptr, Vdata, Vindex, _MM_DOWNCONV_EPI32_NONE, 4, 1);  

The compilation reports error saying too many argument.

Then I found another manual from

http://hpc.ipp.ac.cn/wp-content/uploads/2015/12/documentation_2016/en/compiler_c/common/core/GUID-8ADD038C-25BD-4A37-A089-E7DD9F1E4E01.htm

extern void __cdecl _mm512_i32scatter_epi32(void* mv, __m512i index, __m512i v1, int scale);

And this works. It doesn't only have different number of argument but the order of two __m512i vector is reversed.

I'm using ICC 17.0.4.

I'm wondering what is wrong with the gather/scatter intrinsics here?

0 Kudos
2 Replies
McCalpinJohn
Honored Contributor III
879 Views

I recommend that you use the official version of the Intrinsics Guide.

Web pages at the Intel web site move from time to time, but the Intrinsics Guide is available as a link from the ISA Extensions web page: https://software.intel.com/en-us/isa-extensions

Right now the direct address for the Intrinsics Guide is https://software.intel.com/sites/landingpage/IntrinsicsGuide/

 

0 Kudos
He__Jiayuan
Beginner
879 Views

I also tried to use 

void _mm512_i32extscatter_epi32 (void * mv__m512i index__m512i v1_MM_DOWNCONV_EPI32_ENUM convint scaleint hint)

and I wrote 

_mm512_i32extscatter_epi32(output, Vindex, Vinput, _MM_DOWNCONV_EPI32_NONE, 4, 1);

The compiler reports 

catastrophic error: Illegal value of immediate argument to intrinsic

If I change the _MM_DOWNCONV_EPI32_NONE to _MM_DOWNCONV_EPI32_UINT8, the error becomes 

catastrophic error: Invalid downconversion argument to intrinsic.

What is the proper way to use this extscatter intrinsics? How to fix it?

0 Kudos
Reply