User Guide

176 128-Bit Media and Scientific Programming
AMD64 Technology 24592—Rev. 3.15—November 2009
REP—The F2 and F3h prefixes do not function as repeat prefixes for 128-bit media instructions.
Instead, they are used to form the opcodes of certain 128-bit media instructions. The prefixes are
ignored by all other 128-bit media instructions.
REX—The REX prefixes affect operands that reference a GPR or XMM register when running in
64-bit mode. It allows access to the full 64-bit width of any of the 16 extended GPRs and to any of
the 16 extended XMM registers. The REX prefix also affects the FXSAVE and FXRSTOR
instructions, in which it selects between two types of 512-byte memory-image format, as described
in “Media and x87 Processor State” in Volume 2. The prefix is ignored by all other 128-bit media
instructions.
4.8.2 Special-Use and Reserved Prefixes
The following prefixes are used as opcode bytes in some 128-bit media instructions and are reserved in
all other 128-bit media instructions:
Operand-Size Override—The 66h prefix.
REP—The F2 and F3h prefixes.
4.8.3 Prefixes That Cause Exceptions
The following prefixes cause an exception:
LOCK—The F0h prefix causes an invalid-opcode exception when used with 128-bit media
instructions.
4.9 Feature Detection
Before executing 128-bit media instructions, software should determine whether the processor
supports the technology by executing the CPUID instruction. “Feature Detection” on page 74
describes how software uses the CPUID instruction to detect feature support. For full support of the
128-bit media instructions documented here, the following features require detection:
SSE, indicated by EDX bit 25 returned by CPUID function 0000_0001h.
SSE2, indicated by EDX bit 26 returned by CPUID function 0000_0001h.
SSE3, indicated by ECX bit 0 returned by CPUID function 0000_0001h.
SSE4A, indicated by ECX bit 6 returned by CPUID function 8000_0001h.
FXSAVE and FXRSTOR, indicated by EDX bit 24 returned by CPUID functions 0000_0001h and
8000_0001h.
Misaligned SSE memory access mode is indicated by ECX bit 7 returned by CPUID function
8000_0001h. (See “Misaligned Exception Mask (MM)” on page 120 for further details.
Software that runs in long mode should also check for the following support:
Long Mode, indicated by bit 29 of CPUID function 8000_0001h.