Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 7/13/2023
Public
Document Table of Contents

Intrinsics for FP Comparison Operations

The prototypes for Intel® Advanced Vector Extensions 512 (Intel® AVX-512) intrinsics are located in the zmmintrin.h header file.

To use these intrinsics, include the immintrin.h file as follows:

#include <immintrin.h>


Intrinsic Name

Operation

Corresponding
Intel® AVX-512 Instruction

_mm512_cmp_round_pd_mask, _mm512_mask_cmp_round_pd_mask

_mm512_cmp_pd_mask, _mm512_mask_cmp_pd_mask, _mm512_cmp_round_pd_mask, _mm512_mask_cmp_round_pd_mask, _mm512_cmpeq_pd_mask, _mm512_mask_cmpeq_pd_mask, _mm512_cmple_pd_mask, _mm512_mask_cmple_pd_mask, _mm512_cmplt_pd_mask, _mm512_mask_cmplt_pd_mask, _mm512_cmpneq_pd_mask, _mm512_cmplt_pd_mask, _mm512_cmpneq_pd_mask, _mm512_mask_cmpneq_pd_mask, _mm512_cmpnle_pd_mask, _mm512_mask_cmpnle_pd_mask, _mm512_cmpnlt_pd_mask, _mm512_mask_cmpnlt_pd_mask, _mm512_cmpord_pd_mask, _mm512_mask_cmpord_pd_mask, _mm512_cmpunord_pd_mask, _mm512_mask_cmpunord_pd_mask

Compares float64 vector elements based on comparison operand.

VCMPPD

_mm512_cmp_round_ps_mask, _mm512_mask_cmp_round_ps_mask

_mm512_cmp_ps_mask, _mm512_mask_cmp_ps_mask, _mm512_cmp_round_ps_mask, _mm512_mask_cmp_round_ps_mask, _mm512_cmpeq_ps_mask, _mm512_mask_cmpeq_ps_mask, _mm512_cmple_ps_mask, _mm512_mask_cmple_ps_mask, _mm512_cmplt_ps_mask, _mm512_mask_cmplt_ps_mask, _mm512_cmpneq_ps_mask, _mm512_mask_cmpneq_ps_mask, _mm512_cmpnle_ps_mask, _mm512_mask_cmpnle_ps_mask, _mm512_cmpnlt_ps_mask, _mm512_mask_cmpnlt_ps_mask, _mm512_cmpord_ps_mask, _mm512_mask_cmpord_ps_mask, _mm512_cmpunord_ps_mask, _mm512_mask_cmpunord_ps_mask

Compares float32 vector elements based on comparison operand.

VCMPPS

_mm_cmp_sd_mask, _mm_mask_cmp_sd_mask, _mm_cmp_round_sd_mask, _mm_mask_cmp_sd_mask

Compares lower float64 vector elements based on comparison operand.

VCMPSD

_mm_cmp_ss_mask, _mm_mask_cmp_ss_mask, _mm_cmp_round_ss_mask, _mm_mask_cmp_ss_mask

Compares lower float32 vector elements based on comparison operand.

VCMPSS


variable definition
k

writemask used as a selector

a

first source vector element

b

second source vector element

src

source element to use based on writemask result

round

Rounding control values; these can be one of the following (along with the sae suppress all exceptions flag):

  • _MM_FROUND_TO_NEAREST_INT - rounds to nearest even
  • _MM_FROUND_TO_NEG_INF - rounds to negative infinity
  • _MM_FROUND_TO_POS_INF - rounds to positive infinity
  • _MM_FROUND_TO_ZERO - rounds to zero
  • _MM_FROUND_CUR_DIRECTION - rounds using default from MXCSR register
imm

comparison predicate, which can be any 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


_mm512_cmp_pd_mask

extern __mmask8 __cdecl _mm512_cmp_pd_mask(__m512d a, __m512d b, const int imm);

Compares float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.



_mm512_cmp_round_pd_mask

extern __mmask8 __cdecl _mm512_cmp_round_pd_mask(__m512d a, __m512d b, const int imm, const int round);

Compares float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm512_mask_cmp_round_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmp_round_pd_mask(__mmask8 k, __m512d a, __m512d b, const int imm, const int round);

Compares float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm512_mask_cmp_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmp_pd_mask(__mmask8 k, __m512d a, __m512d b, const int imm);

Compares float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpeq_pd_mask

extern __mmask8 __cdecl _mm512_cmp_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for equality.

The result is stored in mask vector.



_mm512_mask_cmpeq_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpeq_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for equality.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_pd_mask

extern __mmask8 __cdecl _mm512_cmple_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for less-than-or-equal.

The result is stored in mask vector.



_mm512_mask_cmple_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmple_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for less-than-or-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_pd_mask

extern __mmask8 __cdecl _mm512_cmplt_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for less-than.

The result is stored in mask vector.



_mm512_mask_cmplt_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmplt_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for less-than.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_pd_mask

extern __mmask8 __cdecl _mm512_cmpneq_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for not-equal.

The result is stored in mask vector.



_mm512_mask_cmpneq_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpneq_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for not-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpnle_pd_mask

extern __mmask8 __cdecl _mm512_cmpnle_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for not-less-than-or-equal.

The result is stored in mask vector.



_mm512_mask_cmpnle_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpnle_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for not-less-than-or-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpnlt_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpnlt_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b for not-less-than.

The result is stored in mask vector.



_mm512_mask_cmpnlt_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpnlt_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b for not-less-than.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpord_pd_mask

