This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFApproval, trunk] Optimization of Complex OP Real.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]