This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFApproval, trunk] Optimization of Complex OP Real.
- From: Toon Moene <moene at knmi dot nl>
- To: rth at redhat dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 May 2002 07:10:29 +0000
- Subject: Re: [RFApproval, trunk] Optimization of Complex OP Real.
- Organization: Royal Netherlands Meteorological Institute
Richard wrote:
> On Fri, May 17, 2002 at 12:06:07AM +0200, Toon Moene wrote:
> > No, what I want is:
> >
> > ((REAL) == 0 || (flag_unsafe_math_optimizations
> > && (CLASS) == MODE_COMPLEX_FLOAT
> > && (REAL) == const0_rtx))
> Hum. I don't think I understand then.
> Looking at this closer,
> (1) I don't see what flag_unsafe_math_optimizations has to
> do with this. Why is
> complex double cx;
> cx += 1.0
> different from
> cx += (1.0 + 0.0i)
Not in this example, but you cannot in general loose 0.0 * var or 0.0 /
var because the outcome of this computation might be NaN and not 0.0.
I don't off-hand see how I could make this distinction for * and / and
not for + and -, but perhaps I'm just not looking hard enough.
(2) Using const0_rtx is *definitely* wrong. That's an integer
constant. So the comparison will always be false. You want
CONST0_RTX (submode)
which will get you a floating point zero.
Whoops - am I glad someone who actually knows this stuff looks at it !
Thanks for reviewing !
--
Toon Moene, KNMI, PO Box 201, 3730 AE De Bilt, The Netherlands.
Tel. +31302206443, Fax +31302210407, e-mail moene@knmi.nl
URL: http://www.knmi.nl/hirlam