# Intrinsics for Integer Bit Shift 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_sll_epi32`, `_mm512_mask_sll_epi32`, `_mm512_maskz_sll_epi32` `_mm512_slli_epi32`, `_mm512_mask_slli_epi32`, `_mm512_maskz_slli_epi32` | Logical left shift of int32 elements. | `VPSLLD`
`_mm512_srl_epi32`, `_mm512_mask_srl_epi32`, `_mm512_maskz_srl_epi32` `_mm512_srli_epi32`, `_mm512_mask_srli_epi32`, `_mm512_maskz_srli_epi32` | Logical right shift of int32 elements. | `VPSRLD`
`_mm512_sll_epi64`, `_mm512_mask_sll_epi64`, `_mm512_maskz_sll_epi64` `_mm512_slli_epi64`, `_mm512_mask_slli_epi64`, `_mm512_maskz_slli_epi64` | Logical left shift of int64 elements. | `VPSLLQ`
`_mm512_srl_epi64`, `_mm512_mask_srl_epi64`, `_mm512_maskz_srl_epi64` `_mm512_srli_epi64`, `_mm512_mask_srli_epi64`, `_mm512_maskz_srli_epi64` | Logical right shift of int64 elements. | `VPSRLQ`
`_mm512_sllv_epi32`, `_mm512_mask_sllv_epi32`, `_mm512_maskz_sllv_epi32` | Variable logical left shift of int32 elements. | `VPSLLVD`
`_mm512_srlv_epi32`, `_mm512_mask_srlv_epi32`, `_mm512_maskz_srlv_epi32` | Variable logical right shift of int32 elements. | `VPSRLVD`
`_mm512_sllv_epi64`, `_mm512_mask_sllv_epi64`, `_mm512_maskz_sllv_epi64` | Variable logical bit shift left of int64 elements. | `VPSLLVQ`
`_mm512_srlv_epi64`, `_mm512_mask_srlv_epi64`, `_mm512_maskz_srlv_epi64` | Variable logical bit shift right of int64 elements. | `VPSRLVQ`
`_mm512_sra_epi32`, `_mm512_mask_sra_epi32`, `_mm512_maskz_sra_epi32` `_mm512_srai_epi32`, `_mm512_mask_srai_epi32`, `_mm512_maskz_srai_epi32` | Arithmetic right shift of int32 elements. | `VPSRAD`
`_mm512_srav_epi32`, `_mm512_mask_srav_epi32`, `_mm512_maskz_srav_epi32` | Variable arithmetic right shift of int32 elements. | `VPSRAVD`
`_mm512_srav_epi64`, `_mm512_mask_srav_epi64`, `_mm512_maskz_srav_epi64` | Variable arithmetic bit shift right of int64 elements. | `VPSRAVQ`
`_mm512_sra_epi64`, `_mm512_mask_sra_epi64`, `_mm512_maskz_sra_epi64` `_mm512_srai_epi64`, `_mm512_mask_srai_epi64`, `_mm512_maskz_srai_epi64` | Arithmetic right shift of int64 elements. | `VPSRAQ`

variable | definition
--- | ---
k | writemask used as a selector
a | first source vector element
src | source element to use based on writemask result
count | specifies the number of bits for shift operation
imm | 8-bit immediate integer specifies offset for destination

_mm512_sll_epi32

    extern __m512i __cdecl _mm512_sll_epi32(__m512i a, __m128i count);

Shifts packed int32 elements in a left by count while shifting in zeros, and stores the result.

