The brach predictor it's the bane of programmers. It forces to waste effort to write unreadable branchless code.
X86 should support no-branch-predict-if and dont-predict-goto
X86 should support no-branch-predict-if and dont-predict-goto
> X86 should support no-branch-predict-if
It almost does. You can use __builtin_expect to hint if the branch is predictable - like assertions. Don't annotate conditionals if they're truly unpredictable. The branch predictor will run, but it's not expensive.