2 ms·
Interesting! Godbolt if anyone is interested: https://godbolt.org/z/1QlLyG https://godbolt.org/z/1QlLyG Both loops get entirely unrolled. Its 5 instructions fo
by josephg 7y ago
Interesting! Godbolt if anyone is interested: https://godbolt.org/z/1QlLyG https://godbolt.org/z/1QlLyG
Both loops get entirely unrolled. Its 5 instructions for each iteration in the first example, and only 3 in the second example. (To say nothing of the fact that conditional jumps are (usually?) much more expensive than add/mov instructions)