OSDN Git Service

* rs6000/{aix41.h,aix43.h} (ASM_CPU_SPEC): Add 604e.
[pf3gnuchains/gcc-fork.git] / gcc / config / rs6000 / aix43.h
1 /* Definitions of target machine for GNU compiler,
2    for IBM RS/6000 POWER running AIX version 4.3.
3    Copyright (C) 1998, 1999 Free Software Foundation, Inc.
4    Contributed by David Edelsohn (edelsohn@gnu.org).
5
6 This file is part of GNU CC.
7
8 GNU CC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
11 any later version.
12
13 GNU CC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU CC; see the file COPYING.  If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.  */
22
23
24 /* Enable AIX XL compiler calling convention breakage compatibility.  */
25 #define MASK_XL_CALL            0x40000000
26 #define TARGET_XL_CALL          (target_flags & MASK_XL_CALL)
27 #undef  SUBTARGET_SWITCHES
28 #define SUBTARGET_SWITCHES                                      \
29   {"aix64",             MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC}, \
30   {"aix32",             - (MASK_64BIT | MASK_POWERPC64)},       \
31   {"xl-call",           MASK_XL_CALL},                          \
32   {"no-xl-call",        - MASK_XL_CALL},                        \
33   {"threads",           0},                                     \
34   {"pe",                0},
35
36 /* Sometimes certain combinations of command options do not make sense
37    on a particular target machine.  You can define a macro
38    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
39    defined, is executed once just after all the command options have
40    been parsed.
41
42    The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
43    get control.  */
44
45 #define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2 | MASK_STRING)
46 #define SUBTARGET_OVERRIDE_OPTIONS                                      \
47 do {                                                                    \
48   if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS))               \
49     {                                                                   \
50       target_flags &= ~NON_POWERPC_MASKS;                               \
51       error ("-maix64 and POWER architecture are incompatible.");       \
52     }                                                                   \
53 } while (0);
54
55 #include "rs6000/rs6000.h"
56
57 #undef ASM_SPEC
58 #define ASM_SPEC "-u %{maix64:-a64 -mppc64} %(asm_cpu)"
59
60 /* Common ASM definitions used by ASM_SPEC amonst the various targets
61    for handling -mcpu=xxx switches.  */
62 #undef ASM_CPU_SPEC
63 #define ASM_CPU_SPEC \
64 "%{!mcpu*: %{!maix64: \
65   %{mpower: %{!mpower2: -mpwr}} \
66   %{mpower2: -mpwr2} \
67   %{mpowerpc*: %{!mpowerpc64: -mppc}} \
68   %{mpowerpc64: -mppc64} \
69   %{!mpower*: %{!mpowerpc*: %(asm_default)}}}} \
70 %{mcpu=common: -mcom} \
71 %{mcpu=power: -mpwr} \
72 %{mcpu=power2: -mpwr2} \
73 %{mcpu=powerpc: -mppc} \
74 %{mcpu=rios: -mpwr} \
75 %{mcpu=rios1: -mpwr} \
76 %{mcpu=rios2: -mpwr2} \
77 %{mcpu=rsc: -mpwr} \
78 %{mcpu=rsc1: -mpwr} \
79 %{mcpu=403: -mppc} \
80 %{mcpu=505: -mppc} \
81 %{mcpu=601: -m601} \
82 %{mcpu=602: -mppc} \
83 %{mcpu=603: -m603} \
84 %{mcpu=603e: -m603} \
85 %{mcpu=604: -m604} \
86 %{mcpu=604e: -m604} \
87 %{mcpu=620: -mppc} \
88 %{mcpu=821: -mppc} \
89 %{mcpu=860: -mppc}"
90
91 #undef  ASM_DEFAULT_SPEC
92 #define ASM_DEFAULT_SPEC "-mcom"
93
94 #undef CPP_PREDEFINES
95 #define CPP_PREDEFINES "-D_IBMR2 -D_POWER -D_AIX -D_AIX32 -D_AIX41 -D_AIX43 \
96 -D_LONG_LONG -Asystem(unix) -Asystem(aix)"
97
98 #undef CPP_SPEC
99 #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
100    %{maix64: -D__64BIT__ -D_ARCH_PPC}\
101    %{mpe: -I/usr/lpp/ppe.poe/include}\
102    %{mthreads: -D_THREAD_SAFE}\
103    %(cpp_cpu)"
104
105 /* Common CPP definitions used by CPP_SPEC among the various targets
106    for handling -mcpu=xxx switches.  */
107 #undef CPP_CPU_SPEC
108 #define CPP_CPU_SPEC \
109 "%{!mcpu*: %{!maix64: \
110   %{mpower: %{!mpower2: -D_ARCH_PWR}} \
111   %{mpower2: -D_ARCH_PWR2} \
112   %{mpowerpc*: -D_ARCH_PPC} \
113   %{!mpower*: %{!mpowerpc*: %(cpp_default)}}}} \
114 %{mcpu=common: -D_ARCH_COM} \
115 %{mcpu=power: -D_ARCH_PWR} \
116 %{mcpu=power2: -D_ARCH_PWR2} \
117 %{mcpu=powerpc: -D_ARCH_PPC} \
118 %{mcpu=rios: -D_ARCH_PWR} \
119 %{mcpu=rios1: -D_ARCH_PWR} \
120 %{mcpu=rios2: -D_ARCH_PWR2} \
121 %{mcpu=rsc: -D_ARCH_PWR} \
122 %{mcpu=rsc1: -D_ARCH_PWR} \
123 %{mcpu=403: -D_ARCH_PPC} \
124 %{mcpu=505: -D_ARCH_PPC} \
125 %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \
126 %{mcpu=602: -D_ARCH_PPC} \
127 %{mcpu=603: -D_ARCH_PPC} \
128 %{mcpu=603e: -D_ARCH_PPC} \
129 %{mcpu=604: -D_ARCH_PPC} \
130 %{mcpu=620: -D_ARCH_PPC} \
131 %{mcpu=821: -D_ARCH_PPC} \
132 %{mcpu=860: -D_ARCH_PPC}"
133
134 #undef  CPP_DEFAULT_SPEC
135 #define CPP_DEFAULT_SPEC "-D_ARCH_COM"
136
137 #undef TARGET_DEFAULT
138 #define TARGET_DEFAULT MASK_NEW_MNEMONICS
139
140 #undef PROCESSOR_DEFAULT
141 #define PROCESSOR_DEFAULT PROCESSOR_PPC604
142
143 /* Define this macro as a C expression for the initializer of an
144    array of string to tell the driver program which options are
145    defaults for this target and thus do not need to be handled
146    specially when using `MULTILIB_OPTIONS'.
147
148    Do not define this macro if `MULTILIB_OPTIONS' is not defined in
149    the target makefile fragment or if none of the options listed in
150    `MULTILIB_OPTIONS' are set by default.  *Note Target Fragment::.  */
151
152 #undef  MULTILIB_DEFAULTS
153 #define MULTILIB_DEFAULTS { "mcpu=common" }
154
155 /* These are not necessary when we pass -u to the assembler, and undefining
156    them saves a great deal of space in object files.  */
157
158 #undef ASM_OUTPUT_EXTERNAL
159 #undef ASM_OUTPUT_EXTERNAL_LIBCALL
160 #define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME)   \
161 { rtx _symref = XEXP (DECL_RTL (DECL), 0);      \
162   if ((TREE_CODE (DECL) == VAR_DECL             \
163        || TREE_CODE (DECL) == FUNCTION_DECL)    \
164       && (NAME)[strlen (NAME) - 1] != ']')      \
165     {                                           \
166       char *_name = (char *) permalloc (strlen (XSTR (_symref, 0)) + 5); \
167       strcpy (_name, XSTR (_symref, 0));        \
168       strcat (_name, TREE_CODE (DECL) == FUNCTION_DECL ? "[DS]" : "[RW]"); \
169       XSTR (_symref, 0) = _name;                \
170     }                                           \
171 }
172
173 #undef LIB_SPEC
174 #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
175    %{p:-L/lib/profiled -L/usr/lib/profiled} %{!shared:%{g*:-lg}}\
176    %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
177    %{mthreads: -L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\
178    %{!mthreads: -lc}"
179
180 #undef LINK_SPEC
181 #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
182    %{static:-bnso %(link_syscalls) } %{!shared: %{g*: %(link_libg) }}\
183    %{shared:-bM:SRE %{!e:-bnoentry}} %{maix64:-b64}"
184
185 #undef STARTFILE_SPEC
186 #define STARTFILE_SPEC "%{!shared:\
187    %{mpe:%{pg:/usr/lpp/ppe.poe/lib/gcrt0.o}\
188          %{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\
189                %{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\
190    %{!mpe:\
191      %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
192      %{!maix64:\
193        %{mthreads:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
194        %{!mthreads:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
195
196 /* AIX 4.3 typedefs ptrdiff_t as "long" while earlier releases used "int".  */
197
198 #undef PTRDIFF_TYPE
199 #define PTRDIFF_TYPE "long int"
200