upvote
Yeah. I'm surprised this along with the money thing are listed in the article at all. These are the sort of things you learn within the first month of writing assembly, and were widely used across the industry at the time (and times prior). The bit shifting optimization is performed by GCC even at -O0, and likely already was at the time, as it's one of the simpler optimizations to make. It's like calling "xor eax, eax" a masterful optimization tactic for clearing a register.

Looking at the macro-level optimizations like the rest of the article does is significantly more interesting.

reply
"XOR AXAX" was my license plate in the 90s.
reply
I had "PUSH EAX" and "BX LR" :)
reply
That whole section is kind of weird. The mention of operator overloading also seems out of place, since the operator is not overloaded here at all.
reply
Yeah and this can be verified with the minimum level of research you'd expect for this kind of article, e.g. by firing up compiler explorer.
reply
they will do it for unsigned. for signed they will do a bit more to do the same rounding as C promises
reply
It's unfortunate that C tied overflow behavior to the signedness of integer types.
reply