This is the mail archive of the
mailing list for the glibc project.
Re: PATCH: Add LOAD_ARG[1-6]_TYPE and x32 posix_fallocate.c
- From: Roland McGrath <roland at hack dot frob dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 21 May 2012 14:02:56 -0700 (PDT)
- Subject: Re: PATCH: Add LOAD_ARG[1-6]_TYPE and x32 posix_fallocate.c
- References: <20120519163144.GA1941@intel.com>
That is inordinately ugly.
AFAICT the existing x86_64 behavior for a syscall argument of a
smaller integer type (e.g. int, i.e. int32_t) is to sign-extend that
value to 64 bits in the syscall argument register. So what would be
the practical effect of just making LOAD_ARGS* just use 'long long
int' throughout? It won't make any difference to x86_64, and for x32
it will just sign-extend any signed smaller-typed values (and make no
difference for unsigned types). I think if you actually make it
'unsigned long long int' then that will correctly sign-extend int32_t
(and smaller integer types) but zero-extend pointer types.