Intel® C++ Compiler 16.0 User and Reference Guide

_mm512_cmp_epi32_mask/ _mm512_mask_cmp_epi32_mask

Performs a comparison between int32 vectors. Corresponding instruction is VPCMPD. This intrinsic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture).

Syntax

Without Mask

extern __mmask16 __cdecl _mm512_cmp_epi32_mask(__m512i v2, __m512i v3, const int op);

With Mask

extern __mmask16 __cdecl _mm512_mask_cmp_epi32_mask(__mmask16 k1, __m512i v2, __m512i v3, const int op);

Parameters

v2

int32 vector used for the compare operation

v3

int32 vector used for the compare operation

k1

Writemask; only those elements of the source vectors with corresponding bit set to '1' in the k1 mask are computed and stored in the result

op

Comparison predicate. Takes one of the following values:

  • _MM_CMPINT_EQ - Equal
  • _MM_CMPINT_LT - Less than
  • _MM_CMPINT_LE - Less than or Equal
  • _MM_CMPINT_NE - Not Equal
  • _MM_CMPINT_NLT - Not Less than
  • _MM_CMPINT_GE - Greater than or Equal
  • _MM_CMPINT_NLE - Not Less than or Equal
  • _MM_CMPINT_GT - Greater than

Description

This intrinsic performs an element-by-element comparison between int32 vectors v2 and v3, using the op parameter as a comparison predicate.

For the sake of convenience, the compiler provides the following intrinsics that correspond to the values of the op parameter. You can use these intrinsic names instead of specifying the op parameter.

Intrinsic Name

Corresponding Comparison Predicate

_mm512_cmpeq_epi32_mask(v2, v3)

_MM_CMPINT_EQ

_mm512_mask_cmpeq_epi32_mask(k1, v2, v3)

_MM_CMPINT_EQ

_mm512_cmplt_epi32_mask(v2, v3)

_MM_CMPINT_LT

_mm512_mask_cmplt_epi32_mask(k1, v2, v3)

_MM_CMPINT_LT

_mm512_cmple_epi32_mask(v2, v3)

_MM_CMPINT_LE

_mm512_mask_cmple_epi32_mask(k1, v2, v3)

_MM_CMPINT_LE

_mm512_cmpneq_epi32_mask(v2, v3)

_MM_CMPINT_NE

_mm512_mask_cmpneq_epi32_mask(k1, v2, v3)

_MM_CMPINT_NE

_mm512_cmpgt_epi32_mask(v2, v3)

_MM_CMPINT_GT

_mm512_mask_cmpgt_epi32_mask(k1, v2, v3)

_MM_CMPINT_GT

_mm512_cmpge_epi32_mask(v2, v3)

_MM_CMPINT_GE

_mm512_mask_cmpge_epi32_mask(k1, v2, v3)

_MM_CMPINT_GE

Returns

Returns the result of the comparison in bit eight of the return value, where there is one bit per pair of elements. The ith bit is set to '1' if and only if (v2[i] cmp_op v3[i]) is true.

In the masked variant, for those elements with a corresponding mask bit set to zero, the return value in the corresponding bit of the result mask is zero.