Re: Question about AMD64 ABI
- Reply: Paul Procacci : "Re: Question about AMD64 ABI"
- In reply to: Daniel Cervus : "Re: Question about AMD64 ABI"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Nov 2022 02:19:13 UTC
Again, most compilers are smart enough to perhaps `and reg, 0x0FFFF` or simply ignore the high bits on its own, but ultimately you do feed it the entire register in which if the callee expects to operate on 16-bits or smaller it better do so. So I had better zero-extend it to 32 bit, right? Why not 64, because it’s already safe enough? Or just because the higher 32 bits can be automatically cleared?