Hacker News new | ask | show | jobs
by tantalor 459 days ago
I don't get it. Isn't this what compilers are for? So I don't have to rewrite my code in an equivalent but stupider way just to get a marginal performance gain.
2 comments

I think what you're missing is that the premise of a hardware bug is just a frame story for a lesson in manipulating logical statements, which is the main point.
Okay, it's just incredibly contrived.

You might as well replace "hardware bug" with "a wizard put a curse on the OR operator" or "the president put a tariff on OR imports", and it would be more believable.

Presumably, the compiler is not aware of the hardware bug in the OR operation, so it won't do any transforms to avoid using the OR operation.
Okay so... then patch the compiler? This is basic stuff.
If it were "basic stuff", then you probably weren't using a high performance compiler to begin with.