▲ | Someone 2 days ago | |
Size isn’t everything. You should start by reading the manual for your CPU to see what it advises. The micro-architecture may treat only one of the sequences specially. For modern x64, I think that indeed is the shorter xor sequence, where, internally, the CPU just renames the register to a register that always contains zero, making the instruction independent of any earlier instructions using eax. IIRC, Intel said a mov was the way to go for some now ancient x86 CPUs, though. |