Instead of writing mov rax, 1
(7 byte encoding 48, C7, C0, 01, 00, 00, 00), I can write mov eax, 1
(5 byte encoding B8, 01, 00, 00, 00) relying on the automatic
zeroing of the high dword.
For copying RAX to R8, I can choose between mov r8, rax
(3 byte encoding 49, 89, C0) or mov r8d, eax
(3 byte encoding 41, 89, C0) again relying on the automatic zeroing of the high dword.
Is there any ratio at all to prefer one method of copying over the other?
The REX prefix cannot be avoided since R8 is one of the 'new' registers, and so REX.B is needed. Under this circumstance, is it desirable to try to avoid having the REX.W bit set?