From Ira Baxter answer on, Why do the INC and DEC instructions not affect the Carry Flag (CF)?
Mostly, I stay away from
INC
andDEC
Depending on the CPU implementation of the instructions, a partial register update may cause a stall. According to Agner Fog's optimization guide, page 62,
For historical reasons, the
INC
andDEC
instructions leave the carry flag unchanged, while the other arithmetic flags are written to. This causes a false dependence on the previous value of the flags and costs an extra μop. To avoid these problems, it is recommended that you always useADD
andSUB
instead ofINC
andDEC
. For example,INC EAX
should be replaced byADD EAX,1
.
See also page 83 on "Partial flags stalls" and page 100 on "Partial flags stall".