On Fri, Dec 31, 2010 at 2:03 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Thu, Dec 30, 2010 at 01:42:05PM -0800, H. Peter Anvin wrote: >> On 12/30/2010 11:57 AM, Jakub Jelinek wrote: >> >> >> >> Would be nice if LFS would be mandatory on the new ABI, thus >> >> off_t being 64bits. >> > >> > And avoid ambiguous cases that x86-64 ABI has, e.g. whether >> > caller or callee is responsible for sign/zero extension of arguments, to >> > avoid the need to sign/zero extend twice, etc. >> > >> >> Ehwhat? x86-64 is completely unambiguous on that point; the i386 one is >> not. > > It is not, sadly, see http://gcc.gnu.org/PR46942 > From what I can see the psABI doesn't talk about it, GCC usually sign/zero > extends on both sides (exception is 32-bit arguments into 64-bit isn't > apparently sign/zero extended on the caller side when doing tail calls), > from what I gathered LLVM expects the caller to sign/zero extend (which is > incompatible with GCC tail calls then), not sure about ICC, and kernel > probably expects for security reasons that the callee sign/zero extends. > > Jakub >
I added --- When a value of type signed/unsigned char or short is returned or passed in a register or on the stack, it should be sign/zero extended to signed/unsigned int. --- to hjl/extension branch at http://git.kernel.org/?p=devel/binutils/hjl/x86-64-psabi.git;a=summary -- H.J.