6 ms·
One results in MOVSX, the other in MOVZX [1]. The difference thus is sign/zero extension when moving to the larger register. However, they seem to perform prett
by ygra 3y ago
One results in MOVSX, the other in MOVZX [1]. The difference thus is sign/zero extension when moving to the larger register. However, they seem to perform pretty much identical if I'm reading Agner Fog's instruction tables correctly.
[1] https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACR2DC2A3utmbjnEgGzYCWAdsNgLIAUEAFgPYBOzEAJTYAvAD5sEANylyWXDXpNWCDj36Th47G0bBBbAK56Dhrn32SZaAL5A=== https://sharplab.io/#v2:C4LghgzgtgPgAgJgIwFgBQcDMACR2DC2A3ut...
EDIT: Ah, the other reply notes that this is likely only visible in a method that also does calculations and thus keeps those values in registers.