This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fix ldbl-128ibm fma (Inf, Inf, finite) (bug 23272)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: Tulio Magno Quites Machado Filho <tuliom at linux dot ibm dot com>, <libc-alpha at sourceware dot org>
- Date: Fri, 21 Sep 2018 12:46:37 +0000
- Subject: Re: [PATCH] Fix ldbl-128ibm fma (Inf, Inf, finite) (bug 23272)
- References: <20180613220136.11438-1-tuliom@linux.ibm.com> <alpine.DEB.2.20.1806132305161.17472@digraph.polyomino.org.uk> <87r2hnhxhg.fsf@oldenburg.str.redhat.com>
On Fri, 21 Sep 2018, Florian Weimer wrote:
> * Joseph Myers:
>
> > On Wed, 13 Jun 2018, Tulio Magno Quites Machado Filho wrote:
> >
> >> This solution is mainly based on Joseph's fix at commit
> >> ca121b117f2c9c97a4c121334481a96c94fef3a0.
> >>
> >> It has extra differences because:
> >> - part of the non-finite arguments were already being treated;
> >> - when x and y are +-Inf and z if finite, an overflow can be
> >> generated.
> >
> > I'm not clear what the observed issues you are fixing are. Is this patch
> > to avoid running into libgcc generating spurious overflows for the case
> > you mention, or is it intended to fix wrong results?
> >
> >> + if (!isfinite (x) && !isfinite (y) && isfinite(z))
> >> + /* Compute the result as x * y to avoid an overflow. */
> >> + return x * y;
> >
> > Why wouldn't this be needed if just one of x and y is not finite? If x *
> > y + z generates a spurious overflow in some cases where x * y is infinite,
> > I'd expect that to apply equally to the case where the infinity comes from
> > (Inf * finite), not just from (Inf * Inf).
>
> We still see a failures (see bug 23272). How can we move this forward?
Do you mean bug 23584? That answers the first question about the symptoms
(both spurious overflow exceptions and bad results, apparently coming from
__gcc_qadd mishandling certain cases involving infinities), but doesn't
answer the second question about what happens when the infinite x * y
comes from (Inf * finite) (I'd guess the same problem, in which case the
proposed patch needs fixing further, but it looks like tests for that case
also need adding to libm-test-fma.inc).
--
Joseph S. Myers
joseph@codesourcery.com