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 Henderson wrote:

> On Thu, May 09, 2002 at 09:47:51PM +0200, Toon Moene wrote:
> > + #define COMPLEX_REAL_PART_ZERO_P(REAL, CLASS) ((REAL) == 0 || \
> > +     flag_unsafe_math_optimizations \
> > +             && (CLASS) == MODE_COMPLEX_FLOAT \
> > +             && (REAL) == const0_rtx)

> Parenthesis problem.  You want
> 
>         (((REAL) == 0 || flag_unsafe_math_optimizations)
>          && (CLASS) == MODE_COMPLEX_FLOAT
>          && (REAL) == const0_rtx)

No, what I want is:

        ((REAL) == 0 || (flag_unsafe_math_optimizations
         && (CLASS) == MODE_COMPLEX_FLOAT
         && (REAL) == const0_rtx))

and, according to table 2-1 on page 53 of K&R II, this *is* the
interpretation of the unparenthetical expression.

> > + #define COMPLEX_IMAG_PART_ZERO_P(IMAG, CLASS) ((IMAG) == 0 || \
> > +     flag_unsafe_math_optimizations \
> > +             && (CLASS) == MODE_COMPLEX_FLOAT \
> > +             && (IMAG) == const0_rtx)
> 
> I don't see the point of having both of these, since they are
> identical.  Also, lets avoid gratuitous macros when we can.
> Make this a static inline function.

OK, I'll send in a second proposal on Saturday.

Thanks for reviewing !

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


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