inadequate multiply-by-const expansion for pentium4
Jim Wilson
wilson@specifixinc.com
Wed Apr 28 17:14:00 GMT 2004
On Wed, 2004-04-28 at 03:40, Luchezar Belev wrote:
> up to gcc-3.3.3 the costs of the non-add instructions were doubled, but
> in gcc-3.4.0 for some reason this was rejected.
It appears the costs were fixed because a problem was noticed with the
doubled costs. It isn't clear if this was benchmarked though. If you
can show that the doubled costs benchmark better, then they can be put
back.
http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01044.html
> Why to avoid code size expansion when using -O3 or higher?
Because no one else ever noticed or thought of this before. The change
should be benchmarked though to see if it does give better performance.
> At least this limit could be done in some architecture-dependent maner and
> tuned more precisely acording to the arch specifics.
Sure, if you can find something that benchmarks well. I suggested using
both add_cost and shift_cost because we usually get a mixture of shifts
and adds, and shifts are often more expensive than adds. Using add_cost
alone might be limiting us to sequences much shorter than 12
instructions because of shift costs.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
More information about the Gcc
mailing list