User Guide

64-Bit Media Programming 193
24592—Rev. 3.15—November 2009 AMD64 Technology
5 64-Bit Media Programming
This chapter describes the 64-bit media programming model. This model includes all instructions that
access the MMX™ registers, including the MMX and 3DNow!™ instructions, as well as some SSE
and SSE2 instructions.
The 64-bit media instructions perform integer and floating-point operations primarily on vector
operands (a few of the instructions take scalar operands). The MMX integer operations produce
signed, unsigned, and/or saturating results. The 3DNow! floating-point operations take single-
precision operands and produce saturating results without generating floating-point exceptions. The
instructions that take vector operands can speed up certain types of procedures by significant factors,
depending on data-element size and the regularity and locality of data accesses to memory.
The term 64-bit is used in two different contexts within the AMD64 architecture: the 64-bit media
instructions, described in this chapter, and the 64-bit operating mode, described in “64-Bit Mode” on
page 6.
5.1 Origins
The 64-bit media instructions were introduced in the following extensions to the legacy x86
architecture:
MMX Instructions—These are primarily integer instructions that take vector operands in 64-bit
MMX registers or memory locations.
3DNow! Instructions—These are primarily floating-point instructions, most of which take vector
operands in MMX registers or memory locations.
SSE, SSE2, SSE3, and SSE4A Instructions—These are the streaming SIMD extensions (SSE),
SSE2, SSE3, and SSE4A instructions. Some of them perform conversions between operands in the
64-bit MMX register set and other register sets.
For details on the extension-set origin of each instruction, see “Instruction Subsets vs. CPUID Feature
Sets” in Volume 3.
5.2 Compatibility
64-bit media instructions can be executed in any of the architecture’s operating modes. Existing MMX
and 3DNow! binary programs run in legacy and compatibility modes without modification. The
support provided by the AMD64 architecture for such binaries is identical to that provided by legacy
x86 architectures.
To run in 64-bit mode, 64-bit media programs must be recompiled. The recompilation has no side
effects on such programs, other than to make available the extended general-purpose registers and 64-
bit virtual address space.