double rounding in x86
Samuel A. Figueroa
uunet!SLINKY.CS.NYU.EDU!figueroa
Tue Aug 29 13:25:09 PDT 1995
Nowhere does the standard require that values in registers be stored bit-for-
bit to memory. The accuracy and rounding requirements only apply to the result
of an operation. In the case of the x86, results of arithmetic operations
are stored in *extended precision* registers, and NOT to double precision
registers. When those values are stored to memory, if the destination format
is double precision, those values *cannot* be stored bit-for-bit - they must
be converted from extended precision to double precision. It cannot be other-
wise. Furthermore, double rounding does NOT occur - results of operations are
rounded once before being placed in extended precision registers. The IEEE
Standard does not require results to be rounded taking into account the
narrower exponent range for single and double precision formats if the desti-
nation is an extended precision format, regardless of how the precision mode
is set. Finally, remember the IEEE Standard does NOT guarantee results will
be bit-for-bit identical on different standard-conforming arithmetic engines -
some variation is built into the Standard (look, for example, at the rules
for how underflow may be detected).
I'd be interested in your reaction to this.
- Sam Figueroa (figueroaacs.nyu.edu)
More information about the Numeric-interest
mailing list