Ian Lance Taylor wrote:
John Fine <johnsfine@xxxxxxxxxxx> writes:
When an unsigned int is passed or returned in a 64-bit register, does
either the C or C++ ABI specify that the top half of the register
contain zero?
There are threads on the subject at
http://groups.google.com/group/ia32-abi/browse_thread/thread/f47e0106b21d9269
http://gcc.gnu.org/ml/gcc/2008-01/msg00052.html
Short answer: the ABI does not specify, and gcc's behaviour has
recently changed.
Thankyou, but I don't believe those threads address the same question.
IIUC, those discuss extending a value smaller than int in a register
whose size is the same as int, in an architecture that isn't x86_64.
Also that is a situation where the performance optimal design choice for
the ABI would be not extending.
I'm asking about values whose size is the same as int in registers that
are bigger in an architecture where the performance optimal design
choice would be extending.
I'm not saying I assume such choices have been made with enough
attention to architecture specific considerations that the difference in
the performance factor alone would make me disregard those threads. I'm
saying (and correct me if you are seeing something I'm missing) that
those threads are very specific to are architecture and case that are
quite different from the one I asked about.