This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, AArch64, ILP32] 5/5 Define _ILP32 and __ILP32__


On Thu, 27 Jun 2013, Yufeng Zhang wrote:

> We need a reliable way to tell we are compiling for ILP32.  On one hand LLP64
> support may be added in the future; on the other hand, not all AArch64

If thinking of adding a third ABI, that suggests you should be using 
something along the lines of _MIPS_SIM - a macro that's always defined, 
with an integer value depending on the ABI in used.

> compilers may define _LP64 and __LP64__.

Why should all such compilers define the ILP32 macros, but not all define 
the LP64 macros?  Do you have an AArch64 equivalent of the ACLE that 
specifies such things?

> Other ports like x86_64, ia64-hpux and pa-hpux also define one or both.

If multiple ports define something, that might be an indication for 
defining it in target-independent code (like _LP64) rather than repeating 
it for more targets.  Although of course the macros __SIZEOF_INT__, 
__SIZEOF_LONG__, __SIZEOF_LONG_LONG__ and __SIZEOF_POINTER__ have been 
around for a long time, so new macros would just be for convenience (which 
may nevertheless be a sensible reason to define macros) at the expense of 
startup time.

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]