This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: soft-fp: support after-rounding tininess detection
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: <libc-alpha at sourceware dot org>, Richard Henderson <rth at redhat dot com>
- Date: Tue, 11 Feb 2014 22:28:28 +0000
- Subject: Re: soft-fp: support after-rounding tininess detection
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1402030023100 dot 7179 at digraph dot polyomino dot org dot uk> <52FA97E6 dot 6020000 at twiddle dot net>
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