gcc-2.7 creates faster code than pgcc-1.1.1
H.J. Lu
hjl@lucon.org
Thu Mar 4 20:03:00 GMT 1999
>
>
> In message < 199903050001.BAA00973@mira.isdn.cs.tu-berlin.de >you write:
> > > - if ((TARGET_ZERO_EXTEND_WITH_AND || REGNO (operands[0]) == 0)
> > > + if ((TARGET_ZERO_EXTEND_WITH_AND || (0 & REGNO (operands[0]) == 0))
> >
> > It's late, so I'm probably going to say stupid things, but ...
> >
> > Isn't (0 & REGNO (operands[0]) == 0) always 0? Why isn't the condition
> > just deleted?
> Disabling the code like that is actually the wrong thing to do for certain
> processor variants.
>
> I need to dust off my changes to this code which do the right thing when
> optimizing for size, PPro, Pent and older x86 variants.
>
> It's not as simple as just deleting the test like that.
>
Just keep in mind that this small change speeds up gzip by 10-20% on
PPro, P/II and maybe P/III. It may be true also for 386. According
to TARGET_ZERO_EXTEND_WITH_AND, only 486 and Pentium seems to prefer
"and".
BTW, FWIW, "movzbl" has 3 bytes and "addl" has 5 bytes. So "movzbl" is
smaller and faster on 386, PPro, P/II and P/III.
--
H.J. Lu (hjl@gnu.org)
More information about the Gcc
mailing list