Re: 2.6.13/14 x86 Makefile - Pentiums penalized ?

From: Denis Vlasenko
Date: Wed Sep 14 2005 - 02:55:12 EST


>
> In the Intel Architecture Optimization document it specifically states
> (Chapter 2.6) :
> "Avoid instructions that unnecessarily introduce dependence-related
> stalls: inc and dec instructions, .....".
> And again on page 2-11 :
> "The inc and dec instructions should always be avoided. Using add and
> sub instructions instead avoids data dependence and improves performance".
> And on page 2-71 :
> "The inc and dec instructions modify only a subset of flags in the flag
> register.
> This creates a dependence on all previous writes of the flag register.
> This is especially problematic when these instructions are on the critical
> path because they are used to change an address for a load on which
> many other instructions depend. "

Well it sounds dramatic but in reality I doubt it is such a big deal.

Anyone to bench it?

> However, the kernel include and arch have a liberal sprinkling of inc/dec,
> and AFAICT some of these in hot-path.
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/