Re:The Weird Concept of Branchless Programming
by adastra22 on Monday September 29, 2025 @01:17AM
(#45410526)
I think you’re missing the context: that good branch prediction is what causes these security holes. “Wasteful” multi path execution is a security feature.
Re:The Weird Concept of Branchless Programming
by jasonwatkinspdx on Tuesday September 30, 2025 @09:48PM
(#45433489)
No, security vulnerabilities are orthogonal. There's nothing about branch prediction that necessitates leaking information, as demonstrated by the fixes shipped in current processors.
It doesn't require duplicating everything. You just need to add some additional booking of dependencies and what to retire vs kill at the end of the pipeline.
In practice branch predictors are so good that speculating off the "spine" of most likely path just isn't worth it.
In fact there were a lot of interesting microarchitectural ideas in the late 90s to early 00s that just ended up being moot because the combination of OoO speculation, branch predictors, and big caches proved so effective.