# Intrinsics for Miscellaneous Integer 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_alignr_epi32`, `_mm512_mask_alignr_epi32`, `_mm512_maskz_alignr_epi32` | Aligns elements of two source vectors depending on bits in a mask. | `VALIGND`
`_mm512_alignr_epi64`, `_mm512_mask_alignr_epi64`, `_mm512_maskz_alignr_epi64` | Aligns elements of two source vectors depending on bits in a mask. | `VALIGNQ`

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
count | specifies the number of bits for shift operation

_mm512_alignr_epi32

    extern __m512i __cdecl _mm512_alignr_epi32(__m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 32-bit elements, and stores the low 64 bytes (sixteen elements).

_mm512_mask_alignr_epi32

    extern __m512i __cdecl _mm512_mask_alignr_epi32(__m512i src, __mmask16 k, __m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 32-bit elements, and stores the low 64 bytes (sixteen elements) using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_alignr_epi32

    extern __m512i __cdecl _mm512_maskz_alignr_epi32(__mmask16 k, __m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 32-bit elements, and stores the low 64 bytes (sixteen elements) using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_alignr_epi64

    extern __m512i __cdecl _mm512_alignr_epi64(__m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 64-bit elements, and stores the low 64 bytes (eight elements).

_mm512_mask_alignr_epi64

    extern __m512i __cdecl _mm512_mask_alignr_epi64(__m512i src, __mmask8 k, __m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 64-bit elements, and stores the low 64 bytes (eight elements) using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_alignr_epi64

    extern __m512i __cdecl _mm512_maskz_alignr_epi64(__mmask8 k, __m512i a, __m512i b, const int count);

Concatenates vector elements from a and b into a 128-byte immediate result, shifts the result right by count of 64-bit elements, and stores the low 64 bytes (eight elements) using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

Parent topic: Intrinsics for Miscellaneous Operations