# Intrinsics for Test 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_conflict_epi32`, `_mm512_mask_conflict_epi32`, `_mm512_maskz_conflict_epi32` | Test int32 elements for equality. | `VPCONFLICTD`
`_mm512_conflict_epi64`, `_mm512_mask_conflict_epi64`, `_mm512_maskz_conflict_epi64` | Test int64 elements for equality. | `VPCONFLICTQ`
`_mm512_test_epi32_mask`, `_mm512_mask_test_epi32_mask` | Performs a bitwise logical `AND` operation and stores the logical comparison result. | `VPTESTMD`
`_mm512_testn_epi32_mask`, `_mm512_mask_testn_epi32_mask` | Performs a bitwise logical `AND NOT` operation and stores the logical comparison result. | `VPTESTNMD`
`_mm512_test_epi64_mask`, `_mm512_mask_test_epi64_mask` | Performs a bitwise logical `AND` operation and stores the logical comparison result. | `VPTESTMQ`
`_mm512_testn_epi64_mask`, `_mm512_mask_testn_epi64_mask` | Performs a bitwise logical `AND NOT` operation and stores the logical comparison result. | `VPTESTNMQ`

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

_mm512_conflict_epi32

    extern __m512i __cdecl _mm512_conflict_epi32(__m512i a);

Tests each 32-bit element of a for equality with all other elements in a closer to the least significant bit.

Each element's comparison forms a zero extended bit vector in the destination.

_mm512_mask_conflict_epi32

    extern __m512i __cdecl _mm512_mask_conflict_epi32(__m512i src, __mmask16 k, __m512i a);

Tests each 32-bit element of a for equality with all other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set).

Each element's comparison forms a zero extended bit vector in the destination.

_mm512_maskz_conflict_epi32

    extern __m512i __cdecl _mm512_maskz_conflict_epi32(__mmask16 k, __m512i a);

Tests each 32-bit element of a for equality with other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

Each element's comparison forms a zero extended bit vector in the destination.

_mm512_conflict_epi64

    extern __m512i __cdecl _mm512_conflict_epi64(__m512i a);

Tests each 64-bit element of a for equality with other elements in a closer to the least significant bit.

Each element's comparison forms a zero extended bit vector in the destination.

_mm512_mask_conflict_epi64

    extern __m512i __cdecl _mm512_mask_conflict_epi64(__m512i src, __mmask8 k, __m512i a);

Tests each 64-bit element of a for equality with other elements in a closer to the least significant bit using writemask k (elements are copied from src when the corresponding mask bit is not set).

Each element's comparison forms a zero extended bit vector in the destination.

_mm512_maskz_conflict_epi64

    extern __m512i __cdecl _mm512_maskz_conflict_epi64(__mmask8 k, __m512i a);

Tests each 64-bit element of a for equality with other elements in a closer to the least significant bit using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

Each element's comparison forms a zero extended bit vector the destination.

_mm512_test_epi32_mask

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

Computes the bitwise `AND` of packed 32-bit integers in a and b, producing intermediate 32-bit values, and sets the corresponding bit in result mask k if the intermediate value is non-zero.

_mm512_mask_test_epi32_mask

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

Computes the bitwise `AND` of packed 32-bit integers in a and b, producing intermediate 32-bit values, and sets the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.

_mm512_test_epi64_mask

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

Computes the bitwise `AND` of packed 64-bit integers in a and b, producing intermediate 64-bit values, and sets the corresponding bit in result mask k if the intermediate value is non-zero.

_mm512_mask_test_epi64_mask

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

Computes the bitwise `AND` of packed 64-bit integers in a and b, producing intermediate 64-bit values, and sets the corresponding bit in result mask k (subject to writemask k) if the intermediate value is non-zero.

_mm512_testn_epi32_mask

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

Computes the bitwise `AND NOT` of packed 32-bit integers in a and b, producing intermediate 32-bit values, and sets the corresponding bit in result mask k if the intermediate value is zero.

_mm512_mask_testn_epi32_mask

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

Computes the bitwise `AND NOT` of packed 32-bit integers in a and b, producing intermediate 32-bit values, and sets the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.

_mm512_testn_epi64_mask

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

Computes the bitwise `AND NOT` of packed 64-bit integers in a and b, producing intermediate 64-bit values, and sets the corresponding bit in result mask k if the intermediate value is zero.

_mm512_mask_testn_epi64_mask

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

Computes the bitwise `AND NOT` of packed 64-bit integers in a and b, producing intermediate 64-bit values, and sets the corresponding bit in result mask k (subject to writemask k) if the intermediate value is zero.

Parent topic: Intrinsics for Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Instructions