public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tim Prince <tprince@myrealbox.com>
To: FX Coudert <fxcoudert@gmail.com>
Cc: gfortran list <fortran@gcc.gnu.org>,
	  gcc-patches list <gcc-patches@gcc.gnu.org>
Subject: Re: [gfortran,patch] Make MIN and MAX handle NaNs correctly (PR32048)
Date: Sat, 28 Jul 2007 18:53:00 -0000	[thread overview]
Message-ID: <46AB8A43.3060209@myrealbox.com> (raw)
In-Reply-To: <B02CF9DC-25CF-43EE-B361-2B7C60789833@gmail.com>

FX Coudert wrote:
> Attached patch makes MIN and MAX intrinsics return correct IEEE 
> results (and consistent results) when given one or more NaN as 
> arguments. It does so by changing the code generated from MAX(a,b) := 
> (b > a ? b : a) into MAX(a,b) := (b > a || isnan(a) ? b : a); handling 
> of multiple arguments is done similarly.
>
> The introduction of isnan() tests probably has a cost, but hey, we 
> want a correct result anyway, don't we? Thus, I added a note into the 
> code saying that when IEEE_ARITHMETIC is implemented, we might want to 
> make this codepath dependent on IEEE_ARITHMETIC being used (I don't 
> think we should do that, but we should certainly discuss the option).
>
Does this affect minval() and maxval() intrinsics?  Up to now, they 
performed as well as equivalent C code with icpc, better than g++, but 
not as well as ifort.  I suppose it removes the prospect of vectorizing 
code with min() and max(), unless that will be enabled with -ffast-math.

  parent reply	other threads:[~2007-07-28 18:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-28 15:03 FX Coudert
2007-07-28 18:26 ` Jerry DeLisle
2007-07-28 18:53 ` Tim Prince [this message]
2007-07-28 20:15   ` Andrew Pinski
2007-07-29 11:08     ` Tim Prince
2007-07-28 20:26   ` FX Coudert
2007-07-29 10:49     ` Paul Thomas
2007-07-29 13:36       ` FX Coudert
2007-08-06 12:18         ` François-Xavier Coudert
2007-08-06 12:32           ` Andrew Pinski
2007-08-03 21:32       ` FX Coudert

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=46AB8A43.3060209@myrealbox.com \
    --to=tprince@myrealbox.com \
    --cc=fortran@gcc.gnu.org \
    --cc=fxcoudert@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tprince@computer.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).