From: Andrew Pinski <pinskia@gmail.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] fold a * (a > 0 ? 1 : -1) to abs(a) and related optimizations
Date: Sat, 24 Jun 2017 20:53:00 -0000 [thread overview]
Message-ID: <CA+=Sn1mzbjWx04p5XF30eBSy0qrAfYXyKHrpwcnYi4SEP4EyDg@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1706242143400.2551@stedding.saclay.inria.fr>
On Sat, Jun 24, 2017 at 12:47 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sat, 24 Jun 2017, Andrew Pinski wrote:
>
>>> * if X is NaN, we may get a qNaN with the wrong sign bit. We probably
>>> don't
>>> care much though...
>>
>>
>> Ok, I changed it to when not honoring NANs.
>
>
> Note that I have no idea what guarantees we give in gcc. It is quite
> possible that your patch is fine without this change, I only wanted to raise
> the question in case someone knows.
So looking through, we do guarantee the sign of the NaNs except when
not honoring NaNs in the first place. So the conversion from
a>0?1.0:-1.0 to copysign will be conditional on honoring NaNs. But
the x*copysign(1.0,x) will only conditional on not honoring sNaNs.
>
> --
> Marc Glisse
next prev parent reply other threads:[~2017-06-24 20:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-24 3:59 Andrew Pinski
2017-06-24 3:59 ` Andrew Pinski
2017-06-24 6:50 ` Marc Glisse
2017-06-24 18:51 ` Andrew Pinski
2017-06-24 19:47 ` Marc Glisse
2017-06-24 20:53 ` Andrew Pinski [this message]
2017-06-26 15:02 ` Joseph Myers
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='CA+=Sn1mzbjWx04p5XF30eBSy0qrAfYXyKHrpwcnYi4SEP4EyDg@mail.gmail.com' \
--to=pinskia@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/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).