public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Fix ldbl-128ibm fma (Inf, Inf, finite) (bug 23272)
Date: Wed, 13 Jun 2018 23:07:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.20.1806132305161.17472@digraph.polyomino.org.uk> (raw)
In-Reply-To: <20180613220136.11438-1-tuliom@linux.ibm.com>

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).

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2018-06-13 23:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 22:01 Tulio Magno Quites Machado Filho
2018-06-13 23:07 ` Joseph Myers [this message]
2018-09-21 12:00   ` Florian Weimer
2018-09-21 12:46     ` Joseph Myers
2018-09-21 12:51       ` Florian Weimer
2018-09-21 17:27         ` Tulio Magno Quites Machado Filho
2019-01-14 20:10   ` [PATCH] Add XFAIL_ROUNDING_IBM128_LIBGCC to more fma() tests Tulio Magno Quites Machado Filho
2019-01-14 21:33     ` Joseph Myers
2019-01-15 18:55       ` Tulio Magno Quites Machado Filho
2019-01-15 20:53         ` Joseph Myers
2019-01-16 12:44           ` Tulio Magno Quites Machado Filho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1806132305161.17472@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    --cc=tuliom@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).