3 ms·
> IMO, cmov was far more valuable back when it was new, because branches were more expensive then. Branches in general are cheaper now (since they are generall
by Sesse__ 4y ago
> IMO, cmov was far more valuable back when it was new, because branches were more expensive then.
Branches in general are cheaper now (since they are generally predicted better), but mispredicted branches are more expensive. They are similar in terms of cycles (IIRC Pentium 4 and Skylake are both typically around 20 cycles if you don't get second-order effects tacked on), but you generally get a lot more done in those cycles on a newer CPU, so they are much more important than they used to be. And a binary search will, almost by definition, tend to have 50% mispredicted branches on the compare (i.e., entirely unpredictable, so no better than random chance).