public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "joseph at codesourcery dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/57994] Constant folding of infinity
Date: Sun, 28 Jul 2013 16:38:00 -0000	[thread overview]
Message-ID: <bug-57994-4-oPZNJOVANQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-57994-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57994

--- Comment #11 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
On Sat, 27 Jul 2013, glisse at gcc dot gnu.org wrote:

> Yeah, any of those. I was inspired by glibc, which has for instance:
> 
> double
> __fdim (double x, double y)
> {
>   int clsx = fpclassify (x);
>   int clsy = fpclassify (y);
> 
>   if (clsx == FP_NAN || clsy == FP_NAN
>       || (y < 0 && clsx == FP_INFINITE && clsy == FP_INFINITE))
>     /* Raise invalid flag.  */
>     return x - y;
> 
> which looks like it expects QNaN-QNaN to set the invalid flag.

Such comments must be understood to be written on the assumption that the 
reader is familiar with the desired IEEE semantics - that is, that the 
flags is raised if and only if a NaN argument is a signaling NaN (and such 
arithmetic patterns on input NaNs, to ensure that "invalid" is raised if 
either NaN is signaling, and otherwise that an input NaN's significand is 
preserved, are very common in glibc).


  parent reply	other threads:[~2013-07-28 16:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 15:13 [Bug tree-optimization/57994] New: " glisse at gcc dot gnu.org
2013-07-26 15:16 ` [Bug tree-optimization/57994] " paolo.carlini at oracle dot com
2013-07-26 21:53 ` joseph at codesourcery dot com
2013-07-27  0:15 ` paolo.carlini at oracle dot com
2013-07-27 19:53 ` paolo.carlini at oracle dot com
2013-07-27 20:10 ` joseph at codesourcery dot com
2013-07-27 20:10 ` glisse at gcc dot gnu.org
2013-07-27 20:26 ` paolo.carlini at oracle dot com
2013-07-27 20:31 ` glisse at gcc dot gnu.org
2013-07-27 20:46 ` paolo.carlini at oracle dot com
2013-07-28 16:38 ` joseph at codesourcery dot com [this message]
2013-07-28 17:40 ` vincent-gcc at vinc17 dot net
2013-08-01 20:55 ` vincent-gcc at vinc17 dot net
2013-08-02 23:23 ` paolo.carlini at oracle dot com
2013-08-27 17:34 ` vincent-gcc at vinc17 dot net
2013-10-24 12:27 ` paolo.carlini at oracle dot com
2013-10-24 12:35 ` paolo.carlini at oracle dot com
2013-10-24 12:40 ` paolo.carlini at oracle dot com
2013-10-24 13:01 ` paolo.carlini at oracle dot com
2013-10-24 13:08 ` paolo.carlini at oracle dot com
2013-10-24 15:29 ` vincent-gcc at vinc17 dot net
2013-10-24 15:42 ` vincent-gcc at vinc17 dot net
2013-10-24 15:51 ` paolo.carlini at oracle dot com
2014-04-22 11:36 ` jakub at gcc dot gnu.org
2014-07-16 13:29 ` jakub at gcc dot gnu.org
2014-10-30 10:43 ` jakub at gcc dot gnu.org
2015-06-26 20:07 ` jakub at gcc dot gnu.org
2015-06-26 20:35 ` jakub at gcc dot gnu.org
2015-06-26 21:20 ` pinskia at gcc dot gnu.org

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=bug-57994-4-oPZNJOVANQ@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).