I mean, CPUs go to ridiculous lengths nowadays to increase branch prediciton accuracy but the easiest ways to make sure they are predictable is to make it such that:
if a branch is taken in one iteration, it is also very likely to be taken in the next iteration
A branch is almost always or almost never taken such that the CPU can simply predict the far more likely of the two...
View all comments
Show parent comment
14
u/meamZ Sep 03 '26
I mean, CPUs go to ridiculous lengths nowadays to increase branch prediciton accuracy but the easiest ways to make sure they are predictable is to make it such that: