INC vs. ADD RAX, 1 and DEC vs. SUB RAX, 1
gaul opened this issue · comments
Andrew Gaul commented
This has some nuance since INC
and DEC
partially update flags but these can be the same speed but smaller than ADD RAX, 1
and SUB RAX, 1
on modern CPUs:
https://stackoverflow.com/a/36510865
and much faster on one AMD variant: