
Chapter 6: x87 Floating-Point Programming
291
24593—Rev. 3.09—September 2003
AMD 64-Bit Technology
Invalid-Operation Exception (IE).
Bit 0. The processor sets this bit to
1 when an invalid-operation exception occurs. These exceptions
are caused by many types of errors, such as an invalid operand
or by stack faults. When a stack fault causes an IE exception,
the stack fault (SF) exception bit is also set.
Denormalized-Operand Exception (DE).
Bit 1. The processor sets this
bit to 1 when one of the source operands of an instruction is in
denormalized form. (See “Denormalized (Tiny) Numbers” on
page 306.)
Zero-Divide Exception (ZE).
Bit 2. The processor sets this bit to 1
when a non-zero number is divided by zero.
Overflow Exception (OE).
Bit 3. The processor sets this bit to 1 when
the absolute value of a rounded result is larger than the largest
representable normalized floating-point number for the
destination format. (See “Normalized Numbers” on page 306.)
Underflow Exception (UE).
Bit 4. The processor sets this bit to 1
when the absolute value of a rounded non-zero result is too
small to be represented as a normalized floating-point number
for the destination format. (See “Normalized Numbers” on
page 306.)
The underflow exception has an unusual behavior. When
masked by the UM bit (bit 4 of the x87 control word), the
processor only reports a UE exception if the UE occurs
together
with
a precision exception (PE).
Precision Exception (PE).
Bit 5. The processor sets this bit to 1 when
a floating-point result, after rounding, differs from the
infinitely precise result and thus cannot be represented exactly
in the specified destination format. The PE exception is also
called the
inexact-result
exception.
Stack Fault (SF).
Bit 6. The processor sets this bit to 1 when a stack
overflow (due to a push or load into a non-empty stack register)
or stack underflow (due to referencing an empty stack register)
occurs in the x87 stack-register file. When either of these
conditions occur, the processor also sets the invalid-operation
exception (IE) flag, and the processor distinguishes overflow
from underflow by writing the condition-code 1 (C1) bit (C1 = 1
for overflow, C1 = 0 for underflow). Unlike the flags for the