Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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: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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: