This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix underflow and inexact signalling in soft-fp whenpacking.
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Fri, 25 May 2012 22:53:52 +0000 (UTC)
> On Fri, 25 May 2012, David Miller wrote:
>
>> @@ -220,7 +220,6 @@ do { \
>> if (X##_e <= _FP_WFRACBITS_##fs) \
>> { \
>> _FP_FRAC_SRS_##wc(X, X##_e, _FP_WFRACBITS_##fs); \
>> - _FP_ROUND(wc, X); \
>> if (_FP_FRAC_HIGH_##fs(X) \
>> & (_FP_OVERFLOW_##fs >> 1)) \
>> { \
>
> Is this "if" case now possible, with the rounding no longer happening
> here?
Yes, it triggers, we've seen it happen in the Linux kernel copy
of the soft-fp code.
And I'm trying to make this code match as close as possible what we
use there since this bug has been fixed in the Linux kernel copy for
almost 5 years and that code has been rigorously tested against
TestFloat by the powerpc folks.
> Equivalently, this looks like it might be a bigger change than necessary -
> as if the substance of what you are doing is really just removing the
> underflow exception setting from the existing "else" case, and putting the
> code after it that properly checks for "inexact".
Note that the FP_ROUND() macro can set the inexact exception, that's
another reason why it's placement is important.