[PATCH] Fix underflow and inexact signalling in soft-fp when packing.

David Miller davem@davemloft.net
Sat May 26 04:26:00 GMT 2012


From: "Joseph S. Myers" <joseph@codesourcery.com>
Date: Sat, 26 May 2012 00:12:41 +0000 (UTC)

> On Fri, 25 May 2012, David Miller wrote:
> 
>> I think part of all of these problems is that things come out a little
>> bit differently from the FP_DIV macro.  For example, for double
>> operation:
> 
> It's quite possible one of the several FP_DIV implementations has a bug, 
> but if they return results that don't have the highest set bit in the 
> standard position I'd say that's a bug in the relevant implementation, and 
> should be fixed there.  The ones I looked at compared the two mantissas at 
> the start to work out the desired exponent, but maybe they get the case of 
> equality wrong, or something like that.
> 
> I basically did not touch FP_DIV at all in my 2005-6 changes.

Ok, now we're getting somewhere.

What's interesting is "ldbl_min / 4" using glibc's current soft-fp
generates the underflow exception on sparc 64-bit not sparc 32-bit.

The only difference is that sparc 32-bit uses _FP_DIV_MEAT_4_udiv()
and sparc 64-bit uses _FP_DIV_MEAT_2_udiv() for it's _FP_DIV_MEAT_Q()
definition.




More information about the Libc-alpha mailing list