You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix off-by-one error in X87DoubleExtended::from_bits
The standard floating point formats use an implicit bit in the significand.
For example, for a 64-bit floating point value (a 'double'), the significand might be a 53-bit value, stored as 52 bits.
The most significant bit is implicitly assumed to be 1.
The X87 80-bit floating point format does not use an implicit bit. It stores a significand of 64 bits as 64 bits.
The Semantics::PRECISION constant defines the size of the significand including the implicit bit.
So for a 64-bit floating point value, Semantics::PRECISION would be 53 even though only 52 bits are used to store the significand.
The code for the standard floating point formats has to work around this,
by subtracting 1 from PRECISION to compute the correct number of bits.
The code in X87DoubleExtended::from_bits incorrectly also subtracted 1 from PRECISION,
even though no implicit bit is used in this format. Thus computing a size that is off-by-one from the actual size.
0 commit comments