Unformatted text preview: tended-precision floating-point format and operated on in that format. Denormal values are also supported in each of the floating-point types, as required by IEEE Standard 754. When a denormal number in single-precision or double-precision floating-point format is used as a source operand and the denormal exception is masked, the x87 FPU automatically normalizes the number when it is converted to double extended-precision format. When stored in memory, the least significant byte of an x87 FPU data-type value is stored at the initial address specified for the value. Successive bytes from the value are then stored in successively higher addresses in memory. The floating-point instructions load and store memory operands using only the initial address of the operand. 8-18 Vol. 1 PROGRAMMING WITH THE X87 FPU Single-Precision Floating-Point Sign 3130 Exp. 23 22 Fraction Implied Integer 0 Double-Precision Floating-Point Sign Sign Double Extended-Precision Floating-Point 79 78 Exponent 6463 62 Fraction Integer Word Integer Sign 15 14 Doubleword Integer Sign 31 30 Quadword Integer Sign Sign 63 62 Packed BCD Integers
X D17 D16 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 Exponent 63 62 52 51 Fraction Implied Integer 0 0 0 0 0 79 78 72 71 4 Bits = 1 BCD Digit 0 Figure 8-13. x87 FPU Data Type Formats
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 debugging 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 Vol. 1 8-19 PROGRAMMING WITH THE X87 FPU 4-4 for the encoding of the integer indefinite, QNaN floating-point indefinite, and packed BCD integer indefinite, respectively. The binary integer encoding 100..00B represents either of two things, depending on the circumstances of its use: The largest negative number supported by the format (215, 231, or 263) The integer indefinite value If this encoding is used as a source operand (as in an integer load or integer arithmetic instruction), the x87 FPU interprets it as the largest negative number representable in the format being used. If the x87 FPU detects an i...
View Full Document
- Winter '11
- X86, Intel corporation, 64-bit mode, fpu floating-point exception, FPU Control Instructions