[xproto: PATCH] Xmd.h: amd64-x32 ABI defines sizeof(long) == sizeof (void*) == 4
Lu, Hongjiu
hongjiu.lu at intel.com
Wed Dec 28 12:29:45 PST 2011
>
> > From: "Lu, Hongjiu" <hongjiu.lu at intel.com>
> > Date: Wed, 28 Dec 2011 14:34:09 +0000
> >
> > __AMD64__ is defined when 64bit x86 instruction set is used,
> > which is true for x32. The difference is x32 doesn't define
> > __LP64__.
>
> Chapter 7, "Development Environment", of the AMD64 ABI (the non-x32
> version) does not list __LP64__ as a predefined pre-processor symbol.
> As far as I'm aware, it's just a GCC convention to define __LP64__ for
> platforms that use the LP64 programming model, and even GCC didn't do
> so very consistently in the past.
__LP64__ isn't the part of x86-64 psABI while GCC always define __LP64__
for 64bit long on x86. I can check if other compilers do the same.
In most cases, __amd64__ is checked for 64bit instructions and we have
ported those we have found so far to x32 so that we can use one __amd64__
block to support both x32 and x86-64.
H.J.
More information about the xorg-devel
mailing list