Intel 64 and IA-32 Architectures Software Developers Manual Volume 1, Basic Architecture

Vol. 1 8-19
PROGRAMMING WITH THE X87 FPU
As a general rule, values should be stored in memory in double-precision format. This
format provides sufficient range and precision to return correct results with a
minimum of programmer attention. The single-precision format is useful for debug-
ging algorithms, because rounding problems will manifest themselves more quickly
in this format. The double extended-precision format is normally reserved for holding
intermediate results in the x87 FPU registers and constants. Its extra length is
designed to shield final results from the effects of rounding and overflow/underflow
in intermediate calculations. However, when an application requires the maximum
range and precision of the x87 FPU (for data storage, computations, and results),
values can be stored in memory in double extended-precision format.
8.2.1 Indefinites
For each x87 FPU data type, one unique encoding is reserved for representing the
special value indefinite. The x87 FPU produces indefinite values as responses to
some masked floating-point invalid-operation exceptions. See Tables 4-1, 4-3, and
Figure 8-13. x87 FPU Data Type Formats
0
Packed BCD Integers
79
D0
0
Quadword Integer
63
4 Bits = 1 BCD Digit
0
Doubleword Integer
31
0
Word Integer
15
Sign
D1D2D3D4D5
D6
D7D8D9D10D11D12D13D14D15D16D17
78 7271
X
62
14
30
0
Double Extended-Precision Floating-Point
79
Sign
78 6463
0
Double-Precision Floating-Point
63 62
0
Single-Precision Floating-Point
3130 23 22
FractionExp.
Sign
Implied Integer
Implied Integer
Sign
Exponent
Fraction
52 51
Fraction
Exponent
62
Integer
Sign
Sign
Sign