AMD amd64 architecture User Manual

Page of 336
x87 Floating-Point Programming
277
24592—Rev. 3.15—November 2009
AMD64 Technology
6.6
Instruction Prefixes
Instruction prefixes, in general, are described in “Instruction Prefixes” on page 71. The following
restrictions apply to the use of instruction prefixes with x87 instructions.
Supported Prefixes.
The following prefixes can be used with x87 instructions:
Operand-Size Override—The 66h prefix affects only the FLDENV, FSTENV, FNSTENV,
FSAVE, FNSAVE, and FRSTOR instructions, in which it selects between a 16-bit and 32-bit
memory-image format. The prefix is ignored by all other x87 instructions.
Address-Size Override—The 67h prefix affects only operands in memory, in which it selects
between a 16-bit and 32-bit addresses. The prefix is ignored by all other x87 instructions.
Segment Overrides—The 2Eh (CS), 36h (SS), 3Eh (DS), 26h (ES), 64h (FS), and 65h (GS)
prefixes specify a segment. They affect only operands in memory. In 64-bit mode, the CS, DS, ES,
SS segment overrides are ignored.
REX—The REX.W bit affects the FXSAVE and FXRSTOR instructions, in which it selects
between two types of 512-byte memory-image formats, as described in "Saving Media and x87
Processor State" in Volume 2. The REX.W bit also affects the FLDENV, FSTENV, FSAVE, and
FRSTOR instructions, in which it selects the 32-bit memory-image format. The REX.R, REX.X,
and REX.B bits only affect operands in memory, in which they are used to find the memory
operand.
Ignored Prefixes.
The following prefixes are ignored by x87 instructions:
REP—The F3h and F2h prefixes.
Prefixes That Cause Exceptions.
The following prefixes cause an exception:
LOCK—The F0h prefix causes an invalid-opcode exception when used with x87 instructions.
Table 6-16.
Instruction Effects on rFLAGS
Instruction
Mnemonic
rFLAGS Mnemonic and Bit Number
OF
11
SF
7
ZF
6
AF
4
PF
2
CF
0
FCMOVcc
Tst
Tst
Tst
FCOMI
FCOMIP
FUCOMI
FUCOMIP
Mod
Mod
Mod