This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC PATCH]: Fold (A / A) to 1.0 (not always!)
- From: Paul Brook <paul at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org,ubizjak at gmail dot com
- Cc: paolo dot bonzini at lu dot unisi dot ch
- Date: Wed, 26 Oct 2005 13:43:59 +0100
- Subject: Re: [RFC PATCH]: Fold (A / A) to 1.0 (not always!)
- References: <1130322548.435f5a7449de5@ssl.kss-loka.si>
On Wednesday 26 October 2005 11:29, Uros Bizjak wrote:
> Hello!
>
> This patch should fold (A / A) to 1.0 when A doesn't equal 0.0 (in this
> case, NaN is returned). AFAIK, this transformation is valid only for
> -fno-trapping-math (because 0.0 / 0.0 traps) and for -ffinite-math-only.
The docs for -ffinite-math-old say
"[...] assume that arguments and results are not NaNs [...]"
ie. we can fold this to 1.0 unconditionally.
Paul