background image

Vol. 1 9-5

PROGRAMMING WITH INTEL® MMX™ TECHNOLOGY

Saturation arithmetic provides an answer for many overflow situations. For example, in color calculations, satura-
tion causes a color to remain pure black or pure white without allowing inversion. It also prevents wraparound arti-
facts from entering into computations when range checking of source operands it not used.
MMX instructions do not indicate overflow or underflow occurrence by generating exceptions or setting flags in the 
EFLAGS register.

9.4 MMX 

INSTRUCTIONS

The MMX instruction set consists of 47 instructions, grouped into the following categories:

Data transfer

Arithmetic

Comparison

Conversion

Unpacking

Logical

Shift

Empty MMX state instruction (EMMS)

Table 9-2 gives a summary of the instructions in the MMX instruction set. The following sections give a brief over-
view of the instructions within each group.

NOTES

The MMX instructions described in this chapter are those instructions that are available in an IA-32 
processor when CPUID.01H:EDX.MMX[bit 23] = 1. 
Section 10.4.4, “SSE 64-Bit SIMD Integer Instructions,” and Section 11.4.2, “SSE2 64-Bit and 128-
Bit SIMD Integer Instructions,”
 list additional instructions included with SSE/SSE2 extensions that 
operate on the MMX registers but are not considered part of the MMX instruction set.

Table 9-1.  Data Range Limits for Saturation

Data Type

Lower Limit

Upper Limit

Hexadecimal

Decimal

Hexadecimal

Decimal

Signed Byte

    80H

    -128

    7FH

     127

Signed Word

8000H

-32,768

7FFFH

32,767

Unsigned Byte

    00H

          0

    FFH

     255

Unsigned Word

0000H

          0

FFFFH

65,535