Add __ILP32 and __ILP32__ for X32 programming model

5 views
Skip to first unread message

H.J. Lu

unread,
Apr 13, 2012, 12:18:32 PM4/13/12
to x32...@googlegroups.com, GCC Development, GNU C Library
Hi,

We need a reliable way to tell if we are compiling for x32 through
pre-defined preprocessor symbol. __LP64/__LP64__ aren't
specified by x86-64 psABI, although they have been added to
GCC 3.3. They can't be counted on to detect x32 since not x86-64
compilers define them. I updated x32 psABI:

https://sites.google.com/site/x32abi/documents

to define __ILP32 and __ILP32__ for X32 programming model. I
will submit a patch for GCC trunk and 4.7 branch.

Thanks.

--
H.J.

H. Peter Anvin

unread,
Apr 13, 2012, 12:40:25 PM4/13/12
to x32...@googlegroups.com, H.J. Lu, GCC Development, GNU C Library

Can we add __LP64__ to the psABI too?

-hpa


H.J. Lu

unread,
Apr 13, 2012, 12:44:25 PM4/13/12
to H. Peter Anvin, x32...@googlegroups.com, GCC Development, GNU C Library

X32 psABI has

__amd64 Defined for both LP64 and X32 programming models.
__amd64__ Defined for both LP64 and X32 programming models.
__x86_64 Defined for both LP64 and X32 programming models.
__x86_64__ Defined for both LP64 and X32 programming models.
__LP64 Defined for LP64 programming model.
__LP64__ Defined for LP64 programming model.
__ILP32 Defined for X32 programming model.
__ILP32__ Defined for X32 programming model.


--
H.J.

Reply all
Reply to author
Forward
0 new messages