x86 ashlsi3 improvements

Jeffrey A Law law@hurl.cygnus.com
Tue Mar 9 00:19:00 GMT 1999


  In message <19990218101301.A16285@horac.ta.jcu.cz>you write:
  > I've done some benchmarking here and win of lea over sal is not clear.
Neither is going to be perfect.  I'm sure we can both point point to codes
which perform better with one code generation strategy or another if given a
little time.  The goal is to have something that is generally better, and
which will continue to improve over time as we improve scheduling for the
Pentium and PPro/PII processors.


  > You need to take into account important property of lea - it is executed
  > in operand fetch pass, so its operands have memory adress behaviour - they
  > need to be ready one cycle before lea is executed otherwise AGI stall
  > happends.
Yes.  I'm aware of AGI stalls.

One thing we can do to mitigate this would be to use a shift instruction if the
instruction is believed to be the first in an issue bundle.  This can be
determined by looking at the mode of the insn.  If it is not TImode, then the
insn is expected to be the 1st insn in an issue bundle, meaning it is expected
to issue into the U pipe and we should use sal over lea.

This will avoid many of the AGI stalls, and over time as the x86 port improves
in terms of Pentium scheduling this scheme will improve along the way too.

jeff


More information about the Gcc-patches mailing list