public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Sujoy Saraswati <ssaraswati@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	GCC Patches	<gcc-patches@gcc.gnu.org>
Subject: Re: Fix 61441
Date: Thu, 05 Nov 2015 16:58:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.10.1511051647390.26133@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CA+ZXfhXPwqoUN-NvMzPDKbAoLuZUJNR5Qupx300_KeoVwmq4fg@mail.gmail.com>

On Thu, 5 Nov 2015, Sujoy Saraswati wrote:

> > Some other places in this patch have similar issues with checking
> > HONOR_SNANS && REAL_VALUE_ISNAN when they should check if the particular
> > value is sNaN.
> 
> I modified the code to check for sNaN specifically. The modified patch 
> is below.

This is looking pretty close to ready to go in, but the patch also seems 
to be doing several things at once and it might be easier to review if 
split into separate logical pieces.  For example (this is an illustration, 
not necessarily saying it should be exactly this way): (1) Add 
REAL_VALUE_ISSIGNALING_NAN and convert existing logic that already does 
something equivalent (so no semantic change, just cleanup).  (2) Convert 
existing code that checks for all NaNs in cases where 
REAL_VALUE_ISSIGNALING_NAN would be enough.  (3) Treat rint and nearbyint 
the same.  (4) Make real.c operations properly produce quiet NaNs for 
operations with signaling NaN input.  (5) Disable various transformations 
for signaling NaN operands, where folding them loses exceptions.

This patch is also getting big enough that it would be a good idea to 
complete the copyright assignment paperwork, certainly if you plan to make 
more contributions in future, if you're not covered by a corporate 
assignment.

> @@ -1943,7 +1965,17 @@ fold_convert_const_real_from_real (tree type, cons
>    REAL_VALUE_TYPE value;
>    tree t;
> 
> +  /* Don't perform the operation if flag_signaling_nans is on
> +     and the operand is a NaN.  */
> +  if (HONOR_SNANS (TYPE_MODE (TREE_TYPE (arg1)))
> +      && REAL_VALUE_ISSIGNALING_NAN (TREE_REAL_CST (arg1)))
> +    return NULL_TREE;
> +
>    real_convert (&value, TYPE_MODE (type), &TREE_REAL_CST (arg1));
> +  /* Make resulting NaN value to be qNaN when flag_signaling_nans
> +     is off.  */
> +  if (REAL_VALUE_ISSIGNALING_NAN (value))
> +    value.signalling = 0;

Shouldn't real_convert do this rather than the caller needing to do it?

-- 
Joseph S. Myers
joseph@codesourcery.com

  reply	other threads:[~2015-11-05 16:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 10:23 Sujoy Saraswati
2015-09-01 12:21 ` Richard Biener
2015-09-02 11:36   ` Sujoy Saraswati
2015-09-02 11:56     ` Richard Biener
2015-09-02 12:16       ` Sujoy Saraswati
2015-09-10  7:33       ` Sujoy Saraswati
2015-09-14 13:50         ` Richard Biener
2015-09-14 20:39           ` Joseph Myers
2015-09-16 13:01             ` Sujoy Saraswati
2015-09-16 17:03               ` Joseph Myers
2015-10-13 10:46                 ` Sujoy Saraswati
2015-10-28 17:19                   ` Joseph Myers
2015-11-05 11:29                     ` Sujoy Saraswati
2015-11-05 16:58                       ` Joseph Myers [this message]
2015-11-06  4:56                         ` Sujoy Saraswati
2015-11-06 13:09                           ` Joseph Myers
2015-11-26  8:28                             ` Saraswati, Sujoy (OSTL)

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.10.1511051647390.26133@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    --cc=ssaraswati@gmail.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).