soft-fp: support after-rounding tininess detection

Joseph S. Myers joseph@codesourcery.com
Tue Feb 11 22:28:00 GMT 2014


On Tue, 11 Feb 2014, Richard Henderson wrote:

> Am I missing something, why the SLL is needed for this case?
> And if it isn't, then the temporary ought not be needed.

After-rounding means after rounding to normal precision, as if the 
exponent range were unbounded - not after rounding to a representable 
floating point value taking account of subnormals having lesser precision.  
For semiraw values N bits below the normal range, just rounding without a 
shift would round to N bits less than the normal precision.  (Shifting 1 
bit instead of N is OK because if N > 1 then the result after rounding 
will always still be subnormal, whatever precision it's rounded to, and 
not have the overflow bit set if the shift was only 1 bit.)  See IEEE 
754-2008 subclause 7.5.

In round-to-nearest mode, a value halfway between the largest subnormal 
and the smallest normal value counts as tiny for after-rounding tininess 
detection (as do values up to but not including three quarters of the way 
from the largest subnormal to the smallest normal), even though the final 
floating-point result is normal.

> And here, does it work to do

Again, no, because that would round to the wrong precision.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list