4 ms·
> especially seeing how trivial it is in x86 assembly (add the numbers, then check the overflow flag) I'm no expert, especially not on modern x86 processors o
by RaleyField 12y ago
> especially seeing how trivial it is in x86 assembly (add the numbers, then check the overflow flag)
I'm no expert, especially not on modern x86 processors or compilers for them, but I suspect it isn't so trivial as scattering such instructions may affects branch predictor tables and indirectly degrade performance in other parts of code.
- TheLoneWolfling 12y agoYou require one branch regardless, and the trivial version is one branch, i.e. already at the minimum amount of branches.