This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: underflow exceptions
From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Fri, 25 May 2012 00:26:44 +0000 (UTC)
> On Thu, 24 May 2012, David Miller wrote:
>
>> Failure: scalbn (min_value / 4, INT_MAX) == inf: Exception "Underflow" set
>> Failure: scalbln (min_value / 4, INT_MAX) == inf: Exception "Underflow" set
>> Failure: scalbln (min_value / 4, LONG_MAX) == inf: Exception "Underflow" set
>> Failure: scalbln (min_value / 4, 0x88000000) == inf: Exception "Underflow" set
>
> These are all overflow cases, not underflow, and certainly should not
> raise the underflow exception.
>
> One possibility that occurs to me is that the exception is occurring in
> the "min_value / 4" computation rather than in the function being called.
> If so, that would be a bug in soft-fp; min_value / 4 is exact so should
> not raise the underflow exception.
You're probably right.
It must be some difference between the code used in soft-fp for 64-bit
vs 32-bit since, as I stated, 32-bit sparc doesn't get these failures.
Only 64-bit sparc does.