Re: [PATCH] x86: percpu_to_op() misses memory and flags clobbers

From: Jeremy Fitzhardinge
Date: Thu Apr 02 2009 - 10:12:46 EST


Herbert Xu wrote:
Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
There's probably not a lot of value in this. The Intel and AMD optimisation guides tend to deprecate inc/dec in favour of using add/sub, because the former can cause pipeline stalls due to its partial flags update.

Is this still the case on the latest Intel CPUs?

Yes:

Assembly/Compiler Coding Rule 32. (M impact, H generality) INC and DEC
instructions should be replaced with ADD or SUB instructions,
because ADD and
SUB overwrite all flags, whereas INC and DEC do not, therefore
creating false
dependencies on earlier instructions that set the flags.

J
--
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/