Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture
9-6 Vol. 1
PROGRAMMING WITH INTEL® MMX™ TECHNOLOGY
7FFFH, which is the largest positive integer that can be represented in 16 bits; if
negative overflow occurs, the result is saturated to 8000H.
• Unsigned saturation arithmetic — With unsigned saturation arithmetic, out-
of-range results are limited to the representable range of unsigned integers for
the integer size. So, positive overflow when operating on unsigned byte integers
results in FFH being returned and negative overflow results in 00H being
returned.
.
Saturation arithmetic provides an answer for many overflow situations. For example,
in color calculations, saturation causes a color to remain pure black or pure white
without allowing inversion. It also prevents wraparound artifacts 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 cate-
gories:
• 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 overview of the instructions within each group.
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