Uhm, no, it really doesn't. See how it pairs with other instructions and
what the cost is when it doesn't have to be as bad:
this:
unsigned long a, b;
if (++a == 0) b++;
gives:
movl a, %eax
movl %esp, %ebp
incl %eax
testl %eax, %eax
movl %eax, a
je .L3
.L2:
popl %ebp
ret
.p2align 4,,7
.L3:
incl b
jmp .L2
which is really gross considering that:
unsigned long long c;
c++;
gives:
addl $1, c
adcl $0, c+4
which is quite excellent.
-ben
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/