Re:CPU branch prediction evolution over years
by astrange on Sunday January 01, 2023 @04:08AM
(#34204850)
It almost always doesn’t work; if a branch can eliminate a single uncached memory read you’d want to keep that branch.
It’s mostly used for things like min/max operations in cases when you don’t have cmov. Or bitwise SIMD programming.
"Branchless programming" is an umbrella term for techniques in existing programming languages to avoid branches.