beautypg.com

Intel IA-32 User Manual

Page 491

background image

Vol. 3A 11-3

INTEL® MMX™ TECHNOLOGY SYSTEM PROGRAMMING

Execution of MMX instructions does not affect the other bits in the x87 FPU status word (bits
0 through 10 and bits 14 and 15) or the contents of the other x87 FPU registers that comprise the
x87 FPU state (the x87 FPU control word, instruction pointer, data pointer, or opcode registers).

Table 11-2 summarizes the effects of the MMX instructions on the x87 FPU state.

11.2.1

Effect of MMX, x87 FPU, FXSAVE, and FXRSTOR
Instructions on the x87 FPU Tag Word

Table 11-3 summarizes the effect of MMX and x87 FPU instructions and the FXSAVE and
FXRSTOR instructions on the tags in the x87 FPU tag word and the corresponding tags in an
image of the tag word stored in memory.

The values in the fields of the x87 FPU tag word do not affect the contents of the MMX registers
or the execution of MMX instructions. However, the MMX instructions do modify the contents
of the x87 FPU tag word, as is described in Section 11.2, “The MMX State and MMX Register
Aliasing.” These
modifications may affect the operation of the x87 FPU when executing x87
FPU instructions, if the x87 FPU state is not initialized or restored prior to beginning x87 FPU
instruction execution.

Note that the FSAVE, FXSAVE, and FSTENV instructions (which save x87 FPU state informa-
tion) read the x87 FPU tag register and contents of each of the floating-point registers, determine
the actual tag values for each register (empty, nonzero, zero, or special), and store the updated
tag word in memory. After executing these instructions, all the tags in the x87 FPU tag word are
set to empty (11B). Likewise, the EMMS instruction clears MMX state from the MMX/floating-
point registers by setting all the tags in the x87 FPU tag word to 11B.

Table 11-2. Effects of MMX Instructions on x87 FPU State

MMX
Instruction
Type

x87 FPU Tag
Word

TOS Field of
x87 FPU
Status Word

Other x87 FPU
Registers

Bits 64 Through
79 of x87 FPU
Data Registers

Bits 0 Through
63 of x87 FPU
Data Registers

Read from
MMX register

All tags set to
00B (Valid)

000B

Unchanged

Unchanged

Unchanged

Write to MMX
register

All tags set to
00B (Valid)

000B

Unchanged

Set to all 1s

Overwritten with
MMX data

EMMS

All fields set to
11B (Empty)

000B

Unchanged

Unchanged

Unchanged