Re:Principle of Least Astonishment
by saagarjha on Monday April 06, 2020 @01:31PM
(#22795757)
I like how this ends up on the topic of efficient encoding of an x86 instruction that zeroes the accumulator.
[ Parent
| on HN ]
xor reg, reg is the best because it's such an ancient idiom that processors recognize it as a zeroing idiom, enabling some processor-level optimizations.
Now you need to decide whether to use opcode 0x31 or 0x33…
Which one weighs less?