Intel® C++ Compiler Classic Developer Guide and Reference

ID 767249
Date 12/16/2022
Public

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

Document Table of Contents

Intrinsics for Integer 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_epi32_mask

_mm512_cmpeq_epi32_mask, _mm512_cmpge_epi32_mask, _mm512_cmpgt_epi32_mask, _mm512_cmple_epi32_mask, _mm512_cmplt_epi32_mask, _mm512_cmpneq_epi32_mask, _mm512_mask_cmp_epi32_mask, _mm512_mask_cmpeq_epi32_mask, _mm512_mask_cmpge_epi32_mask, _mm512_mask_cmpgt_epi32_mask, _mm512_mask_cmple_epi32_mask, _mm512_mask_cmplt_epi32_mask, _mm512_mask_cmpneq_epi32_mask

Compare signed int32 elements based on the comparison operand.

VPCMPD

_mm512_cmp_epi64_mask, _mm512_mask_cmp_epi64_mask

_mm512_cmpeq_epi64_mask, _mm512_cmpge_epi64_mask, _mm512_cmpgt_epi64_mask, _mm512_cmple_epi64_mask, _mm512_cmplt_epi64_mask, _mm512_cmpneq_epi64_mask, _mm512_mask_cmp_epi64_mask, _mm512_mask_cmpeq_epi64_mask, _mm512_mask_cmpge_epi64_mask, _mm512_mask_cmpgt_epi64_mask, _mm512_mask_cmple_epi64_mask, _mm512_mask_cmplt_epi64_mask, _mm512_mask_cmpneq_epi64_mask

Compare signed int64 elements based on the comparison operand.

VPCMPQ

_mm512_cmp_epu32_mask

_mm512_cmpeq_epu32_mask, _mm512_cmpge_epu32_mask, _mm512_cmpgt_epu32_mask, _mm512_cmple_epu32_mask, _mm512_cmplt_epu32_mask, _mm512_cmpneq_epu32_mask, _mm512_mask_cmp_epu32_mask, _mm512_mask_cmpeq_epu32_mask, _mm512_mask_cmpge_epu32_mask, _mm512_mask_cmpgt_epu32_mask, _mm512_mask_cmple_epu32_mask, _mm512_mask_cmplt_epu32_mask, _mm512_mask_cmpneq_epu32_mask

Compare unsigned int32 elements based on the comparison operand.

VPCMPUD

_mm512_cmp_epu64_mask, _mm512_mask_cmp_epu64_mask

_mm512_cmpeq_epu64_mask, _mm512_cmpge_epu64_mask, _mm512_cmpgt_epu64_mask, _mm512_cmple_epu64_mask, _mm512_cmplt_epu64_mask, _mm512_cmpneq_epu64_mask, _mm512_mask_cmp_epu64_mask, _mm512_mask_cmpeq_epu64_mask, _mm512_mask_cmpge_epu64_mask, _mm512_mask_cmpgt_epu64_mask, _mm512_mask_cmple_epu64_mask, _mm512_mask_cmplt_epu64_mask, _mm512_mask_cmpneq_epu64_mask

Compare unsigned int64 elements based on the comparison operand.

VPCMPUQ


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

imm

comparison operand

src

source element


_mm_comi_round_sd

extern int __cdecl _mm_comi_round_sd(__m128d a, __m128d b, const int imm, const int sae);

Compare the lower double-precision (64-bit) floating-point element in a and b based on the comparison operand specified by imm, and return the boolean result (0 or 1).

NOTE:

Pass __MM_FROUND_NO_EXC to sae to suppress all exceptions.



_mm_comi_round_ss

extern int __cdecl _mm_comi_round_ss(__m128 a, __m128 b, const int imm, const int sae);

Compare the lower single-precision (32-bit) floating-point element in a and b based on the comparison operand specified by imm, and return the boolean result (0 or 1).

NOTE:

Pass __MM_FROUND_NO_EXC to sae to suppress all exceptions.



_mm512_cmp_epi32_mask

extern __mmask16 __cdecl _mm512_cmp_epi32_mask(__m512i a, __m512i b, const int imm);

Compare packed int32 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k.



_mm512_mask_cmp_epi32_mask

extern __mmask16 __cdecl _mm512_mask_cmp_epi32_mask(__mmask16 k, __m512i a, __m512i b, const int imm);

Compare packed int32 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpeq_epi32_mask

extern __mmask16 __cdecl _mm512_cmpeq_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for equality, and store the results in mask vector k.



_mm512_mask_cmpeq_epi32_mask

  extern __mmask16 __cdecl  _mm512_mask_cmpeq_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for equality, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpge_epi32_mask

extern __mmask16 __cdecl  _mm512_cmpge_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for greater-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmpge_epi32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpge_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpgt_epi32_mask

extern __mmask16 __cdecl  _mm512_cmpgt_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for greater-than, and store the results in mask vector k.



_mm512_mask_cmpgt_epi32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpgt_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for greater-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_epi32_mask

extern __mmask16 __cdecl  _mm512_cmple_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for less-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmple_epi32_mask

extern __mmask16 __cdecl  _mm512_mask_cmple_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for less-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_epi32_mask

extern __mmask16 __cdecl  _mm512_cmplt_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for less-than, and store the results in mask vector k.



_mm512_mask_cmplt_epi32_mask

extern __mmask16 __cdecl  _mm512_mask_cmplt_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_epi32_mask

