This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] soft-fp handling of underflow

On Tue, 29 May 2012, David Miller wrote:

> As you have asked, I've taken care of the semi-RAW packing macro.  I
> think I have a handle on this side but I need your help.
> It seems like subnormal handling is split between the actual FPU
> operations and the packing.  For example, underflowing to subnormal
> is handled in the tail of the subtraction code in _FP_ADD_INTERNAL.

Yes, in the semiraw case the caller is responsible for setting up the 
exponent and mantissa appropriately for results in the subnormal range.

> I briefly looked over the calculations that operate on semiraw encoded
> values and the only case that pops out at me is the sub3: label code
> in _FP_ADD_INTERNAL.  I think we need to detect when bits of precision
> are actually lost and signal FP_EX_INEXACT in such cases.  Or is that
> never possible here for some reason?

sub3: is the case where a subnormal has been subtracted from a value with 
the least normal exponent (i.e. the mantissa bits act as if the values had 
the same exponent, no shifting needed, with just one of the values having 
the implicit high bit of the mantissa set).  In such a case, the result 
will always be exact.

This patch is OK with an appropriate ChangeLog entry (and 2012 added to 
the copyright dates in op-common.h; we don't yet use ranges of years in 
the copyright notices in soft-fp because GCC's README doesn't yet have a 
notice about the meaning of such ranges).

Joseph S. Myers

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]