3 ms·
> Ah, the olden days of 8086. When xor ax, ax was faster than mov ax, 0 That's still the case today, no?
by Narishma 3y ago
> Ah, the olden days of 8086. When xor ax, ax was faster than mov ax, 0
That's still the case today, no?
- th3typh00n 3y agoYes, for 32- and 64-bit registers. Most modern x86 CPUs has fast paths for 'xor reg, reg' which performs the zeroing using the register renaming mechanism instead of actually executing anything on the back-end. So the only cost is that of decoding the instruction.