Shift Intrinsics (MMX™ technology)

This topic summarizes the MMX™ technology shift intrinsics.

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

#include <immintrin.h>

Intrinsic Name

Operation

Corresponding
MMX™ Instruction

_mm_sll_pi16

Logical shift left

PSLLW

_mm_slli_pi16

Logical shift left

PSLLWI

_mm_sll_pi32

Logical shift left

PSLLD

_mm_slli_pi32

Logical shift left

PSLLDI

_mm_sll_pi64

Logical shift left

PSLLQ

_mm_slli_pi64

Logical shift left

PSLLQI

_mm_sra_pi16

Arithmetic shift right

PSRAW

_mm_srai_pi16

Arithmetic shift right

PSRAWI

_mm_sra_pi32

Arithmetic shift right

PSRAD

_mm_srai_pi32

Arithmetic shift right

PSRADI

_mm_srl_pi16

Logical shift right

PSRLW

_mm_srli_pi16

Logical shift right

PSRLWI

_mm_srl_pi32

Logical shift right

PSRLD

_mm_srli_pi32

Logical shift right

PSRLDI

_mm_srl_pi64

Logical shift right

PSRLQ

_mm_srli_pi64

Logical shift right

PSRLQI

_mm_sll_pi16

__m64 _mm_sll_pi16(__m64 m, __m64 count);

Shifts four 16-bit values in m left the amount specified by count while shifting in zeros.

_mm_slli_pi16

__m64 _mm_slli_pi16(__m64 m, int count);

Shifts four 16-bit values in m left the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

_mm_sll_pi32

__m64 _mm_sll_pi32(__m64 m, __m64 count);

Shifts two 32-bit values in m left the amount specified by count while shifting in zeros.

_mm_slli_pi32

__m64 _mm_slli_pi32(__m64 m, int count);

Shifts two 32-bit values in m left the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

_mm_sll_pi64

__m64 _mm_sll_pi64(__m64 m, __m64 count);

Shifts the 64-bit value in m left the amount specified by count while shifting in zeros.

_mm_slli_pi64

__m64 _mm_slli_pi64(__m64 m, int count);

Shifts the 64-bit value in m left the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

_mm_sra_pi16

__m64 _mm_sra_pi16(__m64 m, __m64 count);

Shifts four 16-bit values in m right the amount specified by count while shifting in the sign bit.

_mm_srai_pi16

__m64 _mm_srai_pi16(__m64 m, int count);

Shifts four 16-bit values in m right the amount specified by count while shifting in the sign bit. For the best performance, count should be a constant.

_mm_sra_pi32

__m64 _mm_sra_pi32(__m64 m, __m64 count);

Shifts two 32-bit values in m right the amount specified by count while shifting in the sign bit.

_mm_srai_pi32

__m64 _mm_srai_pi32(__m64 m, int count);

Shifts two 32-bit values in m right the amount specified by count while shifting in the sign bit. For the best performance, count should be a constant.

_mm_srl_pi16

__m64 _mm_srl_pi16(__m64 m, __m64 count);

Shifts four 16-bit values in m right the amount specified by count while shifting in zeros.

_mm_srli_pi16

__m64 _mm_srli_pi16(__m64 m, int count);

Shifts four 16-bit values in m right the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

_mm_srl_pi32

__m64 _mm_srl_pi32(__m64 m, __m64 count);

Shifts two 32-bit values in m right the amount specified by count while shifting in zeros.

_mm_srli_pi32

__m64 _mm_srli_pi32(__m64 m, int count);

Shifts two 32-bit values in m right the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

_mm_srl_pi64

__m64 _mm_srl_pi64(__m64 m, __m64 count);

Shifts the 64-bit value in m right the amount specified by count while shifting in zeros.

_mm_srli_pi64

__m64 _mm_srli_pi64(__m64 m, int count);

Shifts the 64-bit value in m right the amount specified by count while shifting in zeros. For the best performance, count should be a constant.

Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.