_mm512_mask_sll_epi32

    extern __m512i __cdecl _mm512_mask_sll_epi32(__m512i src, __mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a left by count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sll_epi32

    extern __m512i __cdecl _mm512_maskz_sll_epi32(__mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a left by count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_slli_epi32

    extern __m512i __cdecl _mm512_slli_epi32(__m512i a, unsigned int imm);

Shifts packed int32 elements in a left by imm while shifting in zeros, and stores the result.

_mm512_mask_slli_epi32

    extern __m512i __cdecl _mm512_mask_slli_epi32(__m512i src, __mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a left by imm while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_slli_epi32

    extern __m512i __cdecl _mm512_maskz_slli_epi32(__mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a left by imm while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_sll_epi64

    extern __m512i __cdecl _mm512_sll_epi64(__m512i a, __m128i count);

Shifts packed int64 elements in a left by count while shifting in zeros, and stores the result.

_mm512_mask_sll_epi64

    extern __m512i __cdecl _mm512_mask_sll_epi64(__m512i src, __mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a left by count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sll_epi64

    extern __m512i __cdecl _mm512_maskz_sll_epi64(__mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a left by count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_slli_epi64

    extern __m512i __cdecl _mm512_slli_epi64(__m512i a, unsigned int imm);

Shifts packed int64 elements in a left by imm while shifting in zeros, and stores the result.

_mm512_mask_slli_epi64

    extern __m512i __cdecl _mm512_mask_slli_epi64(__m512i src, __mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a left by imm while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_slli_epi64

    extern __m512i __cdecl _mm512_maskz_slli_epi64(__mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a left by imm while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_sllv_epi32

    extern __m512i __cdecl _mm512_sllv_epi32(__m512i a, __m512i count);

Shifts packed int32 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result.

_mm512_mask_sllv_epi32

    extern __m512i __cdecl _mm512_mask_sllv_epi32(__m512i src, __mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sllv_epi32

    extern __m512i __cdecl _mm512_maskz_sllv_epi32(__mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_sllv_epi64

    extern __m512i __cdecl _mm512_sllv_epi64(__m512i a, __m512i count);

Shifts packed int64 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result.

_mm512_mask_sllv_epi64

    extern __m512i __cdecl _mm512_mask_sllv_epi64(__m512i src, __mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sllv_epi64

    extern __m512i __cdecl _mm512_maskz_sllv_epi64(__mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a left by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_sra_epi32

    extern __m512i __cdecl _mm512_sra_epi32(__m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in sign bits, and stores the result.

_mm512_mask_sra_epi32

    extern __m512i __cdecl _mm512_mask_sra_epi32(__m512i src, __mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sra_epi32

    extern __m512i __cdecl _mm512_maskz_sra_epi32(__mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_sra_epi64

    extern __m512i __cdecl _mm512_sra_epi64(__m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in sign bits, and stores the result.

_mm512_mask_sra_epi64

    extern __m512i __cdecl _mm512_mask_sra_epi64(__m512i src, __mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_sra_epi64

    extern __m512i __cdecl _mm512_maskz_sra_epi64(__mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srai_epi32

    extern __m512i __cdecl _mm512_srai_epi32(__m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in sign bits, and stores the result.

_mm512_mask_srai_epi32

    extern __m512i __cdecl _mm512_mask_srai_epi32(__m512i src, __mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srai_epi32

    extern __m512i __cdecl _mm512_maskz_srai_epi32(__mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srai_epi64

    extern __m512i __cdecl _mm512_srai_epi64(__m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in sign bits, and stores the result.

_mm512_mask_srai_epi64

    extern __m512i __cdecl _mm512_mask_srai_epi64(__m512i src, __mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srai_epi64

    extern __m512i __cdecl _mm512_maskz_srai_epi64(__mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srav_epi32

    extern __m512i __cdecl _mm512_srav_epi32(__m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result.

_mm512_mask_srav_epi32

    extern __m512i __cdecl _mm512_mask_srav_epi32(__m512i src, __mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srav_epi32

    extern __m512i __cdecl _mm512_maskz_srav_epi32(__mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srav_epi64

    extern __m512i __cdecl _mm512_srav_epi64(__m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result.

_mm512_mask_srav_epi64

    extern __m512i __cdecl _mm512_mask_srav_epi64(__m512i src, __mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srav_epi64

    extern __m512i __cdecl _mm512_maskz_srav_epi64(__mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in sign bits, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srl_epi32

    extern __m512i __cdecl _mm512_srl_epi32(__m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in zeros, and stores the result.

_mm512_mask_srl_epi32

    extern __m512i __cdecl _mm512_mask_srl_epi32(__m512i src, __mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srl_epi32

    extern __m512i __cdecl _mm512_maskz_srl_epi32(__mmask16 k, __m512i a, __m128i count);

Shifts packed int32 elements in a right by count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srli_epi32

    extern __m512i __cdecl _mm512_srli_epi32(__m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in zeros, and stores the result.

_mm512_mask_srli_epi32

    extern __m512i __cdecl _mm512_mask_srli_epi32(__m512i src, __mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srli_epi32

    extern __m512i __cdecl _mm512_maskz_srli_epi32(__mmask16 k, __m512i a, unsigned int imm);

Shifts packed int32 elements in a right by imm while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srl_epi64

    extern __m512i __cdecl _mm512_srl_epi64(__m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in zeros, and stores the result.

_mm512_mask_srl_epi64

    extern __m512i __cdecl _mm512_mask_srl_epi64(__m512i src, __mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srl_epi64

    extern __m512i __cdecl _mm512_maskz_srl_epi64(__mmask8 k, __m512i a, __m128i count);

Shifts packed int64 elements in a right by count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srli_epi64

    extern __m512i __cdecl _mm512_srli_epi64(__m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in zeros, and stores the result.

_mm512_mask_srli_epi64

    extern __m512i __cdecl _mm512_mask_srli_epi64(__m512i src, __mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srli_epi64

    extern __m512i __cdecl _mm512_maskz_srli_epi64(__mmask8 k, __m512i a, unsigned int imm);

Shifts packed int64 elements in a right by imm while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srlv_epi32

    extern __m512i __cdecl _mm512_srlv_epi32(__m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result.

_mm512_mask_srlv_epi32

    extern __m512i __cdecl _mm512_mask_srlv_epi32(__m512i src, __mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srlv_epi32

    extern __m512i __cdecl _mm512_maskz_srlv_epi32(__mmask16 k, __m512i a, __m512i count);

Shifts packed int32 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

_mm512_srlv_epi64

    extern __m512i __cdecl _mm512_srlv_epi64(__m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result.

_mm512_mask_srlv_epi64

    extern __m512i __cdecl _mm512_mask_srlv_epi64(__m512i src, __mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using writemask k (elements are copied from src when the corresponding mask bit is not set).

_mm512_maskz_srlv_epi64

    extern __m512i __cdecl _mm512_maskz_srlv_epi64(__mmask8 k, __m512i a, __m512i count);

Shifts packed int64 elements in a right by the amount specified by the corresponding element in count while shifting in zeros, and stores the result using zeromask k (elements are zeroed out when the corresponding mask bit is not set).

Parent topic: Intrinsics for Bit Manipulation Operations