Intel ARCHITECTURE IA-32 User Manual
Page 177

General Optimization Guidelines
2
2-105
Assembly/Compiler Coding Rule 42. (M impact, H generality)
and
dec
instructions should be replaced with an
add
or
sub
instruction,
because
add
and
sub
overwrite all flags, whereas inc and dec do not,
therefore creating false dependencies on earlier instructions that set the
flags. 2-73
Assembly/Compiler Coding Rule 43. (ML impact, L generality) Avoid
rotate
by register or
rotate
by immediate instructions. If possible,
replace with a
rotate
by 1 instruction. 2-74
Assembly/Compiler Coding Rule 46. (M impact, MH generality)
Break dependences on portions of registers between instructions by
operating on 32-bit registers instead of partial registers. For moves, this
can be accomplished with 32-bit moves or by using
. 2-76
Assembly/Compiler Coding Rule 49. (M impact, ML generality) Use
xor
,
sub
, or
pxor
to set a register to
0
, or to break a false dependence
chain resulting from re-use of registers. In contexts where the condition
codes must be preserved, move
0
into the register instead. This requires
more code space than using
xor
and
sub
, but avoids setting the condition
codes. 2-78
Assembly/Compiler Coding Rule 50. (ML impact, M generality) Use
the
test
instruction instead of
and
when the result of the logical
and
is
not used. This saves uops in execution. Use a
test
if a register with itself