- •CONTENTS FOR VOLUME 2A AND 2B
- •1.2 Overview of Volume 2A and 2B: Instruction Set Reference
- •1.3 NOTATIONAL CONVENTIONS
- •1.3.1 Bit and Byte Order
- •1.3.2 Reserved Bits and Software Compatibility
- •1.3.3 Instruction Operands
- •1.3.4 Hexadecimal and Binary Numbers
- •1.3.5 Segmented Addressing
- •1.3.6 Exceptions
- •1.3.7 A New Syntax for CPUID, CR, and MSR Values
- •1.4 Related Literature
- •2.1.1 Instruction Prefixes
- •2.1.2 Opcodes
- •2.1.3 ModR/M and SIB Bytes
- •2.1.4 Displacement and Immediate Bytes
- •2.2.1 REX Prefixes
- •2.2.1.1 Encoding
- •2.2.1.2 More on REX Prefix Fields
- •2.2.1.3 Displacement
- •2.2.1.5 Immediates
- •2.2.2 Additional Encodings for Control and Debug Registers
- •CHAPTER 3 Instruction Set Reference, A-M
- •3.1 Interpreting the Instruction Reference Pages
- •3.1.1 Instruction Format
- •3.1.1.1 Opcode Column in the Instruction Summary Table
- •3.1.1.2 Instruction Column in the Opcode Summary Table
- •3.1.1.4 Compatibility/Legacy Mode Column in the Instruction Summary Table
- •3.1.1.5 Description Column in the Instruction Summary Table
- •3.1.1.6 Description Section
- •3.1.1.7 Operation Section
- •3.1.1.9 Flags Affected Section
- •3.1.1.10 FPU Flags Affected Section
- •3.1.1.11 Protected Mode Exceptions Section
- •3.1.1.16 Compatibility Mode Exceptions Section
- •ADDSUBPD: Packed Double-FP Add/Subtract
- •ADDSUBPS: Packed Single-FP Add/Subtract
- •FISTTP: Store Integer with Truncation
- •HADDPD: Packed Double-FP Horizontal Add
- •HADDPS: Packed Single-FP Horizontal Add
- •HSUBPD: Packed Double-FP Horizontal Subtract
- •HSUBPS: Packed Single-FP Horizontal Subtract
- •LDDQU: Load Unaligned Integer 128 Bits
- •MONITOR: Setup Monitor Address
- •MOVDDUP: Move One Double-FP and Duplicate
- •MOVSHDUP: Move Packed Single-FP High and Duplicate
- •MOVSLDUP: Move Packed Single-FP Low and Duplicate
- •MWAIT: Monitor Wait
- •INTEL SALES OFFICES
INSTRUCTION FORMAT
In 64-bit mode, the ModR/M Disp32 (32-bit displacement) encoding is re-defined to be RIP+Disp32 rather than displacement-only. See Table 2-7.
Table 2-7. RIP-Relative Addressing
ModR/M and SIB Sub-field |
Compatibility |
64-bit Mode |
Additional Implications |
|
Encodings |
|
Mode Operation |
Operation |
in 64-bit mode |
|
|
|
|
|
ModR/M |
mod == 00 |
Disp32 |
RIP + Disp32 |
Must use SIB form with |
Byte |
|
|
|
normal (zero-based) |
r/m == 101 (none) |
|
|
||
|
|
|
displacement addressing |
|
|
|
|
|
|
|
|
|
|
|
SIB Byte |
base == 101 (none) |
if mod = 00, Disp32 |
Same as |
None |
|
|
|
legacy |
|
|
index == 100 (none) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
scale = 0, 1, 2, 4 |
|
|
|
|
|
|
|
|
The ModR/M encoding for RIP-relative addressing does not depend on using an REX prefix. Specifically, the r/m bit field encoding of 101B (used to select RIP-relative addressing) is not affected by the REX prefix. For example, selecting R13 (REX.B = 1, r/m = 101B) with mod = 00B still results in RIP-relative addressing. The 4-bit r/m field of REX.B combined with ModR/M is not fully decoded. In order to address R13 with no displacement, software must encode R13 + 0 using a 1-byte displacement of zero.
RIP-relative addressing is enabled by 64-bit mode, not by a 64-bit address-size. The use of the address-size prefix does not disable RIP-relative addressing. The effect of the address-size prefix is to truncate and zero-extend the computed effective address to 32 bits.
2.2.1.7Default 64-Bit Operand Size
In 64-bit mode, two groups of instructions have a default operand size of 64 bits (do not need a REX prefix for this operand size). These are:
•Near branches
•All instructions, except far branches, that implicitly reference the RSP
2.2.2Additional Encodings for Control and Debug Registers
In 64-bit mode, more encodings for control and debug registers are available. The REX.R bit is used to modify the ModR/M reg field when that field encodes a control or debug register (see Table 2-4). These encodings enable the processor to address CR8-CR15 and DR8DR15. An additional control register (CR8) is defined in 64-bit mode. CR8 becomes the Task Priority Register (TPR).
In the first implementation of IA-32e mode, CR9-CR15 and DR8-DR15 are not implemented. Any attempt to access unimplemented registers results in an invalid-opcode exception (#UD).
Vol. 2A 2-15
INSTRUCTION FORMAT
2-16 Vol. 2A
3
Instruction Set
Reference, A-M