Arithmetic Operations (Integer SSE2 Intrinsics)

Microsoft Specific

The operations are listed in the following table, followed by their descriptions. The packed arithmetic intrinsics for the 64-bit integer MMX technology are listed in the Packed Arithmetic Operations table.

SSE2 intrinsics use the __m128, __m128i, and __m128d data types, which are not supported on Itanium Processor Family (IPF) processors. Any SSE2 intrinsics that use the __m64 data type are not supported on x64 processors.

The emmintrin.h header file contains the declarations for the SSE2 instructions intrinsics.

Integer Arithmetic Operations

Intrinsic

Instruction

Operation

_mm_add_epi8

PADDB

Addition

_mm_add_epi16

PADDW

Addition

_mm_add_epi32

PADDD

Addition

_mm_add_si64

PADDQ

Addition

_mm_add_epi64

PADDQ

Addition

_mm_adds_epi8

PADDSB

Addition

_mm_adds_epi16

PADDSW

Addition

_mm_adds_epu8

PADDUSB

Addition

_mm_adds_epu16

PADDUSW

Addition

_mm_avg_epu8

PAVGB

Computes average

_mm_avg_epu16

PAVGW

Computes average

_mm_madd_epi16

PMADDWD

Multiplication/addition

_mm_max_epi16

PMAXSW

Computes maxima

_mm_max_epu8

PMAXUB

Computes maxima

_mm_min_epi16

PMINSW

Computes minima

_mm_min_epu8

PMINUB

Computes minima

_mm_mulhi_epi16

PMULHW

Multiplication

_mm_mulhi_epu16

PMULHUW

Multiplication

_mm_mullo_epi16

PMULLW

Multiplication

_mm_mul_su32

PMULUDQ

Multiplication

_mm_mul_epu32

PMULUDQ

Multiplication

_mm_sad_epu8

PSADBW

Computes difference/adds

_mm_sub_epi8

PSUBB

Subtraction

_mm_sub_epi16

PSUBW

Subtraction

_mm_sub_epi32

PSUBD

Subtraction

_mm_sub_si64

PSUBQ

Subtraction

_mm_sub_epi64

PSUBQ

Subtraction

_mm_subs_epi8

PSUBSB

Subtraction

_mm_subs_epi16

PSUBSW

Subtraction

_mm_subs_epu8

PSUBUSB

Subtraction

_mm_subs_epu16

PSUBUSW

Subtraction

For an explanation of the syntax used in code samples in this topic, see Floating-Point Intrinsics Using Streaming SIMD Extensions.

See Also

Reference

Integer Intrinsics Using Streaming SIMD Extensions 2