Hacker News new | ask | show | jobs
by idunnoman1222 501 days ago
Unless you’re writing an essay on why you’re right…
2 comments

> Unless you’re writing an essay on why you’re right…

He's writing an essay on why they are wrong.

"But here's the problem - when seeing code like this, somebody somewhere will invariably propose the following "optimization", which replaces what they believe (erroneously) are "conditional branches" by arithmetical operations."

Hence his branchless codegen samples are sufficient.

Further, regarding.the side-issue "The second wrong thing with the supposedly optimizer [sic] version is that it actually runs much slower", no amount of codegen is going to show lower /speed/.

The other either optimizes the same, or has an additional multiplication, and it's definitely less readable.