aix51.h revision 132718
190075Sobrien/* Definitions of target machine for GNU compiler, 290075Sobrien for IBM RS/6000 POWER running AIX V5. 3132718Skan Copyright (C) 2001, 2003 Free Software Foundation, Inc. 490075Sobrien Contributed by David Edelsohn (edelsohn@gnu.org). 590075Sobrien 6132718Skan This file is part of GCC. 790075Sobrien 8132718Skan GCC is free software; you can redistribute it and/or modify it 9132718Skan under the terms of the GNU General Public License as published 10132718Skan by the Free Software Foundation; either version 2, or (at your 11132718Skan option) any later version. 1290075Sobrien 13132718Skan GCC is distributed in the hope that it will be useful, but WITHOUT 14132718Skan ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 15132718Skan or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public 16132718Skan License for more details. 1790075Sobrien 18132718Skan You should have received a copy of the GNU General Public License 19132718Skan along with GCC; see the file COPYING. If not, write to the 20132718Skan Free Software Foundation, 59 Temple Place - Suite 330, Boston, 21132718Skan MA 02111-1307, USA. */ 2290075Sobrien 2390075Sobrien/* AIX V5 and above support 64-bit executables. */ 2490075Sobrien#undef SUBSUBTARGET_SWITCHES 2590075Sobrien#define SUBSUBTARGET_SWITCHES \ 2690075Sobrien {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC, \ 2790075Sobrien N_("Compile for 64-bit pointers") }, \ 2890075Sobrien {"aix32", - (MASK_64BIT | MASK_POWERPC64), \ 2990075Sobrien N_("Compile for 32-bit pointers") }, \ 3090075Sobrien {"pe", 0, \ 3190075Sobrien N_("Support message passing with the Parallel Environment") }, 3290075Sobrien 3390075Sobrien/* Sometimes certain combinations of command options do not make sense 3490075Sobrien on a particular target machine. You can define a macro 3590075Sobrien `OVERRIDE_OPTIONS' to take account of this. This macro, if 3690075Sobrien defined, is executed once just after all the command options have 3790075Sobrien been parsed. 3890075Sobrien 3990075Sobrien The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to 4090075Sobrien get control. */ 4190075Sobrien 4290075Sobrien#define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) 4390075Sobrien#define SUBTARGET_OVERRIDE_OPTIONS \ 4490075Sobriendo { \ 4590075Sobrien if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ 4690075Sobrien { \ 4790075Sobrien target_flags &= ~NON_POWERPC_MASKS; \ 4890075Sobrien warning ("-maix64 and POWER architecture are incompatible"); \ 4990075Sobrien } \ 5090075Sobrien if (TARGET_64BIT && ! TARGET_POWERPC64) \ 5190075Sobrien { \ 5290075Sobrien target_flags |= MASK_POWERPC64; \ 5390075Sobrien warning ("-maix64 requires PowerPC64 architecture remain enabled"); \ 5490075Sobrien } \ 5590075Sobrien if (TARGET_POWERPC64 && ! TARGET_64BIT) \ 5690075Sobrien { \ 5790075Sobrien error ("-maix64 required: 64-bit computation with 32-bit addressing not yet supported"); \ 5890075Sobrien } \ 5990075Sobrien} while (0); 6090075Sobrien 6190075Sobrien#undef ASM_SPEC 62132718Skan#define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)" 6390075Sobrien 64132718Skan/* Common ASM definitions used by ASM_SPEC amongst the various targets 6590075Sobrien for handling -mcpu=xxx switches. */ 6690075Sobrien#undef ASM_CPU_SPEC 6790075Sobrien#define ASM_CPU_SPEC \ 6890075Sobrien"%{!mcpu*: %{!maix64: \ 6990075Sobrien %{mpower: %{!mpower2: -mpwr}} \ 7090075Sobrien %{mpower2: -mpwr2} \ 7190075Sobrien %{mpowerpc*: %{!mpowerpc64: -mppc}} \ 7290075Sobrien %{mpowerpc64: -mppc64} \ 7390075Sobrien %{!mpower*: %{!mpowerpc*: %(asm_default)}}}} \ 7490075Sobrien%{mcpu=common: -mcom} \ 7590075Sobrien%{mcpu=power: -mpwr} \ 7690075Sobrien%{mcpu=power2: -mpwr2} \ 77132718Skan%{mcpu=power3: -m620} \ 78132718Skan%{mcpu=power4: -m620} \ 7990075Sobrien%{mcpu=powerpc: -mppc} \ 8090075Sobrien%{mcpu=rios: -mpwr} \ 8190075Sobrien%{mcpu=rios1: -mpwr} \ 8290075Sobrien%{mcpu=rios2: -mpwr2} \ 8390075Sobrien%{mcpu=rsc: -mpwr} \ 8490075Sobrien%{mcpu=rsc1: -mpwr} \ 8590075Sobrien%{mcpu=rs64a: -mppc} \ 8690075Sobrien%{mcpu=601: -m601} \ 8790075Sobrien%{mcpu=602: -mppc} \ 8890075Sobrien%{mcpu=603: -m603} \ 8990075Sobrien%{mcpu=603e: -m603} \ 9090075Sobrien%{mcpu=604: -m604} \ 9190075Sobrien%{mcpu=604e: -m604} \ 92132718Skan%{mcpu=620: -m620} \ 93132718Skan%{mcpu=630: -m620}" 9490075Sobrien 9590075Sobrien#undef ASM_DEFAULT_SPEC 9690075Sobrien#define ASM_DEFAULT_SPEC "-mcom" 9790075Sobrien 98117395Skan#undef TARGET_OS_CPP_BUILTINS 99117395Skan#define TARGET_OS_CPP_BUILTINS() \ 100117395Skan do \ 101117395Skan { \ 102117395Skan builtin_define ("_IBMR2"); \ 103117395Skan builtin_define ("_POWER"); \ 104117395Skan builtin_define ("_LONG_LONG"); \ 105117395Skan builtin_define ("_AIX"); \ 106117395Skan builtin_define ("_AIX32"); \ 107117395Skan builtin_define ("_AIX41"); \ 108117395Skan builtin_define ("_AIX43"); \ 109117395Skan builtin_define ("_AIX51"); \ 110117395Skan builtin_assert ("system=unix"); \ 111117395Skan builtin_assert ("system=aix"); \ 112117395Skan } \ 113117395Skan while (0) 11490075Sobrien 11590075Sobrien#undef CPP_SPEC 116117395Skan#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \ 117117395Skan %{ansi: -D_ANSI_C_SOURCE} \ 118117395Skan %{maix64: -D__64BIT__} \ 119117395Skan %{mpe: -I/usr/lpp/ppe.poe/include} \ 120117395Skan %{pthread: -D_THREAD_SAFE}" 12190075Sobrien 12290075Sobrien/* The GNU C++ standard library requires that these macros be 12390075Sobrien defined. */ 12490075Sobrien#undef CPLUSPLUS_CPP_SPEC 125117395Skan#define CPLUSPLUS_CPP_SPEC \ 126117395Skan "-D_XOPEN_SOURCE=500 \ 127117395Skan -D_XOPEN_SOURCE_EXTENDED=1 \ 128117395Skan -D_LARGE_FILE_API \ 129117395Skan -D_ALL_SOURCE \ 130117395Skan %{maix64: -D__64BIT__} \ 131117395Skan %{mpe: -I/usr/lpp/ppe.poe/include} \ 132117395Skan %{pthread: -D_THREAD_SAFE}" 13390075Sobrien 13490075Sobrien#undef TARGET_DEFAULT 13590075Sobrien#define TARGET_DEFAULT MASK_NEW_MNEMONICS 13690075Sobrien 13790075Sobrien#undef PROCESSOR_DEFAULT 138117395Skan#define PROCESSOR_DEFAULT PROCESSOR_PPC604e 13990075Sobrien 14090075Sobrien/* Define this macro as a C expression for the initializer of an 14190075Sobrien array of string to tell the driver program which options are 14290075Sobrien defaults for this target and thus do not need to be handled 14390075Sobrien specially when using `MULTILIB_OPTIONS'. 14490075Sobrien 14590075Sobrien Do not define this macro if `MULTILIB_OPTIONS' is not defined in 14690075Sobrien the target makefile fragment or if none of the options listed in 14790075Sobrien `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ 14890075Sobrien 14990075Sobrien#undef MULTILIB_DEFAULTS 15090075Sobrien#define MULTILIB_DEFAULTS { "mcpu=common" } 15190075Sobrien 15290075Sobrien#undef LIB_SPEC 15390075Sobrien#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\ 15490075Sobrien %{p:-L/lib/profiled -L/usr/lib/profiled}\ 15590075Sobrien %{!maix64:%{!shared:%{g*:-lg}}}\ 15690075Sobrien %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\ 15790075Sobrien %{pthread:-lpthreads} -lc" 15890075Sobrien 15990075Sobrien#undef LINK_SPEC 16090075Sobrien#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ 16190075Sobrien %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ 162102780Skan %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ 163102780Skan %{mpe:-binitfini:poe_remote_main}" 16490075Sobrien 16590075Sobrien#undef STARTFILE_SPEC 16690075Sobrien#define STARTFILE_SPEC "%{!shared:\ 167102780Skan %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ 168102780Skan %{!maix64:\ 169102780Skan %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ 170102780Skan %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}" 17190075Sobrien 17290075Sobrien/* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */ 17390075Sobrien 17490075Sobrien#undef PTRDIFF_TYPE 17590075Sobrien#define PTRDIFF_TYPE "long int" 17690075Sobrien 17796263Sobrien/* Type used for wchar_t, as a string used in a declaration. */ 17896263Sobrien#undef WCHAR_TYPE 17996263Sobrien#define WCHAR_TYPE (!TARGET_64BIT ? "short unsigned int" : "unsigned int") 18096263Sobrien 18190075Sobrien/* Width of wchar_t in bits. */ 18296263Sobrien#undef WCHAR_TYPE_SIZE 18390075Sobrien#define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32) 18490075Sobrien#define MAX_WCHAR_TYPE_SIZE 32 18590075Sobrien 18690075Sobrien/* AIX V5 uses PowerPC nop (ori 0,0,0) instruction as call glue for PowerPC 18790075Sobrien and "cror 31,31,31" for POWER architecture. */ 18890075Sobrien 18990075Sobrien#undef RS6000_CALL_GLUE 19090075Sobrien#define RS6000_CALL_GLUE "{cror 31,31,31|nop}" 19190075Sobrien 19290075Sobrien/* AIX 4.2 and above provides initialization and finalization function 19390075Sobrien support from linker command line. */ 19490075Sobrien#undef HAS_INIT_SECTION 19590075Sobrien#define HAS_INIT_SECTION 19690075Sobrien 19790075Sobrien#undef LD_INIT_SWITCH 19890075Sobrien#define LD_INIT_SWITCH "-binitfini" 199132718Skan 200132718Skan/* AIX 5.1 has the float and long double forms of math functions. */ 201132718Skan#undef TARGET_C99_FUNCTIONS 202132718Skan#define TARGET_C99_FUNCTIONS 1 203132718Skan 204