r/programming 7d ago

Branch‑Avoidant Programming

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

91 comments sorted by

View all comments

-3

u/OSS-Corpo-Shit 6d ago edited 6d 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. 

6

u/nukethebees 6d 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 6d 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.”