extern __mmask16 __cdecl  _mm512_cmpneq_epi32_mask(__m512i a, __m512i b);

Compare packed int32 elements in a and b for not-equal, and store the results in mask vector k.



_mm512_mask_cmpneq_epi32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpneq_epi32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed int32 elements in a and b for not-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmp_epi64_mask

extern __mmask8 __cdecl _mm512_cmp_epi64_mask(__m512i a, __m512i b, const int imm);

Compare packed int64 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k.



_mm512_mask_cmp_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmp_epi64_mask(__mmask8 k, __m512i a, __m512i b, const int imm);

Compare packed int64 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpeq_epi64_mask

extern __mmask8 __cdecl _mm512_cmpeq_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for equality, and store the results in mask vector k.



_mm512_mask_cmpeq_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmpeq_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for equality, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpge_epi64_mask

extern __mmask8 __cdecl _mm512_cmpge_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for greater-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmpge_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmpge_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpgt_epi64_mask

extern __mmask8 __cdecl _mm512_cmpgt_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for greater-than, and store the results in mask vector k.



_mm512_mask_cmpgt_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmpgt_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for greater-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_epi64_mask

extern __mmask8 __cdecl _mm512_cmple_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for less-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmple_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmple_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_epi64_mask

extern __mmask8 __cdecl _mm512_cmplt_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for less-than, and store the results in mask vector k.



_mm512_mask_cmplt_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmplt_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for less-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_epi64_mask

extern __mmask8 __cdecl _mm512_cmpneq_epi64_mask(__m512i a, __m512i b);

Compare packed int64 elements in a and b for not-equal, and store the results in mask vector k.



_mm512_mask_cmpneq_epi64_mask

extern __mmask8 __cdecl _mm512_mask_cmpneq_epi64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed int64 elements in a and b for not-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmp_epu32_mask

extern __mmask16 __cdecl _mm512_cmp_epu32_mask(__m512i a, __m512i b, const int imm);

Compare packed unsigned int32 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k.



_mm512_mask_cmp_epu32_mask

extern __mmask16 __cdecl _mm512_mask_cmp_epu32_mask(__mmask16 k, __m512i a, __m512i b, const int imm);

Compare packed unsigned int32 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpeq_epu32_mask

extern __mmask16 __cdecl  _mm512_cmpeq_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for equality, and store the results in mask vector k.



_mm512_mask_cmpeq_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpeq_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for equality, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpge_epu32_mask

extern __mmask16 __cdecl  _mm512_cmpge_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for greater-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmpge_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpge_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpgt_epu32_mask

extern __mmask16 __cdecl  _mm512_cmpgt_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for greater-than, and store the results in mask vector k.



_mm512_mask_cmpgt_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpgt_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for greater-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_epu32_mask

extern __mmask16 __cdecl  _mm512_cmple_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for less-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmple_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmple_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for less-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_epu32_mask

extern __mmask16 __cdecl  _mm512_cmplt_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for less-than, and store the results in mask vector k.



_mm512_mask_cmplt_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmplt_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_epu32_mask

extern __mmask16 __cdecl  _mm512_cmpneq_epu32_mask(__m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for not-equal, and store the results in mask vector k.



_mm512_mask_cmpneq_epu32_mask

extern __mmask16 __cdecl  _mm512_mask_cmpneq_epu32_mask(__mmask16 k, __m512i a, __m512i b);

Compare packed unsigned int32 elements in a and b for not-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmp_epu64_mask

extern __mmask8 __cdecl _mm512_cmp_epu64_mask(__m512i a, __m512i b, const _MM_CMPINT_ENUM imm);

Compare packed unsigned int64 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k.



_mm512_mask_cmp_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmp_epu64_mask(__mmask8 k, __m512i a, __m512i b, const _MM_CMPINT_ENUM imm);

Compare packed unsigned int64 elements in a and b based on the comparison operand specified by imm, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpge_epu64_mask

extern __mmask8 __cdecl _mm512_cmpge_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for greater-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmpge_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmpge_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for greater-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpgt_epu64_mask

extern __mmask8 __cdecl _mm512_cmpgt_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for greater-than, and store the results in mask vector k.



_mm512_mask_cmpgt_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmpgt_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for greater-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmple_epu64_mask

extern __mmask8 __cdecl _mm512_cmple_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for less-than-or-equal, and store the results in mask vector k.



_mm512_mask_cmple_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmple_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for less-than-or-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmplt_epu64_mask

extern __mmask8 __cdecl _mm512_cmplt_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for less-than, and store the results in mask vector k.



_mm512_mask_cmplt_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmplt_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for less-than, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpeq_epu64_mask

extern __mmask8 __cdecl _mm512_cmpeq_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for equality, and store the results in mask vector k.



_mm512_mask_cmpeq_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmpeq_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for equality, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).



_mm512_cmpneq_epu64_mask

extern __mmask8 __cdecl _mm512_cmpneq_epu64_mask(__m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for not-equal, and store the results in mask vector k.



_mm512_mask_cmpneq_epu64_mask

extern __mmask8 __cdecl _mm512_mask_cmpneq_epu64_mask(__mmask8 k, __m512i a, __m512i b);

Compare packed unsigned int64 elements in a and b for not-equal, and store the results in mask vector k using zeromask k (elements are zeroed out when the corresponding mask bit is not set).