2 ms·
I remember Linus making much the same point: http://yarchive.net/comp/linux/cmov.html http://yarchive.net/comp/linux/cmov.html It generally lines up with what
by a_e_k 11y ago
I remember Linus making much the same point: http://yarchive.net/comp/linux/cmov.html http://yarchive.net/comp/linux/cmov.html
It generally lines up with what I've observed. Surprisingly, I've found that even arithmetic comparisons like you mentioned ran a bit faster with branches instead of conditional moves. The one case where I have seen comparisons benefit is with SSE code where the comparison results go straight to a register instead of a flag.