r/programming 1d ago

Branch‑Avoidant Programming

https://easylang.online/blog/branchless
231 Upvotes

87 comments sorted by

View all comments

-3

u/OSS-Corpo-Shit 20h ago edited 20h ago

If I read this article and it is fucking hidden vtables again, I am going to lose my mind.

Edit -

It wasn’t, but it also seems that the branch less solution was only branch less due to mapping directly to an instruction.

For me, this is really more of less saying

“Have a good idea of at least some instructions your architecture provides, and understand if your backend uses them or not.”

That’s a pretty heavy ask. 

4

u/nukethebees 17h ago

That’s a pretty heavy ask.

Are there many popular microarchitectures which don't have conditional move instructions? ARM and x86 have them and they comprise most of the general purpose CPU market.

1

u/OSS-Corpo-Shit 14h ago

It is a heavy ask because by far most developers will respond to “you should have an idea of certain easy to exploit performance idioms” with

“thEReS IO InVolVeD. PRemAtURe OpTimizAtIoN.”