aix52.h revision 132718
1117395Skan/* Definitions of target machine for GNU compiler,
2117395Skan   for IBM RS/6000 POWER running AIX V5.2.
3132718Skan   Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4117395Skan   Contributed by David Edelsohn (edelsohn@gnu.org).
5117395Skan
6132718Skan   This file is part of GCC.
7117395Skan
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.
12117395Skan
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.
17117395Skan
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.  */
22117395Skan
23117395Skan/* AIX V5 and above support 64-bit executables.  */
24117395Skan#undef  SUBSUBTARGET_SWITCHES
25117395Skan#define SUBSUBTARGET_SWITCHES					\
26117395Skan  {"aix64", 		MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC,	\
27117395Skan   N_("Compile for 64-bit pointers") },					\
28117395Skan  {"aix32",		- (MASK_64BIT | MASK_POWERPC64),		\
29117395Skan   N_("Compile for 32-bit pointers") },					\
30117395Skan  {"pe",		0,						\
31117395Skan   N_("Support message passing with the Parallel Environment") },
32117395Skan
33117395Skan/* Sometimes certain combinations of command options do not make sense
34117395Skan   on a particular target machine.  You can define a macro
35117395Skan   `OVERRIDE_OPTIONS' to take account of this.  This macro, if
36117395Skan   defined, is executed once just after all the command options have
37117395Skan   been parsed.
38117395Skan
39117395Skan   The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
40117395Skan   get control.  */
41117395Skan
42117395Skan#define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2)
43117395Skan#define SUBTARGET_OVERRIDE_OPTIONS					\
44117395Skando {									\
45117395Skan  if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS))		\
46117395Skan    {									\
47117395Skan      target_flags &= ~NON_POWERPC_MASKS;				\
48117395Skan      warning ("-maix64 and POWER architecture are incompatible");	\
49117395Skan    }									\
50117395Skan  if (TARGET_64BIT && ! TARGET_POWERPC64)				\
51117395Skan    {									\
52117395Skan      target_flags |= MASK_POWERPC64;					\
53117395Skan      warning ("-maix64 requires PowerPC64 architecture remain enabled"); \
54117395Skan    }									\
55117395Skan  if (TARGET_POWERPC64 && ! TARGET_64BIT)				\
56117395Skan    {									\
57117395Skan      error ("-maix64 required: 64-bit computation with 32-bit addressing not yet supported"); \
58117395Skan    }									\
59117395Skan} while (0);
60117395Skan
61117395Skan#undef ASM_SPEC
62132718Skan#define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)"
63117395Skan
64132718Skan/* Common ASM definitions used by ASM_SPEC amongst the various targets
65117395Skan   for handling -mcpu=xxx switches.  */
66117395Skan#undef ASM_CPU_SPEC
67117395Skan#define ASM_CPU_SPEC \
68117395Skan"%{!mcpu*: %{!maix64: \
69117395Skan  %{mpowerpc64: -mppc64} \
70117395Skan  %{!mpower64: %(asm_default)}}} \
71132718Skan%{mcpu=power3: -m620} \
72132718Skan%{mcpu=power4: -m620} \
73117395Skan%{mcpu=powerpc: -mppc} \
74117395Skan%{mcpu=rs64a: -mppc} \
75117395Skan%{mcpu=603: -m603} \
76117395Skan%{mcpu=603e: -m603} \
77117395Skan%{mcpu=604: -m604} \
78117395Skan%{mcpu=604e: -m604} \
79132718Skan%{mcpu=620: -m620} \
80132718Skan%{mcpu=630: -m620}"
81117395Skan
82117395Skan#undef	ASM_DEFAULT_SPEC
83117395Skan#define ASM_DEFAULT_SPEC "-mppc"
84117395Skan
85117395Skan#undef TARGET_OS_CPP_BUILTINS
86117395Skan#define TARGET_OS_CPP_BUILTINS()      \
87117395Skan  do                                  \
88117395Skan    {                                 \
89117395Skan      builtin_define ("_IBMR2");      \
90117395Skan      builtin_define ("_POWER");      \
91117395Skan      builtin_define ("_LONG_LONG");  \
92117395Skan      builtin_define ("_AIX");        \
93117395Skan      builtin_define ("_AIX32");      \
94117395Skan      builtin_define ("_AIX41");      \
95117395Skan      builtin_define ("_AIX43");      \
96117395Skan      builtin_define ("_AIX51");      \
97117395Skan      builtin_define ("_AIX52");      \
98117395Skan      builtin_assert ("system=unix"); \
99117395Skan      builtin_assert ("system=aix");  \
100117395Skan    }                                 \
101117395Skan  while (0)
102117395Skan
103117395Skan#undef CPP_SPEC
104117395Skan#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}	\
105117395Skan  %{ansi: -D_ANSI_C_SOURCE}			\
106117395Skan  %{maix64: -D__64BIT__}			\
107117395Skan  %{mpe: -I/usr/lpp/ppe.poe/include}		\
108117395Skan  %{pthread: -D_THREAD_SAFE}"
109117395Skan
110117395Skan/* The GNU C++ standard library requires that these macros be
111117395Skan   defined.  */
112117395Skan#undef CPLUSPLUS_CPP_SPEC
113117395Skan#define CPLUSPLUS_CPP_SPEC			\
114117395Skan  "-D_XOPEN_SOURCE=500				\
115117395Skan   -D_XOPEN_SOURCE_EXTENDED=1			\
116117395Skan   -D_LARGE_FILE_API				\
117117395Skan   -D_ALL_SOURCE				\
118117395Skan   %{maix64: -D__64BIT__}			\
119117395Skan   %{mpe: -I/usr/lpp/ppe.poe/include}		\
120117395Skan   %{pthread: -D_THREAD_SAFE}"
121117395Skan
122117395Skan#undef  TARGET_DEFAULT
123117395Skan#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS)
124117395Skan
125117395Skan#undef  PROCESSOR_DEFAULT
126117395Skan#define PROCESSOR_DEFAULT PROCESSOR_PPC630
127117395Skan#undef  PROCESSOR_DEFAULT64
128117395Skan#define PROCESSOR_DEFAULT64 PROCESSOR_POWER4
129117395Skan
130117395Skan#undef  TARGET_POWER
131117395Skan#define TARGET_POWER 0
132117395Skan
133117395Skan/* Define this macro as a C expression for the initializer of an
134117395Skan   array of string to tell the driver program which options are
135117395Skan   defaults for this target and thus do not need to be handled
136117395Skan   specially when using `MULTILIB_OPTIONS'.
137117395Skan
138117395Skan   Do not define this macro if `MULTILIB_OPTIONS' is not defined in
139117395Skan   the target makefile fragment or if none of the options listed in
140117395Skan   `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
141117395Skan
142117395Skan#undef	MULTILIB_DEFAULTS
143117395Skan
144117395Skan#undef LIB_SPEC
145117395Skan#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
146117395Skan   %{p:-L/lib/profiled -L/usr/lib/profiled}\
147117395Skan   %{!maix64:%{!shared:%{g*:-lg}}}\
148117395Skan   %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
149117395Skan   %{pthread:-lpthreads} -lc"
150117395Skan
151117395Skan#undef LINK_SPEC
152117395Skan#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
153117395Skan   %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\
154117395Skan   %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\
155117395Skan   %{mpe:-binitfini:poe_remote_main}"
156117395Skan
157117395Skan#undef STARTFILE_SPEC
158117395Skan#define STARTFILE_SPEC "%{!shared:\
159117395Skan   %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
160117395Skan   %{!maix64:\
161117395Skan     %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
162117395Skan     %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}"
163117395Skan
164117395Skan/* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
165117395Skan
166117395Skan#undef PTRDIFF_TYPE
167117395Skan#define PTRDIFF_TYPE "long int"
168117395Skan
169117395Skan/* Type used for wchar_t, as a string used in a declaration.  */
170117395Skan#undef  WCHAR_TYPE
171117395Skan#define WCHAR_TYPE (!TARGET_64BIT ? "short unsigned int" : "unsigned int")
172117395Skan
173117395Skan/* Width of wchar_t in bits.  */
174117395Skan#undef  WCHAR_TYPE_SIZE
175117395Skan#define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32)
176117395Skan#define MAX_WCHAR_TYPE_SIZE 32
177117395Skan
178117395Skan/* AIX V5 uses PowerPC nop (ori 0,0,0) instruction as call glue for PowerPC
179117395Skan   and "cror 31,31,31" for POWER architecture.  */
180117395Skan
181117395Skan#undef RS6000_CALL_GLUE
182117395Skan#define RS6000_CALL_GLUE "{cror 31,31,31|nop}"
183117395Skan
184117395Skan/* AIX 4.2 and above provides initialization and finalization function
185117395Skan   support from linker command line.  */
186117395Skan#undef HAS_INIT_SECTION
187117395Skan#define HAS_INIT_SECTION
188117395Skan
189117395Skan#undef LD_INIT_SWITCH
190117395Skan#define LD_INIT_SWITCH "-binitfini"
191132718Skan
192132718Skan/* AIX 5.2 has the float and long double forms of math functions.  */
193132718Skan#undef TARGET_C99_FUNCTIONS
194132718Skan#define TARGET_C99_FUNCTIONS  1
195132718Skan
196