Intel® C++ Compiler 16.0 User and Reference Guide

_mm512_cmp_ps_mask/ _mm512_mask_cmp_ps_mask

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

Syntax

Without Mask

extern __mmask16 __cdecl _mm512_cmp_ps_mask(__m512 v2, __m512 v3, const int op);

With Mask

extern __mmask16 __cdecl _mm512_mask_cmp_ps_mask(__mmask16 k1, __m512 v2, __m512 v3, const int op);

Parameters

v2

float32 vector used for the compare operation

v3

float32 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 float32 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_ps_mask(v2, v3)

_CMP_EQ_OQ

_mm512_mask_cmpeq_ps_mask(k1, v2, v3)

_CMP_EQ_OQ

_mm512_cmplt_ps_mask(v2, v3)

_CMP_LT_OS

_mm512_mask_cmplt_ps_mask(k1, v2, v3)

_CMP_LT_OS

_mm512_cmple_ps_mask(v2, v3)

_CMP_LE_OS

_mm512_mask_cmple_ps_mask(k1, v2, v3)

_CMP_LE_OS

_mm512_cmpunord_ps_mask(v2, v3)

_CMP_UNORD_Q

_mm512_mask_cmpunord_ps_mask(k1, v2, v3)

_CMP_UNORD_Q

_mm512_cmpneq_ps_mask(v2, v3)

_CMP_NEQ_UQ

_mm512_mask_cmpneq_ps_mask(k1, v2, v3)

_CMP_NEQ_UQ

_mm512_cmpnlt_ps_mask(v2, v3)

_CMP_NLT_US

_mm512_mask_cmpnlt_ps_mask(k1, v2, v3)

_CMP_NLT_US

_mm512_cmpnle_ps_mask(v2, v3)

_CMP_NLE_US

_mm512_mask_cmpnle_ps_mask(k1, v2, v3)

_CMP_NLE_US

_mm512_cmpord_ps_mask(v2, v3)

_CMP_ORD_Q

_mm512_mask_cmpord_ps_mask(k1, v2, v3)

_CMP_ORD_Q

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 one if and only if (v2[i] 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.