]> gcc.gnu.org Git - gcc.git/blame - gcc/config/rs6000/aix72.h
Add -mcpu=power11 support.
[gcc.git] / gcc / config / rs6000 / aix72.h
CommitLineData
39667263 1// SPDX-License-Identifier: GPL-3.0-or-later
74fc2a2b
DE
2/* Definitions of target machine for GNU compiler,
3 for IBM RS/6000 POWER running AIX V7.2.
a945c346 4 Copyright (C) 2002-2024 Free Software Foundation, Inc.
74fc2a2b
DE
5 Contributed by David Edelsohn (edelsohn@gnu.org).
6
7 This file is part of GCC.
8
9 GCC is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 3, or (at your
12 option) any later version.
13
14 GCC is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with GCC; see the file COPYING3. If not see
21 <http://www.gnu.org/licenses/>. */
22
23/* The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
24 get control in TARGET_OPTION_OVERRIDE. */
25
26#define SUBTARGET_OVERRIDE_OPTIONS \
27do { \
28 if (TARGET_64BIT && ! TARGET_POWERPC64) \
29 { \
30 rs6000_isa_flags |= OPTION_MASK_POWERPC64; \
a3f9f006 31 warning (0, "%<-maix64%> requires PowerPC64 architecture remain enabled"); \
74fc2a2b
DE
32 } \
33 if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \
34 { \
35 rs6000_long_double_type_size = 64; \
00f34291 36 if (OPTION_SET_P (rs6000_long_double_type_size)) \
74fc2a2b
DE
37 warning (0, "soft-float and long-double-128 are incompatible"); \
38 } \
39 if (TARGET_POWERPC64 && ! TARGET_64BIT) \
40 { \
a3f9f006 41 error ("%<-maix64%> required: 64-bit computation with 32-bit addressing not yet supported"); \
74fc2a2b
DE
42 } \
43 if ((rs6000_isa_flags_explicit \
44 & OPTION_MASK_MINIMAL_TOC) != 0) \
45 { \
00f34291 46 if (OPTION_SET_P (rs6000_current_cmodel) \
74fc2a2b 47 && rs6000_current_cmodel != CMODEL_SMALL) \
a3f9f006 48 error ("%<-mcmodel%> incompatible with other toc options"); \
74fc2a2b
DE
49 SET_CMODEL (CMODEL_SMALL); \
50 } \
51 if (rs6000_current_cmodel != CMODEL_SMALL) \
52 { \
3dcf51ad
DE
53 TARGET_NO_FP_IN_TOC = 1; \
54 TARGET_NO_SUM_IN_TOC = 1; \
74fc2a2b
DE
55 } \
56 if (rs6000_current_cmodel == CMODEL_MEDIUM) \
57 { \
58 rs6000_current_cmodel = CMODEL_LARGE; \
59 } \
265e6a0a
CC
60 if (! strcmp (lang_hooks.name, "GNU Go") \
61 && TARGET_32BIT) \
62 { \
63 /* aix/ppc doesn't support -mvsx and -maltivec with Go */ \
64 rs6000_isa_flags &= ~(OPTION_MASK_VSX | OPTION_MASK_ALTIVEC); \
65 } \
00f34291 66 if (!OPTION_SET_P (dwarf_version)) \
56b5d13e
DE
67 /* AIX only supports DWARF 4. */ \
68 dwarf_version = 4; \
74fc2a2b
DE
69} while (0)
70
47ddb895
DE
71#define ASM_SPEC32 "-a32"
72#define ASM_SPEC64 "-a64"
73#define ASM_SPEC_COMMON "-u %(asm_cpu)"
74fc2a2b
DE
74
75/* Common ASM definitions used by ASM_SPEC amongst the various targets for
e53b6e56 76 handling -mcpu=xxx switches. There is a parallel list in driver-rs6000.cc to
74fc2a2b
DE
77 provide the default assembler options if the user uses -mcpu=native, so if
78 you make changes here, make them there also. */
79#undef ASM_CPU_SPEC
80#define ASM_CPU_SPEC \
bd2010ac 81"%{mcpu=native: %(asm_cpu_native); \
dc0f9a74 82 mcpu=power11: -mpwr11; \
f8b06705 83 mcpu=power10: -mpwr10; \
bd2010ac
DE
84 mcpu=power9: -mpwr9; \
85 mcpu=power8: -mpwr8; \
86 mcpu=power7: -mpwr7; \
87 mcpu=power6x|mcpu=power6: -mpwr6; \
88 mcpu=power5+: -mpwr5x; \
89 mcpu=power5: -mpwr5; \
90 mcpu=power4: -mpwr4; \
91 mcpu=power3: -m620; \
92 mcpu=powerpc: -mppc; \
f7bdd292 93 mcpu=rs64: -mppc; \
bd2010ac
DE
94 mcpu=603: -m603; \
95 mcpu=603e: -m603; \
96 mcpu=604: -m604; \
97 mcpu=604e: -m604; \
98 mcpu=620: -m620; \
99 mcpu=630: -m620; \
100 mcpu=970|mcpu=G5: -m970; \
47ddb895 101 !mcpu*: %(asm_default)} \
74fc2a2b
DE
102-many"
103
104#undef ASM_DEFAULT_SPEC
02248de6 105#define ASM_DEFAULT_SPEC "-mpwr7"
74fc2a2b
DE
106
107#undef TARGET_OS_CPP_BUILTINS
108#define TARGET_OS_CPP_BUILTINS() \
109 do \
110 { \
111 builtin_define ("_AIX43"); \
112 builtin_define ("_AIX51"); \
113 builtin_define ("_AIX52"); \
114 builtin_define ("_AIX53"); \
115 builtin_define ("_AIX61"); \
116 builtin_define ("_AIX71"); \
117 builtin_define ("_AIX72"); \
118 TARGET_OS_AIX_CPP_BUILTINS (); \
119 } \
120 while (0)
121
47ddb895
DE
122#define CPP_SPEC32 ""
123#define CPP_SPEC64 "-D__64BIT__"
124#define CPP_SPEC_COMMON "%{posix: -D_POSIX_SOURCE} \
74fc2a2b 125 %{ansi: -D_ANSI_C_SOURCE} \
74fc2a2b
DE
126 %{mpe: -I%R/usr/lpp/ppe.poe/include} \
127 %{pthread: -D_THREAD_SAFE}"
128
39667263 129/* The GNU C++ standard library requires that these macros be
74fc2a2b 130 defined. Synchronize with libstdc++ os_defines.h. */
47ddb895 131#define CPLUSPLUS_CPP_SPEC_COMMON \
74fc2a2b 132 "-D_ALL_SOURCE -D__COMPATMATH__ \
74fc2a2b
DE
133 %{mpe: -I%R/usr/lpp/ppe.poe/include} \
134 %{pthread: -D_THREAD_SAFE}"
135
136#define RS6000_CPU(NAME, CPU, FLAGS)
137#include "rs6000-cpus.def"
138#undef RS6000_CPU
139
140#undef TARGET_DEFAULT
6643d236 141#ifdef RS6000_BI_ARCH
469b655b 142#define TARGET_DEFAULT (ISA_2_6_MASKS_SERVER | MASK_POWERPC64 | MASK_64BIT)
6643d236 143#else
469b655b 144#define TARGET_DEFAULT ISA_2_6_MASKS_SERVER
47ddb895 145#endif
74fc2a2b
DE
146
147#undef PROCESSOR_DEFAULT
148#define PROCESSOR_DEFAULT PROCESSOR_POWER7
149#undef PROCESSOR_DEFAULT64
150#define PROCESSOR_DEFAULT64 PROCESSOR_POWER7
151
152/* AIX 7.2 kernel and assembler have necessary support for Altivec and VSX. */
153#undef OS_MISSING_ALTIVEC
154
155/* Define this macro as a C expression for the initializer of an
156 array of string to tell the driver program which options are
157 defaults for this target and thus do not need to be handled
158 specially when using `MULTILIB_OPTIONS'.
159
160 Do not define this macro if `MULTILIB_OPTIONS' is not defined in
161 the target makefile fragment or if none of the options listed in
162 `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */
163
47ddb895 164#undef MULTILIB_DEFAULTS
74fc2a2b 165
47ddb895
DE
166#define DEFAULT_ARCH64_P (TARGET_DEFAULT & MASK_64BIT)
167
168#define LIB_SPEC32 "%{!shared:%{g*:-lg}}"
169#define LIB_SPEC64 ""
170#define LIB_SPEC_COMMON "%{pg:-L%R/lib/profiled -L%R/usr/lib/profiled}\
74fc2a2b 171 %{p:-L%R/lib/profiled -L%R/usr/lib/profiled}\
74fc2a2b
DE
172 %{fprofile-arcs|fprofile-generate*|coverage:-lpthreads}\
173 %{mpe:-L%R/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
48242b2c 174 %{mlong-double-128:-lc128}\
74fc2a2b
DE
175 %{pthread:-lpthreads} -lc"
176
47ddb895
DE
177#define LINK_SPEC32 "%{!shared:%{g*: %(link_libg) }} -b32"
178#define LINK_SPEC64 "-b64"
179#define LINK_SPEC_COMMON "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro}\
74fc2a2b 180 %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\
47ddb895 181 %{mpe:-binitfini:poe_remote_main} "
74fc2a2b
DE
182
183#undef STARTFILE_SPEC
47ddb895
DE
184#if DEFAULT_ARCH64_P
185#define STARTFILE_SPEC "%{!shared:\
186 %{!maix32:%{pg:gcrt0_64%O%s;:%{p:mcrt0_64%O%s;:crt0_64%O%s}};:\
187 %{pthread:%{pg:gcrt0_r%O%s;:%{p:mcrt0_r%O%s;:crt0_r%O%s}};:\
188 %{pg:gcrt0%O%s;:%{p:mcrt0%O%s;:crt0%O%s}}}}}\
189 %{!maix32:%{shared:crtcxa_64_s%O%s;:crtcxa_64%O%s} crtdbase_64%O%s;:\
190 %{shared:crtcxa_s%O%s;:crtcxa%O%s} crtdbase%O%s}"
191#else
74fc2a2b
DE
192#define STARTFILE_SPEC "%{!shared:\
193 %{maix64:%{pg:gcrt0_64%O%s;:%{p:mcrt0_64%O%s;:crt0_64%O%s}};:\
194 %{pthread:%{pg:gcrt0_r%O%s;:%{p:mcrt0_r%O%s;:crt0_r%O%s}};:\
195 %{pg:gcrt0%O%s;:%{p:mcrt0%O%s;:crt0%O%s}}}}}\
47ddb895
DE
196 %{maix64:%{shared:crtcxa_64_s%O%s;:crtcxa_64%O%s} crtdbase_64%O%s;:\
197 %{shared:crtcxa_s%O%s;:crtcxa%O%s} crtdbase%O%s}"
198#endif
199
200
201#undef ASM_SPEC
202#undef CPP_SPEC
203#undef CPLUSPLUS_CPP_SPEC
204#undef LIB_SPEC
205#undef LINK_SPEC
206
207#if DEFAULT_ARCH64_P
208#define ASM_SPEC "%{maix32:%(asm_spec32);:%(asm_spec64)} %(asm_spec_common)"
209#define CPP_SPEC "%{maix32:%(cpp_spec32);:%(cpp_spec64)} %(cpp_spec_common)"
210#define CPLUSPLUS_CPP_SPEC "%{maix32:%(cpp_spec32);:%(cpp_spec64)} %(cplusplus_cpp_spec_common)"
211#define LIB_SPEC "%{maix32:%(lib_spec32);:%(lib_spec64)} %(lib_spec_common)"
212#define LINK_SPEC "%{maix32:%(link_spec32);:%(link_spec64)} %(link_spec_common)"
213#else
214#define ASM_SPEC "%{maix64:%(asm_spec64);:%(asm_spec32)} %(asm_spec_common)"
215#define CPP_SPEC "%{maix64:%(cpp_spec64);:%(cpp_spec32)} %(cpp_spec_common)"
216#define CPLUSPLUS_CPP_SPEC "%{maix64:%(cpp_spec64);:%(cpp_spec32)} %(cplusplus_cpp_spec_common)"
217#define LIB_SPEC "%{maix64:%(lib_spec64);:%(lib_spec32)} %(lib_spec_common)"
218#define LINK_SPEC "%{maix64:%(link_spec64);:%(link_spec32)} %(link_spec_common)"
219#endif
220
221#undef SUBTARGET_EXTRA_SPECS
222#define SUBTARGET_EXTRA_SPECS \
223 { "asm_spec_common", ASM_SPEC_COMMON }, \
224 { "asm_spec32", ASM_SPEC32 }, \
225 { "asm_spec64", ASM_SPEC64 }, \
226 { "cpp_spec_common", CPP_SPEC_COMMON }, \
227 { "cplusplus_cpp_spec_common", CPLUSPLUS_CPP_SPEC_COMMON }, \
228 { "cpp_spec32", CPP_SPEC32 }, \
229 { "cpp_spec64", CPP_SPEC64 }, \
230 { "lib_spec_common", LIB_SPEC_COMMON }, \
231 { "lib_spec32", LIB_SPEC32 }, \
232 { "lib_spec64", LIB_SPEC64 }, \
233 { "link_spec_common", LINK_SPEC_COMMON }, \
234 { "link_spec32", LINK_SPEC32 }, \
235 { "link_spec64", LINK_SPEC64 },
74fc2a2b
DE
236
237/* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */
238
239#undef PTRDIFF_TYPE
240#define PTRDIFF_TYPE "long int"
241
242/* Type used for wchar_t, as a string used in a declaration. */
243#undef WCHAR_TYPE
244#define WCHAR_TYPE (!TARGET_64BIT ? "short unsigned int" : "unsigned int")
245
246/* Width of wchar_t in bits. */
247#undef WCHAR_TYPE_SIZE
248#define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32)
249
250/* AIX 4.2 and above provides initialization and finalization function
251 support from linker command line. */
252#undef HAS_INIT_SECTION
253#define HAS_INIT_SECTION
254
255#undef LD_INIT_SWITCH
256#define LD_INIT_SWITCH "-binitfini"
257
258#ifndef _AIX52
39667263 259extern long long int atoll(const char *);
74fc2a2b
DE
260#endif
261
262/* This target uses the aix64.opt file. */
263#define TARGET_USES_AIX64_OPT 1
264
265/* Large TOC Support */
266#ifdef HAVE_LD_LARGE_TOC
267#undef TARGET_CMODEL
268#define TARGET_CMODEL rs6000_current_cmodel
269#define SET_CMODEL(opt) rs6000_current_cmodel = opt
270#else
271#define SET_CMODEL(opt) do {} while (0)
272#endif
273
9cf3f026
DE
274/* System headers are not C++-aware. */
275#define SYSTEM_IMPLICIT_EXTERN_C 1
276
74fc2a2b
DE
277/* This target defines SUPPORTS_WEAK and TARGET_ASM_NAMED_SECTION,
278 but does not have crtbegin/end. */
279
280#define TARGET_AIX_VERSION 72
281
6a2f49c6 282/* AIX 7.2 supports DWARF3+ debugging. */
74fc2a2b 283#define DWARF2_DEBUGGING_INFO 1
6a2f49c6 284#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
74fc2a2b
DE
285#define DEBUG_INFO_SECTION "0x10000"
286#define DEBUG_LINE_SECTION "0x20000"
287#define DEBUG_PUBNAMES_SECTION "0x30000"
288#define DEBUG_PUBTYPES_SECTION "0x40000"
289#define DEBUG_ARANGES_SECTION "0x50000"
290#define DEBUG_ABBREV_SECTION "0x60000"
291#define DEBUG_STR_SECTION "0x70000"
292#define DEBUG_RANGES_SECTION "0x80000"
293#define DEBUG_LOC_SECTION "0x90000"
294#define DEBUG_FRAME_SECTION "0xA0000"
295#define DEBUG_MACINFO_SECTION "0xB0000"
296#define DEBUG_MACRO_SECTION "0xB0000"
297
This page took 2.072186 seconds and 5 git commands to generate.