I read this article and I noticed the instructions jz. It made me think:
Will this code in the assembly taken at face value
for (int i=max;i!=0;--i){
}
outperform this code?
for (int i=0;i<max;++i){
}
As long as you do not care that your data is processed with an increase i, there is no semantic difference. Cached misses should not suffer either, because they can work consistently anyway.
I am not good at assembly to write examples, but I think that the first example will use only jz. The second will use cmp, then a jg, as well as another variable max. In the first example, only a loop counter is needed, since it is 0implicit.
, , , .