extern __mmask8 __cdecl _mm512_cmpord_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b to see if neither is NaN.

The result is stored in mask vector.



_mm512_mask_cmpord_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpord_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b to see if neither is NaN.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpunord_pd_mask

extern __mmask8 __cdecl _mm512_cmpunord_pd_mask(__m512d a, __m512d b);

Compares float64 elements in a and b to see if either is NaN.

The result is stored in mask vector.



_mm512_mask_cmpord_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpord_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b to see if neither is NaN.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_mask_cmpunord_pd_mask

extern __mmask8 __cdecl _mm512_mask_cmpord_pd_mask(__mmask8 k, __m512d a, __m512d b);

Compares float64 elements in a and b to see if either is NaN.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmp_ps_mask

extern __mmask16 __cdecl _mm512_cmp_ps_mask(__m512 a, __m512 b, const int imm);

Compares float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.



_mm512_mask_cmp_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmp_ps_mask(__mmask16 k, __m512 a, __m512 b, const int imm);

Compares float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmp_round_ps_mask

extern __mmask16 __cdecl _mm512_cmp_round_ps_mask(__m512 a, __m512 b, const int imm, const int round);

Compares float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm512_mask_cmp_round_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmp_round_ps_mask(__mmask16 k, __m512 a, __m512 b, const int imm, const int round);

Compares float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm512_cmpeq_ps_mask

extern __mmask16 __cdecl _mm512_cmpeq_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for equality.

The result is stored in mask vector.



_mm512_mask_cmpeq_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpeq_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b for equality.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_ps_mask

extern __mmask16 __cdecl _mm512_cmple_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for less-than-or-equal.

The result is stored in mask vector.



_mm512_mask_cmple_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmple_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b for less-than-or-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpunord_ps_mask

extern __mmask16 __cdecl _mm512_cmpunord_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b to see if either is NaN.

The result is stored in mask vector.



_mm512_mask_cmpunord_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpunord_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b to see if neither is NaN.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_ps_mask

extern __mmask16 __cdecl _mm512_cmplt_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for less-than.

The result is stored in mask vector.



_mm512_mask_cmplt_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmplt_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b for less-than.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_ps_mask

extern __mmask16 __cdecl _mm512_cmpneq_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for not-equal.

The result is stored in mask vector.



_mm512_mask_cmpneq_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpneq_ps_mask(__mmask16 k, __m512 a, __m512 b, const int round);

Compares float32 elements in a and b for not-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpnle_ps_mask

extern __mmask16 __cdecl _mm512_cmpnle_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for not-less-than-or-equal.

The result is stored in mask vector.



_mm512_mask_cmpnle_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpnle_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b for not-less-than-or-equal.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpnlt_ps_mask

extern __mmask16 __cdecl _mm512_cmpnlt_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b for not-less-than.

The result is stored in mask vector.



_mm512_mask_cmpnlt_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpnlt_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b for not-less-than.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpord_ps_mask

extern __mmask16 __cdecl _mm512_cmpord_ps_mask(__m512 a, __m512 b);

Compares float32 elements in a and b to see if either is NaN.

The result is stored in mask vector.



_mm512_mask_cmpord_ps_mask

extern __mmask16 __cdecl _mm512_mask_cmpord_ps_mask(__mmask16 k, __m512 a, __m512 b);

Compares float32 elements in a and b to see if either is NaN.

The result is stored in mask vector using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm_cmp_round_sd_mask

extern __mmask8 __cdecl _mm_cmp_round_sd_mask(__m128d a, __m128d b, const int imm, const round);

Compares lower float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm_mask_cmp_round_sd_mask

extern __mmask8 __cdecl _mm_mask_cmp_round_sd_mask(__mmask8 k, __m128d a, __m128d b, const int imm, const int round);

Compares lower float64 elements in a and b based on the comparison operand specified by imm, and store the result in mask vector k using zeromask k (the element is zeroed out when mask bit 0 is not set).

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm_cmp_sd_mask

extern __mmask8 __cdecl _mm_cmp_sd_mask(__m128d a, __m128d b, const int imm);

Compares lower float64 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.



_mm_mask_cmp_sd_mask

extern __mmask8 __cdecl _mm_mask_cmp_sd_mask(__mmask8 k, __m128d a, __m128d b, const int imm);

Compares lower float64 elements in a and b based on the comparison operand specified by imm

The result is stored in mask vector using zeromask k (the element is zeroed out when mask bit 0 is not set).



_mm_cmp_round_ss_mask

extern __mmask8 __cdecl _mm_cmp_round_ss_mask(__m128 a, __m128 b, const int imm, const int round);

Compares lower float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm_mask_cmp_round_ss_mask

extern __mmask8 __cdecl _mm_mask_cmp_round_ss_mask(__mmask8 k, __m128 a, __m128 b, const int imm, const int round);

Compares lower float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (the element is zeroed out when mask bit 0 is not set).

NOTE:

Pass __MM_FROUND_NO_EXC to round to suppress all exceptions.



_mm_cmp_ss_mask

extern __mmask8 __cdecl _mm_cmp_ss_mask(__m128 a, __m128 b, const int imm);

Compares lower float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector.



_mm_mask_cmp_ss_mask

extern __mmask8 __cdecl _mm_mask_cmp_ss_mask(__mmask8 k, __m128 a, __m128 b, const int imm);

Compares lower float32 elements in a and b based on the comparison operand specified by imm.

The result is stored in mask vector using zeromask k (the element is zeroed out when mask bit 0 is not set).