]>
Commit | Line | Data |
---|---|---|
1a94ca49 | 1 | /* Definitions of target machine for GNU compiler, for DEC Alpha. |
9ddd9abd | 2 | Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
cf011243 | 3 | 2000, 2001 Free Software Foundation, Inc. |
1e6c6f11 | 4 | Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) |
1a94ca49 RK |
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 | |
38ead7f3 RK |
20 | the Free Software Foundation, 59 Temple Place - Suite 330, |
21 | Boston, MA 02111-1307, USA. */ | |
1a94ca49 RK |
22 | |
23 | ||
887af1f2 RO |
24 | /* For C++ we need to ensure that __LANGUAGE_C_PLUS_PLUS is defined independent |
25 | of the source file extension. */ | |
26 | #define CPLUSPLUS_CPP_SPEC "\ | |
27 | -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus \ | |
28 | %(cpp) \ | |
29 | " | |
30 | ||
21798cd8 RK |
31 | /* Write out the correct language type definition for the header files. |
32 | Unless we have assembler language, write out the symbols for C. */ | |
1a94ca49 | 33 | #define CPP_SPEC "\ |
952fc2ed RH |
34 | %{!undef:\ |
35 | %{.S:-D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY }}\ | |
952fc2ed | 36 | %{.m:-D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C }\ |
887af1f2 | 37 | %{!.S:%{!.cc:%{!.cxx:%{!.cpp:%{!.cp:%{!.c++:%{!.C:%{!.m:-D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C }}}}}}}}}\ |
952fc2ed RH |
38 | %{mieee:-D_IEEE_FP }\ |
39 | %{mieee-with-inexact:-D_IEEE_FP -D_IEEE_FP_INEXACT }}\ | |
40 | %(cpp_cpu) %(cpp_subtarget)" | |
41 | ||
42 | #ifndef CPP_SUBTARGET_SPEC | |
43 | #define CPP_SUBTARGET_SPEC "" | |
44 | #endif | |
1a94ca49 RK |
45 | |
46 | /* Set the spec to use for signed char. The default tests the above macro | |
47 | but DEC's compiler can't handle the conditional in a "constant" | |
48 | operand. */ | |
49 | ||
50 | #define SIGNED_CHAR_SPEC "%{funsigned-char:-D__CHAR_UNSIGNED__}" | |
51 | ||
b890f297 | 52 | #define WORD_SWITCH_TAKES_ARG(STR) \ |
2efe55c1 | 53 | (!strcmp (STR, "rpath") || DEFAULT_WORD_SWITCH_TAKES_ARG(STR)) |
8877eb00 | 54 | |
1a94ca49 RK |
55 | /* Print subsidiary information on the compiler version in use. */ |
56 | #define TARGET_VERSION | |
57 | ||
1a94ca49 RK |
58 | /* Run-time compilation parameters selecting different hardware subsets. */ |
59 | ||
f6f6a13c RK |
60 | /* Which processor to schedule for. The cpu attribute defines a list that |
61 | mirrors this list, so changes to alpha.md must be made at the same time. */ | |
62 | ||
63 | enum processor_type | |
64 | {PROCESSOR_EV4, /* 2106[46]{a,} */ | |
e9a25f70 JL |
65 | PROCESSOR_EV5, /* 21164{a,pc,} */ |
66 | PROCESSOR_EV6}; /* 21264 */ | |
f6f6a13c RK |
67 | |
68 | extern enum processor_type alpha_cpu; | |
69 | ||
2bf6230d RK |
70 | enum alpha_trap_precision |
71 | { | |
72 | ALPHA_TP_PROG, /* No precision (default). */ | |
73 | ALPHA_TP_FUNC, /* Trap contained within originating function. */ | |
74 | ALPHA_TP_INSN /* Instruction accuracy and code is resumption safe. */ | |
75 | }; | |
76 | ||
77 | enum alpha_fp_rounding_mode | |
78 | { | |
79 | ALPHA_FPRM_NORM, /* Normal rounding mode. */ | |
80 | ALPHA_FPRM_MINF, /* Round towards minus-infinity. */ | |
81 | ALPHA_FPRM_CHOP, /* Chopped rounding mode (towards 0). */ | |
82 | ALPHA_FPRM_DYN /* Dynamic rounding mode. */ | |
83 | }; | |
84 | ||
85 | enum alpha_fp_trap_mode | |
86 | { | |
87 | ALPHA_FPTM_N, /* Normal trap mode. */ | |
88 | ALPHA_FPTM_U, /* Underflow traps enabled. */ | |
89 | ALPHA_FPTM_SU, /* Software completion, w/underflow traps */ | |
90 | ALPHA_FPTM_SUI /* Software completion, w/underflow & inexact traps */ | |
91 | }; | |
92 | ||
1a94ca49 RK |
93 | extern int target_flags; |
94 | ||
2bf6230d RK |
95 | extern enum alpha_trap_precision alpha_tp; |
96 | extern enum alpha_fp_rounding_mode alpha_fprm; | |
97 | extern enum alpha_fp_trap_mode alpha_fptm; | |
98 | ||
1a94ca49 RK |
99 | /* This means that floating-point support exists in the target implementation |
100 | of the Alpha architecture. This is usually the default. */ | |
de4abb91 | 101 | #define MASK_FP (1 << 0) |
2bf6230d | 102 | #define TARGET_FP (target_flags & MASK_FP) |
1a94ca49 RK |
103 | |
104 | /* This means that floating-point registers are allowed to be used. Note | |
105 | that Alpha implementations without FP operations are required to | |
106 | provide the FP registers. */ | |
107 | ||
de4abb91 | 108 | #define MASK_FPREGS (1 << 1) |
2bf6230d | 109 | #define TARGET_FPREGS (target_flags & MASK_FPREGS) |
03f8c4cc RK |
110 | |
111 | /* This means that gas is used to process the assembler file. */ | |
112 | ||
de4abb91 | 113 | #define MASK_GAS (1 << 2) |
03f8c4cc | 114 | #define TARGET_GAS (target_flags & MASK_GAS) |
1a94ca49 | 115 | |
2bf6230d RK |
116 | /* This means that we should mark procedures as IEEE conformant. */ |
117 | ||
de4abb91 | 118 | #define MASK_IEEE_CONFORMANT (1 << 3) |
2bf6230d RK |
119 | #define TARGET_IEEE_CONFORMANT (target_flags & MASK_IEEE_CONFORMANT) |
120 | ||
121 | /* This means we should be IEEE-compliant except for inexact. */ | |
122 | ||
de4abb91 | 123 | #define MASK_IEEE (1 << 4) |
2bf6230d RK |
124 | #define TARGET_IEEE (target_flags & MASK_IEEE) |
125 | ||
126 | /* This means we should be fully IEEE-compliant. */ | |
127 | ||
de4abb91 | 128 | #define MASK_IEEE_WITH_INEXACT (1 << 5) |
2bf6230d RK |
129 | #define TARGET_IEEE_WITH_INEXACT (target_flags & MASK_IEEE_WITH_INEXACT) |
130 | ||
803fee69 RK |
131 | /* This means we must construct all constants rather than emitting |
132 | them as literal data. */ | |
133 | ||
de4abb91 | 134 | #define MASK_BUILD_CONSTANTS (1 << 6) |
803fee69 RK |
135 | #define TARGET_BUILD_CONSTANTS (target_flags & MASK_BUILD_CONSTANTS) |
136 | ||
e5958492 RK |
137 | /* This means we handle floating points in VAX F- (float) |
138 | or G- (double) Format. */ | |
139 | ||
de4abb91 | 140 | #define MASK_FLOAT_VAX (1 << 7) |
e5958492 RK |
141 | #define TARGET_FLOAT_VAX (target_flags & MASK_FLOAT_VAX) |
142 | ||
e9a25f70 JL |
143 | /* This means that the processor has byte and half word loads and stores |
144 | (the BWX extension). */ | |
025f3281 | 145 | |
de4abb91 | 146 | #define MASK_BWX (1 << 8) |
e9a25f70 | 147 | #define TARGET_BWX (target_flags & MASK_BWX) |
025f3281 | 148 | |
e9a25f70 | 149 | /* This means that the processor has the MAX extension. */ |
de4abb91 | 150 | #define MASK_MAX (1 << 9) |
e9a25f70 JL |
151 | #define TARGET_MAX (target_flags & MASK_MAX) |
152 | ||
de4abb91 RH |
153 | /* This means that the processor has the FIX extension. */ |
154 | #define MASK_FIX (1 << 10) | |
155 | #define TARGET_FIX (target_flags & MASK_FIX) | |
156 | ||
157 | /* This means that the processor has the CIX extension. */ | |
158 | #define MASK_CIX (1 << 11) | |
159 | #define TARGET_CIX (target_flags & MASK_CIX) | |
160 | ||
a3b815cb JJ |
161 | /* This means that the processor is an EV5, EV56, or PCA56. |
162 | Unlike alpha_cpu this is not affected by -mtune= setting. */ | |
a76c0119 | 163 | #define MASK_CPU_EV5 (1 << 28) |
a3b815cb | 164 | #define TARGET_CPU_EV5 (target_flags & MASK_CPU_EV5) |
e9a25f70 JL |
165 | |
166 | /* Likewise for EV6. */ | |
a76c0119 | 167 | #define MASK_CPU_EV6 (1 << 29) |
a3b815cb | 168 | #define TARGET_CPU_EV6 (target_flags & MASK_CPU_EV6) |
e9a25f70 JL |
169 | |
170 | /* This means we support the .arch directive in the assembler. Only | |
171 | defined in TARGET_CPU_DEFAULT. */ | |
a76c0119 | 172 | #define MASK_SUPPORT_ARCH (1 << 30) |
e9a25f70 | 173 | #define TARGET_SUPPORT_ARCH (target_flags & MASK_SUPPORT_ARCH) |
8f87939b | 174 | |
9ba3994a RH |
175 | /* These are for target os support and cannot be changed at runtime. */ |
176 | #ifndef TARGET_WINDOWS_NT | |
177 | #define TARGET_WINDOWS_NT 0 | |
178 | #endif | |
179 | #ifndef TARGET_OPEN_VMS | |
180 | #define TARGET_OPEN_VMS 0 | |
181 | #endif | |
182 | ||
183 | #ifndef TARGET_AS_CAN_SUBTRACT_LABELS | |
184 | #define TARGET_AS_CAN_SUBTRACT_LABELS TARGET_GAS | |
185 | #endif | |
9c0e94a5 RH |
186 | #ifndef TARGET_CAN_FAULT_IN_PROLOGUE |
187 | #define TARGET_CAN_FAULT_IN_PROLOGUE 0 | |
188 | #endif | |
5495cc55 RH |
189 | #ifndef TARGET_HAS_XFLOATING_LIBS |
190 | #define TARGET_HAS_XFLOATING_LIBS 0 | |
191 | #endif | |
4f1c5cce RH |
192 | #ifndef TARGET_PROFILING_NEEDS_GP |
193 | #define TARGET_PROFILING_NEEDS_GP 0 | |
194 | #endif | |
ccb83cbc RH |
195 | #ifndef TARGET_LD_BUGGY_LDGP |
196 | #define TARGET_LD_BUGGY_LDGP 0 | |
197 | #endif | |
9ba3994a | 198 | |
1a94ca49 RK |
199 | /* Macro to define tables used to set the flags. |
200 | This is a list in braces of pairs in braces, | |
201 | each pair being { "NAME", VALUE } | |
202 | where VALUE is the bits to set or minus the bits to clear. | |
203 | An empty string NAME is used to identify the default VALUE. */ | |
204 | ||
f8e52397 | 205 | #define TARGET_SWITCHES \ |
047142d3 PT |
206 | { {"no-soft-float", MASK_FP, N_("Use hardware fp")}, \ |
207 | {"soft-float", - MASK_FP, N_("Do not use hardware fp")}, \ | |
208 | {"fp-regs", MASK_FPREGS, N_("Use fp registers")}, \ | |
209 | {"no-fp-regs", - (MASK_FP|MASK_FPREGS), \ | |
210 | N_("Do not use fp registers")}, \ | |
211 | {"alpha-as", -MASK_GAS, N_("Do not assume GAS")}, \ | |
212 | {"gas", MASK_GAS, N_("Assume GAS")}, \ | |
f8e52397 | 213 | {"ieee-conformant", MASK_IEEE_CONFORMANT, \ |
047142d3 | 214 | N_("Request IEEE-conformant math library routines (OSF/1)")}, \ |
f8e52397 | 215 | {"ieee", MASK_IEEE|MASK_IEEE_CONFORMANT, \ |
047142d3 | 216 | N_("Emit IEEE-conformant code, without inexact exceptions")}, \ |
f8e52397 | 217 | {"ieee-with-inexact", MASK_IEEE_WITH_INEXACT|MASK_IEEE_CONFORMANT, \ |
047142d3 | 218 | N_("Emit IEEE-conformant code, with inexact exceptions")}, \ |
f8e52397 | 219 | {"build-constants", MASK_BUILD_CONSTANTS, \ |
047142d3 PT |
220 | N_("Do not emit complex integer constants to read-only memory")}, \ |
221 | {"float-vax", MASK_FLOAT_VAX, N_("Use VAX fp")}, \ | |
222 | {"float-ieee", -MASK_FLOAT_VAX, N_("Do not use VAX fp")}, \ | |
223 | {"bwx", MASK_BWX, N_("Emit code for the byte/word ISA extension")}, \ | |
f8e52397 | 224 | {"no-bwx", -MASK_BWX, ""}, \ |
047142d3 PT |
225 | {"max", MASK_MAX, \ |
226 | N_("Emit code for the motion video ISA extension")}, \ | |
f8e52397 | 227 | {"no-max", -MASK_MAX, ""}, \ |
047142d3 PT |
228 | {"fix", MASK_FIX, \ |
229 | N_("Emit code for the fp move and sqrt ISA extension")}, \ | |
de4abb91 | 230 | {"no-fix", -MASK_FIX, ""}, \ |
047142d3 | 231 | {"cix", MASK_CIX, N_("Emit code for the counting ISA extension")}, \ |
de4abb91 | 232 | {"no-cix", -MASK_CIX, ""}, \ |
f8e52397 | 233 | {"", TARGET_DEFAULT | TARGET_CPU_DEFAULT, ""} } |
1a94ca49 | 234 | |
c01b5470 | 235 | #define TARGET_DEFAULT MASK_FP|MASK_FPREGS |
1a94ca49 | 236 | |
88681624 ILT |
237 | #ifndef TARGET_CPU_DEFAULT |
238 | #define TARGET_CPU_DEFAULT 0 | |
239 | #endif | |
240 | ||
2bf6230d RK |
241 | /* This macro is similar to `TARGET_SWITCHES' but defines names of |
242 | command options that have values. Its definition is an initializer | |
243 | with a subgrouping for each command option. | |
244 | ||
245 | Each subgrouping contains a string constant, that defines the fixed | |
246 | part of the option name, and the address of a variable. The | |
247 | variable, type `char *', is set to the variable part of the given | |
248 | option if the fixed part matches. The actual option name is made | |
249 | by appending `-m' to the specified name. | |
250 | ||
251 | Here is an example which defines `-mshort-data-NUMBER'. If the | |
252 | given option is `-mshort-data-512', the variable `m88k_short_data' | |
253 | will be set to the string `"512"'. | |
254 | ||
255 | extern char *m88k_short_data; | |
256 | #define TARGET_OPTIONS { { "short-data-", &m88k_short_data } } */ | |
257 | ||
df45c7ea | 258 | extern const char *alpha_cpu_string; /* For -mcpu= */ |
a3b815cb | 259 | extern const char *alpha_tune_string; /* For -mtune= */ |
df45c7ea KG |
260 | extern const char *alpha_fprm_string; /* For -mfp-rounding-mode=[n|m|c|d] */ |
261 | extern const char *alpha_fptm_string; /* For -mfp-trap-mode=[n|u|su|sui] */ | |
262 | extern const char *alpha_tp_string; /* For -mtrap-precision=[p|f|i] */ | |
263 | extern const char *alpha_mlat_string; /* For -mmemory-latency= */ | |
2bf6230d | 264 | |
f8e52397 RH |
265 | #define TARGET_OPTIONS \ |
266 | { \ | |
267 | {"cpu=", &alpha_cpu_string, \ | |
a3b815cb JJ |
268 | N_("Use features of and schedule given CPU")}, \ |
269 | {"tune=", &alpha_tune_string, \ | |
270 | N_("Schedule given CPU")}, \ | |
f8e52397 | 271 | {"fp-rounding-mode=", &alpha_fprm_string, \ |
047142d3 | 272 | N_("Control the generated fp rounding mode")}, \ |
f8e52397 | 273 | {"fp-trap-mode=", &alpha_fptm_string, \ |
047142d3 | 274 | N_("Control the IEEE trap mode")}, \ |
f8e52397 | 275 | {"trap-precision=", &alpha_tp_string, \ |
047142d3 | 276 | N_("Control the precision given to fp exceptions")}, \ |
f8e52397 | 277 | {"memory-latency=", &alpha_mlat_string, \ |
047142d3 | 278 | N_("Tune expected memory latency")}, \ |
2bf6230d RK |
279 | } |
280 | ||
952fc2ed RH |
281 | /* Attempt to describe CPU characteristics to the preprocessor. */ |
282 | ||
283 | /* Corresponding to amask... */ | |
2b57e919 NB |
284 | #define CPP_AM_BWX_SPEC "-D__alpha_bwx__ -Acpu=bwx" |
285 | #define CPP_AM_MAX_SPEC "-D__alpha_max__ -Acpu=max" | |
286 | #define CPP_AM_FIX_SPEC "-D__alpha_fix__ -Acpu=fix" | |
287 | #define CPP_AM_CIX_SPEC "-D__alpha_cix__ -Acpu=cix" | |
952fc2ed RH |
288 | |
289 | /* Corresponding to implver... */ | |
2b57e919 NB |
290 | #define CPP_IM_EV4_SPEC "-D__alpha_ev4__ -Acpu=ev4" |
291 | #define CPP_IM_EV5_SPEC "-D__alpha_ev5__ -Acpu=ev5" | |
292 | #define CPP_IM_EV6_SPEC "-D__alpha_ev6__ -Acpu=ev6" | |
952fc2ed RH |
293 | |
294 | /* Common combinations. */ | |
295 | #define CPP_CPU_EV4_SPEC "%(cpp_im_ev4)" | |
296 | #define CPP_CPU_EV5_SPEC "%(cpp_im_ev5)" | |
297 | #define CPP_CPU_EV56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx)" | |
298 | #define CPP_CPU_PCA56_SPEC "%(cpp_im_ev5) %(cpp_am_bwx) %(cpp_am_max)" | |
d8ee3e20 RH |
299 | #define CPP_CPU_EV6_SPEC \ |
300 | "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_fix)" | |
301 | #define CPP_CPU_EV67_SPEC \ | |
302 | "%(cpp_im_ev6) %(cpp_am_bwx) %(cpp_am_max) %(cpp_am_fix) %(cpp_am_cix)" | |
952fc2ed RH |
303 | |
304 | #ifndef CPP_CPU_DEFAULT_SPEC | |
305 | # if TARGET_CPU_DEFAULT & MASK_CPU_EV6 | |
8f4773ea | 306 | # if TARGET_CPU_DEFAULT & MASK_CIX |
d8ee3e20 RH |
307 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV67_SPEC |
308 | # else | |
309 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV6_SPEC | |
310 | # endif | |
952fc2ed RH |
311 | # else |
312 | # if TARGET_CPU_DEFAULT & MASK_CPU_EV5 | |
313 | # if TARGET_CPU_DEFAULT & MASK_MAX | |
314 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_PCA56_SPEC | |
315 | # else | |
316 | # if TARGET_CPU_DEFAULT & MASK_BWX | |
317 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV56_SPEC | |
318 | # else | |
319 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV5_SPEC | |
320 | # endif | |
321 | # endif | |
322 | # else | |
323 | # define CPP_CPU_DEFAULT_SPEC CPP_CPU_EV4_SPEC | |
324 | # endif | |
325 | # endif | |
326 | #endif /* CPP_CPU_DEFAULT_SPEC */ | |
327 | ||
328 | #ifndef CPP_CPU_SPEC | |
329 | #define CPP_CPU_SPEC "\ | |
2b57e919 | 330 | %{!undef:-Acpu=alpha -Amachine=alpha -D__alpha -D__alpha__ \ |
952fc2ed RH |
331 | %{mcpu=ev4|mcpu=21064:%(cpp_cpu_ev4) }\ |
332 | %{mcpu=ev5|mcpu=21164:%(cpp_cpu_ev5) }\ | |
333 | %{mcpu=ev56|mcpu=21164a:%(cpp_cpu_ev56) }\ | |
334 | %{mcpu=pca56|mcpu=21164pc|mcpu=21164PC:%(cpp_cpu_pca56) }\ | |
335 | %{mcpu=ev6|mcpu=21264:%(cpp_cpu_ev6) }\ | |
d8ee3e20 | 336 | %{mcpu=ev67|mcpu=21264a:%(cpp_cpu_ev67) }\ |
952fc2ed RH |
337 | %{!mcpu*:%(cpp_cpu_default) }}" |
338 | #endif | |
339 | ||
340 | /* This macro defines names of additional specifications to put in the | |
341 | specs that can be used in various specifications like CC1_SPEC. Its | |
342 | definition is an initializer with a subgrouping for each command option. | |
343 | ||
344 | Each subgrouping contains a string constant, that defines the | |
345 | specification name, and a string constant that used by the GNU CC driver | |
346 | program. | |
347 | ||
348 | Do not define this macro if it does not need to do anything. */ | |
349 | ||
350 | #ifndef SUBTARGET_EXTRA_SPECS | |
351 | #define SUBTARGET_EXTRA_SPECS | |
352 | #endif | |
353 | ||
829245be KG |
354 | #define EXTRA_SPECS \ |
355 | { "cpp_am_bwx", CPP_AM_BWX_SPEC }, \ | |
356 | { "cpp_am_max", CPP_AM_MAX_SPEC }, \ | |
de4abb91 | 357 | { "cpp_am_fix", CPP_AM_FIX_SPEC }, \ |
829245be KG |
358 | { "cpp_am_cix", CPP_AM_CIX_SPEC }, \ |
359 | { "cpp_im_ev4", CPP_IM_EV4_SPEC }, \ | |
360 | { "cpp_im_ev5", CPP_IM_EV5_SPEC }, \ | |
361 | { "cpp_im_ev6", CPP_IM_EV6_SPEC }, \ | |
362 | { "cpp_cpu_ev4", CPP_CPU_EV4_SPEC }, \ | |
363 | { "cpp_cpu_ev5", CPP_CPU_EV5_SPEC }, \ | |
364 | { "cpp_cpu_ev56", CPP_CPU_EV56_SPEC }, \ | |
365 | { "cpp_cpu_pca56", CPP_CPU_PCA56_SPEC }, \ | |
366 | { "cpp_cpu_ev6", CPP_CPU_EV6_SPEC }, \ | |
d8ee3e20 | 367 | { "cpp_cpu_ev67", CPP_CPU_EV67_SPEC }, \ |
829245be KG |
368 | { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \ |
369 | { "cpp_cpu", CPP_CPU_SPEC }, \ | |
370 | { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \ | |
952fc2ed RH |
371 | SUBTARGET_EXTRA_SPECS |
372 | ||
373 | ||
2bf6230d RK |
374 | /* Sometimes certain combinations of command options do not make sense |
375 | on a particular target machine. You can define a macro | |
376 | `OVERRIDE_OPTIONS' to take account of this. This macro, if | |
377 | defined, is executed once just after all the command options have | |
378 | been parsed. | |
379 | ||
380 | On the Alpha, it is used to translate target-option strings into | |
381 | numeric values. */ | |
382 | ||
2bf6230d RK |
383 | #define OVERRIDE_OPTIONS override_options () |
384 | ||
385 | ||
1a94ca49 RK |
386 | /* Define this macro to change register usage conditional on target flags. |
387 | ||
388 | On the Alpha, we use this to disable the floating-point registers when | |
389 | they don't exist. */ | |
390 | ||
391 | #define CONDITIONAL_REGISTER_USAGE \ | |
392 | if (! TARGET_FPREGS) \ | |
52a69200 | 393 | for (i = 32; i < 63; i++) \ |
1a94ca49 RK |
394 | fixed_regs[i] = call_used_regs[i] = 1; |
395 | ||
4f074454 RK |
396 | /* Show we can debug even without a frame pointer. */ |
397 | #define CAN_DEBUG_WITHOUT_FP | |
1a94ca49 RK |
398 | \f |
399 | /* target machine storage layout */ | |
400 | ||
2700ac93 RS |
401 | /* Define to enable software floating point emulation. */ |
402 | #define REAL_ARITHMETIC | |
403 | ||
1a94ca49 RK |
404 | /* Define the size of `int'. The default is the same as the word size. */ |
405 | #define INT_TYPE_SIZE 32 | |
406 | ||
407 | /* Define the size of `long long'. The default is the twice the word size. */ | |
408 | #define LONG_LONG_TYPE_SIZE 64 | |
409 | ||
410 | /* The two floating-point formats we support are S-floating, which is | |
411 | 4 bytes, and T-floating, which is 8 bytes. `float' is S and `double' | |
412 | and `long double' are T. */ | |
413 | ||
414 | #define FLOAT_TYPE_SIZE 32 | |
415 | #define DOUBLE_TYPE_SIZE 64 | |
416 | #define LONG_DOUBLE_TYPE_SIZE 64 | |
417 | ||
5258d7ae RK |
418 | #define WCHAR_TYPE "unsigned int" |
419 | #define WCHAR_TYPE_SIZE 32 | |
1a94ca49 | 420 | |
13d39dbc | 421 | /* Define this macro if it is advisable to hold scalars in registers |
1a94ca49 RK |
422 | in a wider mode than that declared by the program. In such cases, |
423 | the value is constrained to be within the bounds of the declared | |
424 | type, but kept valid in the wider mode. The signedness of the | |
425 | extension may differ from that of the type. | |
426 | ||
427 | For Alpha, we always store objects in a full register. 32-bit objects | |
428 | are always sign-extended, but smaller objects retain their signedness. */ | |
429 | ||
430 | #define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \ | |
431 | if (GET_MODE_CLASS (MODE) == MODE_INT \ | |
432 | && GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \ | |
433 | { \ | |
434 | if ((MODE) == SImode) \ | |
435 | (UNSIGNEDP) = 0; \ | |
436 | (MODE) = DImode; \ | |
437 | } | |
438 | ||
439 | /* Define this if function arguments should also be promoted using the above | |
440 | procedure. */ | |
441 | ||
442 | #define PROMOTE_FUNCTION_ARGS | |
443 | ||
444 | /* Likewise, if the function return value is promoted. */ | |
445 | ||
446 | #define PROMOTE_FUNCTION_RETURN | |
447 | ||
448 | /* Define this if most significant bit is lowest numbered | |
449 | in instructions that operate on numbered bit-fields. | |
450 | ||
451 | There are no such instructions on the Alpha, but the documentation | |
452 | is little endian. */ | |
453 | #define BITS_BIG_ENDIAN 0 | |
454 | ||
455 | /* Define this if most significant byte of a word is the lowest numbered. | |
456 | This is false on the Alpha. */ | |
457 | #define BYTES_BIG_ENDIAN 0 | |
458 | ||
459 | /* Define this if most significant word of a multiword number is lowest | |
460 | numbered. | |
461 | ||
462 | For Alpha we can decide arbitrarily since there are no machine instructions | |
463 | for them. Might as well be consistent with bytes. */ | |
464 | #define WORDS_BIG_ENDIAN 0 | |
465 | ||
466 | /* number of bits in an addressable storage unit */ | |
467 | #define BITS_PER_UNIT 8 | |
468 | ||
469 | /* Width in bits of a "word", which is the contents of a machine register. | |
470 | Note that this is not necessarily the width of data type `int'; | |
471 | if using 16-bit ints on a 68000, this would still be 32. | |
472 | But on a machine with 16-bit registers, this would be 16. */ | |
473 | #define BITS_PER_WORD 64 | |
474 | ||
475 | /* Width of a word, in units (bytes). */ | |
476 | #define UNITS_PER_WORD 8 | |
477 | ||
478 | /* Width in bits of a pointer. | |
479 | See also the macro `Pmode' defined below. */ | |
480 | #define POINTER_SIZE 64 | |
481 | ||
482 | /* Allocation boundary (in *bits*) for storing arguments in argument list. */ | |
483 | #define PARM_BOUNDARY 64 | |
484 | ||
485 | /* Boundary (in *bits*) on which stack pointer should be aligned. */ | |
486 | #define STACK_BOUNDARY 64 | |
487 | ||
488 | /* Allocation boundary (in *bits*) for the code of a function. */ | |
c176c051 | 489 | #define FUNCTION_BOUNDARY 32 |
1a94ca49 RK |
490 | |
491 | /* Alignment of field after `int : 0' in a structure. */ | |
492 | #define EMPTY_FIELD_BOUNDARY 64 | |
493 | ||
494 | /* Every structure's size must be a multiple of this. */ | |
495 | #define STRUCTURE_SIZE_BOUNDARY 8 | |
496 | ||
497 | /* A bitfield declared as `int' forces `int' alignment for the struct. */ | |
498 | #define PCC_BITFIELD_TYPE_MATTERS 1 | |
499 | ||
1a94ca49 | 500 | /* No data type wants to be aligned rounder than this. */ |
5495cc55 | 501 | #define BIGGEST_ALIGNMENT 128 |
1a94ca49 | 502 | |
d16fe557 RK |
503 | /* For atomic access to objects, must have at least 32-bit alignment |
504 | unless the machine has byte operations. */ | |
13eb1f7f | 505 | #define MINIMUM_ATOMIC_ALIGNMENT ((unsigned int) (TARGET_BWX ? 8 : 32)) |
d16fe557 | 506 | |
442b1685 RK |
507 | /* Align all constants and variables to at least a word boundary so |
508 | we can pick up pieces of them faster. */ | |
6c174fc0 RH |
509 | /* ??? Only if block-move stuff knows about different source/destination |
510 | alignment. */ | |
511 | #if 0 | |
442b1685 RK |
512 | #define CONSTANT_ALIGNMENT(EXP, ALIGN) MAX ((ALIGN), BITS_PER_WORD) |
513 | #define DATA_ALIGNMENT(EXP, ALIGN) MAX ((ALIGN), BITS_PER_WORD) | |
6c174fc0 | 514 | #endif |
1a94ca49 RK |
515 | |
516 | /* Set this non-zero if move instructions will actually fail to work | |
517 | when given unaligned data. | |
518 | ||
519 | Since we get an error message when we do one, call them invalid. */ | |
520 | ||
521 | #define STRICT_ALIGNMENT 1 | |
522 | ||
523 | /* Set this non-zero if unaligned move instructions are extremely slow. | |
524 | ||
525 | On the Alpha, they trap. */ | |
130d2d72 | 526 | |
e1565e65 | 527 | #define SLOW_UNALIGNED_ACCESS(MODE, ALIGN) 1 |
1a94ca49 RK |
528 | \f |
529 | /* Standard register usage. */ | |
530 | ||
531 | /* Number of actual hardware registers. | |
532 | The hardware registers are assigned numbers for the compiler | |
533 | from 0 to just below FIRST_PSEUDO_REGISTER. | |
534 | All registers that the compiler knows about must be given numbers, | |
535 | even those that are not normally considered general registers. | |
536 | ||
537 | We define all 32 integer registers, even though $31 is always zero, | |
538 | and all 32 floating-point registers, even though $f31 is also | |
539 | always zero. We do not bother defining the FP status register and | |
130d2d72 RK |
540 | there are no other registers. |
541 | ||
542 | Since $31 is always zero, we will use register number 31 as the | |
543 | argument pointer. It will never appear in the generated code | |
544 | because we will always be eliminating it in favor of the stack | |
52a69200 RK |
545 | pointer or hardware frame pointer. |
546 | ||
547 | Likewise, we use $f31 for the frame pointer, which will always | |
548 | be eliminated in favor of the hardware frame pointer or the | |
549 | stack pointer. */ | |
1a94ca49 RK |
550 | |
551 | #define FIRST_PSEUDO_REGISTER 64 | |
552 | ||
553 | /* 1 for registers that have pervasive standard uses | |
554 | and are not available for the register allocator. */ | |
555 | ||
556 | #define FIXED_REGISTERS \ | |
557 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
558 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, \ | |
559 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ | |
560 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 } | |
561 | ||
562 | /* 1 for registers not available across function calls. | |
563 | These must include the FIXED_REGISTERS and also any | |
564 | registers that can be used without being saved. | |
565 | The latter must include the registers where values are returned | |
566 | and the register where structure-value addresses are passed. | |
567 | Aside from that, you can include as many other registers as you like. */ | |
568 | #define CALL_USED_REGISTERS \ | |
569 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, \ | |
570 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, \ | |
571 | 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \ | |
572 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } | |
573 | ||
574 | /* List the order in which to allocate registers. Each register must be | |
575 | listed once, even those in FIXED_REGISTERS. | |
576 | ||
577 | We allocate in the following order: | |
2c4be73e | 578 | $f10-$f15 (nonsaved floating-point register) |
1a94ca49 RK |
579 | $f22-$f30 (likewise) |
580 | $f21-$f16 (likewise, but input args) | |
581 | $f0 (nonsaved, but return value) | |
2c4be73e | 582 | $f1 (nonsaved, but immediate before saved) |
1a94ca49 RK |
583 | $f2-$f9 (saved floating-point registers) |
584 | $1-$8 (nonsaved integer registers) | |
585 | $22-$25 (likewise) | |
586 | $28 (likewise) | |
587 | $0 (likewise, but return value) | |
588 | $21-$16 (likewise, but input args) | |
0076aa6b | 589 | $27 (procedure value in OSF, nonsaved in NT) |
1a94ca49 RK |
590 | $9-$14 (saved integer registers) |
591 | $26 (return PC) | |
592 | $15 (frame pointer) | |
593 | $29 (global pointer) | |
52a69200 | 594 | $30, $31, $f31 (stack pointer and always zero/ap & fp) */ |
1a94ca49 RK |
595 | |
596 | #define REG_ALLOC_ORDER \ | |
2c4be73e | 597 | {42, 43, 44, 45, 46, 47, \ |
1a94ca49 RK |
598 | 54, 55, 56, 57, 58, 59, 60, 61, 62, \ |
599 | 53, 52, 51, 50, 49, 48, \ | |
2c4be73e | 600 | 32, 33, \ |
1a94ca49 RK |
601 | 34, 35, 36, 37, 38, 39, 40, 41, \ |
602 | 1, 2, 3, 4, 5, 6, 7, 8, \ | |
603 | 22, 23, 24, 25, \ | |
604 | 28, \ | |
605 | 0, \ | |
606 | 21, 20, 19, 18, 17, 16, \ | |
607 | 27, \ | |
608 | 9, 10, 11, 12, 13, 14, \ | |
609 | 26, \ | |
610 | 15, \ | |
611 | 29, \ | |
612 | 30, 31, 63 } | |
613 | ||
614 | /* Return number of consecutive hard regs needed starting at reg REGNO | |
615 | to hold something of mode MODE. | |
616 | This is ordinarily the length in words of a value of mode MODE | |
617 | but can be less for certain modes in special long registers. */ | |
618 | ||
619 | #define HARD_REGNO_NREGS(REGNO, MODE) \ | |
620 | ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
621 | ||
622 | /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. | |
623 | On Alpha, the integer registers can hold any mode. The floating-point | |
624 | registers can hold 32-bit and 64-bit integers as well, but not 16-bit | |
a7adf08e | 625 | or 8-bit values. */ |
1a94ca49 | 626 | |
e6a8ebb4 RH |
627 | #define HARD_REGNO_MODE_OK(REGNO, MODE) \ |
628 | ((REGNO) >= 32 && (REGNO) <= 62 \ | |
629 | ? GET_MODE_UNIT_SIZE (MODE) == 8 || GET_MODE_UNIT_SIZE (MODE) == 4 \ | |
630 | : 1) | |
631 | ||
632 | /* A C expression that is nonzero if a value of mode | |
633 | MODE1 is accessible in mode MODE2 without copying. | |
1a94ca49 | 634 | |
e6a8ebb4 RH |
635 | This asymmetric test is true when MODE1 could be put |
636 | in an FP register but MODE2 could not. */ | |
1a94ca49 | 637 | |
a7adf08e | 638 | #define MODES_TIEABLE_P(MODE1, MODE2) \ |
e6a8ebb4 RH |
639 | (HARD_REGNO_MODE_OK (32, (MODE1)) \ |
640 | ? HARD_REGNO_MODE_OK (32, (MODE2)) \ | |
a7adf08e | 641 | : 1) |
1a94ca49 RK |
642 | |
643 | /* Specify the registers used for certain standard purposes. | |
644 | The values of these macros are register numbers. */ | |
645 | ||
646 | /* Alpha pc isn't overloaded on a register that the compiler knows about. */ | |
647 | /* #define PC_REGNUM */ | |
648 | ||
649 | /* Register to use for pushing function arguments. */ | |
650 | #define STACK_POINTER_REGNUM 30 | |
651 | ||
652 | /* Base register for access to local variables of the function. */ | |
52a69200 | 653 | #define HARD_FRAME_POINTER_REGNUM 15 |
1a94ca49 RK |
654 | |
655 | /* Value should be nonzero if functions must have frame pointers. | |
656 | Zero means the frame pointer need not be set up (and parms | |
657 | may be accessed via the stack pointer) in functions that seem suitable. | |
658 | This is computed in `reload', in reload1.c. */ | |
659 | #define FRAME_POINTER_REQUIRED 0 | |
660 | ||
661 | /* Base register for access to arguments of the function. */ | |
130d2d72 | 662 | #define ARG_POINTER_REGNUM 31 |
1a94ca49 | 663 | |
52a69200 RK |
664 | /* Base register for access to local variables of function. */ |
665 | #define FRAME_POINTER_REGNUM 63 | |
666 | ||
1a94ca49 RK |
667 | /* Register in which static-chain is passed to a function. |
668 | ||
669 | For the Alpha, this is based on an example; the calling sequence | |
670 | doesn't seem to specify this. */ | |
671 | #define STATIC_CHAIN_REGNUM 1 | |
672 | ||
673 | /* Register in which address to store a structure value | |
674 | arrives in the function. On the Alpha, the address is passed | |
675 | as a hidden argument. */ | |
676 | #define STRUCT_VALUE 0 | |
677 | \f | |
678 | /* Define the classes of registers for register constraints in the | |
679 | machine description. Also define ranges of constants. | |
680 | ||
681 | One of the classes must always be named ALL_REGS and include all hard regs. | |
682 | If there is more than one class, another class must be named NO_REGS | |
683 | and contain no registers. | |
684 | ||
685 | The name GENERAL_REGS must be the name of a class (or an alias for | |
686 | another name such as ALL_REGS). This is the class of registers | |
687 | that is allowed by "g" or "r" in a register constraint. | |
688 | Also, registers outside this class are allocated only when | |
689 | instructions express preferences for them. | |
690 | ||
691 | The classes must be numbered in nondecreasing order; that is, | |
692 | a larger-numbered class must never be contained completely | |
693 | in a smaller-numbered class. | |
694 | ||
695 | For any two classes, it is very desirable that there be another | |
696 | class that represents their union. */ | |
697 | ||
93c89ab3 | 698 | enum reg_class { NO_REGS, PV_REG, GENERAL_REGS, FLOAT_REGS, ALL_REGS, |
1a94ca49 RK |
699 | LIM_REG_CLASSES }; |
700 | ||
701 | #define N_REG_CLASSES (int) LIM_REG_CLASSES | |
702 | ||
703 | /* Give names of register classes as strings for dump file. */ | |
704 | ||
705 | #define REG_CLASS_NAMES \ | |
93c89ab3 | 706 | {"NO_REGS", "PV_REG", "GENERAL_REGS", "FLOAT_REGS", "ALL_REGS" } |
1a94ca49 RK |
707 | |
708 | /* Define which registers fit in which classes. | |
709 | This is an initializer for a vector of HARD_REG_SET | |
710 | of length N_REG_CLASSES. */ | |
711 | ||
712 | #define REG_CLASS_CONTENTS \ | |
93c89ab3 | 713 | { {0, 0}, {0x08000000, 0}, {~0, 0x80000000}, {0, 0x7fffffff}, {~0, ~0} } |
1a94ca49 RK |
714 | |
715 | /* The same information, inverted: | |
716 | Return the class number of the smallest class containing | |
717 | reg number REGNO. This could be a conditional expression | |
718 | or could index an array. */ | |
719 | ||
93c89ab3 RH |
720 | #define REGNO_REG_CLASS(REGNO) \ |
721 | ((REGNO) == 27 ? PV_REG \ | |
722 | : (REGNO) >= 32 && (REGNO) <= 62 ? FLOAT_REGS \ | |
723 | : GENERAL_REGS) | |
1a94ca49 RK |
724 | |
725 | /* The class value for index registers, and the one for base regs. */ | |
726 | #define INDEX_REG_CLASS NO_REGS | |
727 | #define BASE_REG_CLASS GENERAL_REGS | |
728 | ||
729 | /* Get reg_class from a letter such as appears in the machine description. */ | |
730 | ||
731 | #define REG_CLASS_FROM_LETTER(C) \ | |
93c89ab3 | 732 | ((C) == 'c' ? PV_REG : (C) == 'f' ? FLOAT_REGS : NO_REGS) |
1a94ca49 RK |
733 | |
734 | /* Define this macro to change register usage conditional on target flags. */ | |
735 | /* #define CONDITIONAL_REGISTER_USAGE */ | |
736 | ||
737 | /* The letters I, J, K, L, M, N, O, and P in a register constraint string | |
738 | can be used to stand for particular ranges of immediate operands. | |
739 | This macro defines what the ranges are. | |
740 | C is the letter, and VALUE is a constant value. | |
741 | Return 1 if VALUE is in the range specified by C. | |
742 | ||
743 | For Alpha: | |
744 | `I' is used for the range of constants most insns can contain. | |
745 | `J' is the constant zero. | |
746 | `K' is used for the constant in an LDA insn. | |
747 | `L' is used for the constant in a LDAH insn. | |
748 | `M' is used for the constants that can be AND'ed with using a ZAP insn. | |
749 | `N' is used for complemented 8-bit constants. | |
750 | `O' is used for negated 8-bit constants. | |
751 | `P' is used for the constants 1, 2 and 3. */ | |
752 | ||
753 | #define CONST_OK_FOR_LETTER_P(VALUE, C) \ | |
754 | ((C) == 'I' ? (unsigned HOST_WIDE_INT) (VALUE) < 0x100 \ | |
755 | : (C) == 'J' ? (VALUE) == 0 \ | |
756 | : (C) == 'K' ? (unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000 \ | |
757 | : (C) == 'L' ? (((VALUE) & 0xffff) == 0 \ | |
c905c108 | 758 | && (((VALUE)) >> 31 == -1 || (VALUE) >> 31 == 0)) \ |
1a94ca49 RK |
759 | : (C) == 'M' ? zap_mask (VALUE) \ |
760 | : (C) == 'N' ? (unsigned HOST_WIDE_INT) (~ (VALUE)) < 0x100 \ | |
761 | : (C) == 'O' ? (unsigned HOST_WIDE_INT) (- (VALUE)) < 0x100 \ | |
762 | : (C) == 'P' ? (VALUE) == 1 || (VALUE) == 2 || (VALUE) == 3 \ | |
763 | : 0) | |
764 | ||
765 | /* Similar, but for floating or large integer constants, and defining letters | |
766 | G and H. Here VALUE is the CONST_DOUBLE rtx itself. | |
767 | ||
768 | For Alpha, `G' is the floating-point constant zero. `H' is a CONST_DOUBLE | |
769 | that is the operand of a ZAP insn. */ | |
770 | ||
771 | #define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) \ | |
772 | ((C) == 'G' ? (GET_MODE_CLASS (GET_MODE (VALUE)) == MODE_FLOAT \ | |
773 | && (VALUE) == CONST0_RTX (GET_MODE (VALUE))) \ | |
774 | : (C) == 'H' ? (GET_MODE (VALUE) == VOIDmode \ | |
775 | && zap_mask (CONST_DOUBLE_LOW (VALUE)) \ | |
776 | && zap_mask (CONST_DOUBLE_HIGH (VALUE))) \ | |
777 | : 0) | |
778 | ||
e560f226 RK |
779 | /* Optional extra constraints for this machine. |
780 | ||
781 | For the Alpha, `Q' means that this is a memory operand but not a | |
ac030a7b | 782 | reference to an unaligned location. |
9ec36da5 | 783 | |
ac030a7b | 784 | `R' is a SYMBOL_REF that has SYMBOL_REF_FLAG set or is the current |
9ec36da5 JL |
785 | function. |
786 | ||
787 | 'S' is a 6-bit constant (valid for a shift insn). */ | |
e560f226 RK |
788 | |
789 | #define EXTRA_CONSTRAINT(OP, C) \ | |
ab87f8c8 | 790 | ((C) == 'Q' ? normal_memory_operand (OP, VOIDmode) \ |
9ec36da5 JL |
791 | : (C) == 'R' ? current_file_function_operand (OP, Pmode) \ |
792 | : (C) == 'S' ? (GET_CODE (OP) == CONST_INT \ | |
793 | && (unsigned HOST_WIDE_INT) INTVAL (OP) < 64) \ | |
e560f226 RK |
794 | : 0) |
795 | ||
1a94ca49 RK |
796 | /* Given an rtx X being reloaded into a reg required to be |
797 | in class CLASS, return the class of reg to actually use. | |
798 | In general this is just CLASS; but on some machines | |
799 | in some cases it is preferable to use a more restrictive class. | |
800 | ||
801 | On the Alpha, all constants except zero go into a floating-point | |
802 | register via memory. */ | |
803 | ||
804 | #define PREFERRED_RELOAD_CLASS(X, CLASS) \ | |
805 | (CONSTANT_P (X) && (X) != const0_rtx && (X) != CONST0_RTX (GET_MODE (X)) \ | |
a6a503ed | 806 | ? ((CLASS) == FLOAT_REGS || (CLASS) == NO_REGS ? NO_REGS : GENERAL_REGS)\ |
1a94ca49 RK |
807 | : (CLASS)) |
808 | ||
809 | /* Loading and storing HImode or QImode values to and from memory | |
810 | usually requires a scratch register. The exceptions are loading | |
e008606e RK |
811 | QImode and HImode from an aligned address to a general register |
812 | unless byte instructions are permitted. | |
ddd5a7c1 | 813 | We also cannot load an unaligned address or a paradoxical SUBREG into an |
e868b518 | 814 | FP register. */ |
1a94ca49 | 815 | |
3611aef0 RH |
816 | #define SECONDARY_INPUT_RELOAD_CLASS(CLASS,MODE,IN) \ |
817 | secondary_reload_class((CLASS), (MODE), (IN), 1) | |
818 | ||
819 | #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS,MODE,OUT) \ | |
820 | secondary_reload_class((CLASS), (MODE), (OUT), 0) | |
1a94ca49 RK |
821 | |
822 | /* If we are copying between general and FP registers, we need a memory | |
de4abb91 | 823 | location unless the FIX extension is available. */ |
1a94ca49 | 824 | |
e9a25f70 | 825 | #define SECONDARY_MEMORY_NEEDED(CLASS1,CLASS2,MODE) \ |
de4abb91 | 826 | (! TARGET_FIX && (CLASS1) != (CLASS2)) |
1a94ca49 | 827 | |
acd94aaf RK |
828 | /* Specify the mode to be used for memory when a secondary memory |
829 | location is needed. If MODE is floating-point, use it. Otherwise, | |
830 | widen to a word like the default. This is needed because we always | |
831 | store integers in FP registers in quadword format. This whole | |
832 | area is very tricky! */ | |
833 | #define SECONDARY_MEMORY_NEEDED_MODE(MODE) \ | |
834 | (GET_MODE_CLASS (MODE) == MODE_FLOAT ? (MODE) \ | |
e868b518 | 835 | : GET_MODE_SIZE (MODE) >= 4 ? (MODE) \ |
acd94aaf RK |
836 | : mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0)) |
837 | ||
1a94ca49 RK |
838 | /* Return the maximum number of consecutive registers |
839 | needed to represent mode MODE in a register of class CLASS. */ | |
840 | ||
841 | #define CLASS_MAX_NREGS(CLASS, MODE) \ | |
842 | ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD) | |
843 | ||
c31dfe4d | 844 | /* If defined, gives a class of registers that cannot be used as the |
02188693 | 845 | operand of a SUBREG that changes the mode of the object illegally. */ |
c31dfe4d | 846 | |
02188693 RH |
847 | #define CLASS_CANNOT_CHANGE_MODE FLOAT_REGS |
848 | ||
849 | /* Defines illegal mode changes for CLASS_CANNOT_CHANGE_MODE. */ | |
850 | ||
851 | #define CLASS_CANNOT_CHANGE_MODE_P(FROM,TO) \ | |
852 | (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)) | |
c31dfe4d | 853 | |
1a94ca49 RK |
854 | /* Define the cost of moving between registers of various classes. Moving |
855 | between FLOAT_REGS and anything else except float regs is expensive. | |
856 | In fact, we make it quite expensive because we really don't want to | |
857 | do these moves unless it is clearly worth it. Optimizations may | |
858 | reduce the impact of not being able to allocate a pseudo to a | |
859 | hard register. */ | |
860 | ||
cf011243 | 861 | #define REGISTER_MOVE_COST(MODE, CLASS1, CLASS2) \ |
71d9b493 RH |
862 | (((CLASS1) == FLOAT_REGS) == ((CLASS2) == FLOAT_REGS) \ |
863 | ? 2 \ | |
de4abb91 | 864 | : TARGET_FIX ? 3 : 4+2*alpha_memory_latency) |
1a94ca49 RK |
865 | |
866 | /* A C expressions returning the cost of moving data of MODE from a register to | |
867 | or from memory. | |
868 | ||
869 | On the Alpha, bump this up a bit. */ | |
870 | ||
bcbbac26 | 871 | extern int alpha_memory_latency; |
cbd5b9a2 | 872 | #define MEMORY_MOVE_COST(MODE,CLASS,IN) (2*alpha_memory_latency) |
1a94ca49 RK |
873 | |
874 | /* Provide the cost of a branch. Exact meaning under development. */ | |
875 | #define BRANCH_COST 5 | |
876 | ||
877 | /* Adjust the cost of dependencies. */ | |
878 | ||
879 | #define ADJUST_COST(INSN,LINK,DEP,COST) \ | |
880 | (COST) = alpha_adjust_cost (INSN, LINK, DEP, COST) | |
881 | \f | |
882 | /* Stack layout; function entry, exit and calling. */ | |
883 | ||
884 | /* Define this if pushing a word on the stack | |
885 | makes the stack pointer a smaller address. */ | |
886 | #define STACK_GROWS_DOWNWARD | |
887 | ||
888 | /* Define this if the nominal address of the stack frame | |
889 | is at the high-address end of the local variables; | |
890 | that is, each additional local variable allocated | |
891 | goes at a more negative offset in the frame. */ | |
130d2d72 | 892 | /* #define FRAME_GROWS_DOWNWARD */ |
1a94ca49 RK |
893 | |
894 | /* Offset within stack frame to start allocating local variables at. | |
895 | If FRAME_GROWS_DOWNWARD, this is the offset to the END of the | |
896 | first local allocated. Otherwise, it is the offset to the BEGINNING | |
897 | of the first local allocated. */ | |
898 | ||
52a69200 | 899 | #define STARTING_FRAME_OFFSET 0 |
1a94ca49 RK |
900 | |
901 | /* If we generate an insn to push BYTES bytes, | |
902 | this says how many the stack pointer really advances by. | |
903 | On Alpha, don't define this because there are no push insns. */ | |
904 | /* #define PUSH_ROUNDING(BYTES) */ | |
905 | ||
e008606e RK |
906 | /* Define this to be nonzero if stack checking is built into the ABI. */ |
907 | #define STACK_CHECK_BUILTIN 1 | |
908 | ||
1a94ca49 RK |
909 | /* Define this if the maximum size of all the outgoing args is to be |
910 | accumulated and pushed during the prologue. The amount can be | |
911 | found in the variable current_function_outgoing_args_size. */ | |
f73ad30e | 912 | #define ACCUMULATE_OUTGOING_ARGS 1 |
1a94ca49 RK |
913 | |
914 | /* Offset of first parameter from the argument pointer register value. */ | |
915 | ||
130d2d72 | 916 | #define FIRST_PARM_OFFSET(FNDECL) 0 |
1a94ca49 RK |
917 | |
918 | /* Definitions for register eliminations. | |
919 | ||
978e8952 | 920 | We have two registers that can be eliminated on the Alpha. First, the |
1a94ca49 | 921 | frame pointer register can often be eliminated in favor of the stack |
130d2d72 RK |
922 | pointer register. Secondly, the argument pointer register can always be |
923 | eliminated; it is replaced with either the stack or frame pointer. */ | |
1a94ca49 RK |
924 | |
925 | /* This is an array of structures. Each structure initializes one pair | |
926 | of eliminable registers. The "from" register number is given first, | |
927 | followed by "to". Eliminations of the same "from" register are listed | |
928 | in order of preference. */ | |
929 | ||
52a69200 RK |
930 | #define ELIMINABLE_REGS \ |
931 | {{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | |
932 | { ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ | |
933 | { FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ | |
934 | { FRAME_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}} | |
1a94ca49 RK |
935 | |
936 | /* Given FROM and TO register numbers, say whether this elimination is allowed. | |
937 | Frame pointer elimination is automatically handled. | |
938 | ||
130d2d72 | 939 | All eliminations are valid since the cases where FP can't be |
1a94ca49 RK |
940 | eliminated are already handled. */ |
941 | ||
130d2d72 | 942 | #define CAN_ELIMINATE(FROM, TO) 1 |
1a94ca49 | 943 | |
52a69200 RK |
944 | /* Round up to a multiple of 16 bytes. */ |
945 | #define ALPHA_ROUND(X) (((X) + 15) & ~ 15) | |
946 | ||
1a94ca49 RK |
947 | /* Define the offset between two registers, one to be eliminated, and the other |
948 | its replacement, at the start of a routine. */ | |
949 | #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \ | |
52a69200 RK |
950 | { if ((FROM) == FRAME_POINTER_REGNUM) \ |
951 | (OFFSET) = (ALPHA_ROUND (current_function_outgoing_args_size) \ | |
952 | + alpha_sa_size ()); \ | |
953 | else if ((FROM) == ARG_POINTER_REGNUM) \ | |
954 | (OFFSET) = (ALPHA_ROUND (current_function_outgoing_args_size) \ | |
955 | + alpha_sa_size () \ | |
d772039b RK |
956 | + (ALPHA_ROUND (get_frame_size () \ |
957 | + current_function_pretend_args_size) \ | |
958 | - current_function_pretend_args_size)); \ | |
c8d8ed65 RK |
959 | else \ |
960 | abort (); \ | |
1a94ca49 RK |
961 | } |
962 | ||
963 | /* Define this if stack space is still allocated for a parameter passed | |
964 | in a register. */ | |
965 | /* #define REG_PARM_STACK_SPACE */ | |
966 | ||
967 | /* Value is the number of bytes of arguments automatically | |
968 | popped when returning from a subroutine call. | |
8b109b37 | 969 | FUNDECL is the declaration node of the function (as a tree), |
1a94ca49 RK |
970 | FUNTYPE is the data type of the function (as a tree), |
971 | or for a library call it is an identifier node for the subroutine name. | |
972 | SIZE is the number of bytes of arguments passed on the stack. */ | |
973 | ||
8b109b37 | 974 | #define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) 0 |
1a94ca49 RK |
975 | |
976 | /* Define how to find the value returned by a function. | |
977 | VALTYPE is the data type of the value (as a tree). | |
978 | If the precise function being called is known, FUNC is its FUNCTION_DECL; | |
979 | otherwise, FUNC is 0. | |
980 | ||
981 | On Alpha the value is found in $0 for integer functions and | |
982 | $f0 for floating-point functions. */ | |
983 | ||
c5c76735 | 984 | #define FUNCTION_VALUE(VALTYPE, FUNC) \ |
4c020733 | 985 | gen_rtx_REG (((INTEGRAL_TYPE_P (VALTYPE) \ |
c5c76735 JL |
986 | && TYPE_PRECISION (VALTYPE) < BITS_PER_WORD) \ |
987 | || POINTER_TYPE_P (VALTYPE)) \ | |
4c020733 RH |
988 | ? word_mode : TYPE_MODE (VALTYPE), \ |
989 | ((TARGET_FPREGS \ | |
c5c76735 | 990 | && (TREE_CODE (VALTYPE) == REAL_TYPE \ |
4c020733 | 991 | || TREE_CODE (VALTYPE) == COMPLEX_TYPE)) \ |
c5c76735 | 992 | ? 32 : 0)) |
1a94ca49 RK |
993 | |
994 | /* Define how to find the value returned by a library function | |
995 | assuming the value has mode MODE. */ | |
996 | ||
c5c76735 | 997 | #define LIBCALL_VALUE(MODE) \ |
4c020733 | 998 | gen_rtx_REG (MODE, \ |
c5c76735 JL |
999 | (TARGET_FPREGS \ |
1000 | && (GET_MODE_CLASS (MODE) == MODE_FLOAT \ | |
4c020733 | 1001 | || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ |
c5c76735 | 1002 | ? 32 : 0)) |
1a94ca49 | 1003 | |
130d2d72 RK |
1004 | /* The definition of this macro implies that there are cases where |
1005 | a scalar value cannot be returned in registers. | |
1006 | ||
1007 | For the Alpha, any structure or union type is returned in memory, as | |
1008 | are integers whose size is larger than 64 bits. */ | |
1009 | ||
1010 | #define RETURN_IN_MEMORY(TYPE) \ | |
e14fa9c4 | 1011 | (TYPE_MODE (TYPE) == BLKmode \ |
5495cc55 RH |
1012 | || TYPE_MODE (TYPE) == TFmode \ |
1013 | || TYPE_MODE (TYPE) == TCmode \ | |
130d2d72 RK |
1014 | || (TREE_CODE (TYPE) == INTEGER_TYPE && TYPE_PRECISION (TYPE) > 64)) |
1015 | ||
1a94ca49 RK |
1016 | /* 1 if N is a possible register number for a function value |
1017 | as seen by the caller. */ | |
1018 | ||
e5958492 RK |
1019 | #define FUNCTION_VALUE_REGNO_P(N) \ |
1020 | ((N) == 0 || (N) == 1 || (N) == 32 || (N) == 33) | |
1a94ca49 RK |
1021 | |
1022 | /* 1 if N is a possible register number for function argument passing. | |
1023 | On Alpha, these are $16-$21 and $f16-$f21. */ | |
1024 | ||
1025 | #define FUNCTION_ARG_REGNO_P(N) \ | |
1026 | (((N) >= 16 && (N) <= 21) || ((N) >= 16 + 32 && (N) <= 21 + 32)) | |
1027 | \f | |
1028 | /* Define a data type for recording info about an argument list | |
1029 | during the scan of that argument list. This data type should | |
1030 | hold all necessary information about the function itself | |
1031 | and about the args processed so far, enough to enable macros | |
1032 | such as FUNCTION_ARG to determine where the next arg should go. | |
1033 | ||
1034 | On Alpha, this is a single integer, which is a number of words | |
1035 | of arguments scanned so far. | |
1036 | Thus 6 or more means all following args should go on the stack. */ | |
1037 | ||
1038 | #define CUMULATIVE_ARGS int | |
1039 | ||
1040 | /* Initialize a variable CUM of type CUMULATIVE_ARGS | |
1041 | for a call to a function whose data type is FNTYPE. | |
1042 | For a library call, FNTYPE is 0. */ | |
1043 | ||
2c7ee1a6 | 1044 | #define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) (CUM) = 0 |
1a94ca49 RK |
1045 | |
1046 | /* Define intermediate macro to compute the size (in registers) of an argument | |
1047 | for the Alpha. */ | |
1048 | ||
1049 | #define ALPHA_ARG_SIZE(MODE, TYPE, NAMED) \ | |
5495cc55 RH |
1050 | ((MODE) == TFmode || (MODE) == TCmode ? 1 \ |
1051 | : (((MODE) == BLKmode ? int_size_in_bytes (TYPE) : GET_MODE_SIZE (MODE)) \ | |
1052 | + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD) | |
1a94ca49 RK |
1053 | |
1054 | /* Update the data in CUM to advance over an argument | |
1055 | of mode MODE and data type TYPE. | |
1056 | (TYPE is null for libcalls where that information may not be available.) */ | |
1057 | ||
1058 | #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \ | |
1059 | if (MUST_PASS_IN_STACK (MODE, TYPE)) \ | |
1060 | (CUM) = 6; \ | |
1061 | else \ | |
1062 | (CUM) += ALPHA_ARG_SIZE (MODE, TYPE, NAMED) | |
1063 | ||
1064 | /* Determine where to put an argument to a function. | |
1065 | Value is zero to push the argument on the stack, | |
1066 | or a hard register in which to store the argument. | |
1067 | ||
1068 | MODE is the argument's machine mode. | |
1069 | TYPE is the data type of the argument (as a tree). | |
1070 | This is null for libcalls where that information may | |
1071 | not be available. | |
1072 | CUM is a variable of type CUMULATIVE_ARGS which gives info about | |
1073 | the preceding args and about the function being called. | |
1074 | NAMED is nonzero if this argument is a named parameter | |
1075 | (otherwise it is an extra parameter matching an ellipsis). | |
1076 | ||
1077 | On Alpha the first 6 words of args are normally in registers | |
1078 | and the rest are pushed. */ | |
1079 | ||
1080 | #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ | |
5495cc55 RH |
1081 | function_arg((CUM), (MODE), (TYPE), (NAMED)) |
1082 | ||
1083 | /* A C expression that indicates when an argument must be passed by | |
1084 | reference. If nonzero for an argument, a copy of that argument is | |
1085 | made in memory and a pointer to the argument is passed instead of | |
1086 | the argument itself. The pointer is passed in whatever way is | |
1087 | appropriate for passing a pointer to that type. */ | |
1088 | ||
1089 | #define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \ | |
1090 | ((MODE) == TFmode || (MODE) == TCmode) | |
1a94ca49 | 1091 | |
1a94ca49 RK |
1092 | /* Specify the padding direction of arguments. |
1093 | ||
1094 | On the Alpha, we must pad upwards in order to be able to pass args in | |
1095 | registers. */ | |
1096 | ||
1097 | #define FUNCTION_ARG_PADDING(MODE, TYPE) upward | |
1098 | ||
1099 | /* For an arg passed partly in registers and partly in memory, | |
1100 | this is the number of registers used. | |
1101 | For args passed entirely in registers or entirely in memory, zero. */ | |
1102 | ||
1103 | #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \ | |
1104 | ((CUM) < 6 && 6 < (CUM) + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \ | |
1105 | ? 6 - (CUM) : 0) | |
1106 | ||
130d2d72 RK |
1107 | /* Perform any needed actions needed for a function that is receiving a |
1108 | variable number of arguments. | |
1109 | ||
1110 | CUM is as above. | |
1111 | ||
1112 | MODE and TYPE are the mode and type of the current parameter. | |
1113 | ||
1114 | PRETEND_SIZE is a variable that should be set to the amount of stack | |
1115 | that must be pushed by the prolog to pretend that our caller pushed | |
1116 | it. | |
1117 | ||
1118 | Normally, this macro will push all remaining incoming registers on the | |
1119 | stack and set PRETEND_SIZE to the length of the registers pushed. | |
1120 | ||
1121 | On the Alpha, we allocate space for all 12 arg registers, but only | |
1122 | push those that are remaining. | |
1123 | ||
1124 | However, if NO registers need to be saved, don't allocate any space. | |
1125 | This is not only because we won't need the space, but because AP includes | |
1126 | the current_pretend_args_size and we don't want to mess up any | |
7a92339b RK |
1127 | ap-relative addresses already made. |
1128 | ||
1129 | If we are not to use the floating-point registers, save the integer | |
1130 | registers where we would put the floating-point registers. This is | |
1131 | not the most efficient way to implement varargs with just one register | |
1132 | class, but it isn't worth doing anything more efficient in this rare | |
1133 | case. */ | |
1134 | ||
130d2d72 RK |
1135 | #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \ |
1136 | { if ((CUM) < 6) \ | |
1137 | { \ | |
1138 | if (! (NO_RTL)) \ | |
1139 | { \ | |
63966b3b RH |
1140 | rtx tmp; int set = get_varargs_alias_set (); \ |
1141 | tmp = gen_rtx_MEM (BLKmode, \ | |
1142 | plus_constant (virtual_incoming_args_rtx, \ | |
1143 | ((CUM) + 6)* UNITS_PER_WORD)); \ | |
1144 | MEM_ALIAS_SET (tmp) = set; \ | |
130d2d72 | 1145 | move_block_from_reg \ |
63966b3b | 1146 | (16 + CUM, tmp, \ |
02892e06 | 1147 | 6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \ |
63966b3b RH |
1148 | \ |
1149 | tmp = gen_rtx_MEM (BLKmode, \ | |
1150 | plus_constant (virtual_incoming_args_rtx, \ | |
1151 | (CUM) * UNITS_PER_WORD)); \ | |
1152 | MEM_ALIAS_SET (tmp) = set; \ | |
130d2d72 | 1153 | move_block_from_reg \ |
63966b3b | 1154 | (16 + (TARGET_FPREGS ? 32 : 0) + CUM, tmp, \ |
02892e06 | 1155 | 6 - (CUM), (6 - (CUM)) * UNITS_PER_WORD); \ |
130d2d72 RK |
1156 | } \ |
1157 | PRETEND_SIZE = 12 * UNITS_PER_WORD; \ | |
1158 | } \ | |
1159 | } | |
1160 | ||
7d89dda5 RH |
1161 | /* We do not allow indirect calls to be optimized into sibling calls, nor |
1162 | can we allow a call to a function in a different compilation unit to | |
1163 | be optimized into a sibcall. Except if the function is known not to | |
1164 | return, in which case our caller doesn't care what the gp is. */ | |
1165 | #define FUNCTION_OK_FOR_SIBCALL(DECL) \ | |
1166 | (DECL \ | |
1167 | && ((TREE_ASM_WRITTEN (DECL) && !flag_pic) \ | |
9a1ba437 | 1168 | || ! TREE_PUBLIC (DECL))) |
7d89dda5 | 1169 | |
c8e9adec RK |
1170 | /* Try to output insns to set TARGET equal to the constant C if it can be |
1171 | done in less than N insns. Do all computations in MODE. Returns the place | |
1172 | where the output has been placed if it can be done and the insns have been | |
1173 | emitted. If it would take more than N insns, zero is returned and no | |
1174 | insns and emitted. */ | |
92e40a7a | 1175 | |
1a94ca49 RK |
1176 | /* Define the information needed to generate branch and scc insns. This is |
1177 | stored from the compare operation. Note that we can't use "rtx" here | |
1178 | since it hasn't been defined! */ | |
1179 | ||
6db21c7f RH |
1180 | struct alpha_compare |
1181 | { | |
1182 | struct rtx_def *op0, *op1; | |
1183 | int fp_p; | |
1184 | }; | |
1185 | ||
1186 | extern struct alpha_compare alpha_compare; | |
1a94ca49 | 1187 | |
e5958492 | 1188 | /* Make (or fake) .linkage entry for function call. |
e5958492 | 1189 | IS_LOCAL is 0 if name is used in call, 1 if name is used in definition. */ |
e5958492 | 1190 | |
bcbbac26 RH |
1191 | /* This macro defines the start of an assembly comment. */ |
1192 | ||
1193 | #define ASM_COMMENT_START " #" | |
1194 | ||
acd92049 | 1195 | /* This macro produces the initial definition of a function. */ |
1a94ca49 | 1196 | |
acd92049 RH |
1197 | #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \ |
1198 | alpha_start_function(FILE,NAME,DECL); | |
1a94ca49 | 1199 | |
acd92049 | 1200 | /* This macro closes up a function definition for the assembler. */ |
9c0e94a5 | 1201 | |
acd92049 RH |
1202 | #define ASM_DECLARE_FUNCTION_SIZE(FILE,NAME,DECL) \ |
1203 | alpha_end_function(FILE,NAME,DECL) | |
acd92049 | 1204 | |
acd92049 RH |
1205 | /* Output any profiling code before the prologue. */ |
1206 | ||
1207 | #define PROFILE_BEFORE_PROLOGUE 1 | |
1208 | ||
1a94ca49 | 1209 | /* Output assembler code to FILE to increment profiler label # LABELNO |
e0fb9029 | 1210 | for profiling a function entry. Under OSF/1, profiling is enabled |
ddd5a7c1 | 1211 | by simply passing -pg to the assembler and linker. */ |
85d159a3 | 1212 | |
e0fb9029 | 1213 | #define FUNCTION_PROFILER(FILE, LABELNO) |
85d159a3 RK |
1214 | |
1215 | /* Output assembler code to FILE to initialize this source file's | |
1216 | basic block profiling info, if that has not already been done. | |
1217 | This assumes that __bb_init_func doesn't garble a1-a5. */ | |
1218 | ||
1219 | #define FUNCTION_BLOCK_PROFILER(FILE, LABELNO) \ | |
1220 | do { \ | |
1221 | ASM_OUTPUT_REG_PUSH (FILE, 16); \ | |
a62eb16f JW |
1222 | fputs ("\tlda $16,$PBX32\n", (FILE)); \ |
1223 | fputs ("\tldq $26,0($16)\n", (FILE)); \ | |
1224 | fputs ("\tbne $26,1f\n", (FILE)); \ | |
1225 | fputs ("\tlda $27,__bb_init_func\n", (FILE)); \ | |
1226 | fputs ("\tjsr $26,($27),__bb_init_func\n", (FILE)); \ | |
1227 | fputs ("\tldgp $29,0($26)\n", (FILE)); \ | |
1228 | fputs ("1:\n", (FILE)); \ | |
85d159a3 RK |
1229 | ASM_OUTPUT_REG_POP (FILE, 16); \ |
1230 | } while (0); | |
1231 | ||
1232 | /* Output assembler code to FILE to increment the entry-count for | |
1233 | the BLOCKNO'th basic block in this source file. */ | |
1234 | ||
1235 | #define BLOCK_PROFILER(FILE, BLOCKNO) \ | |
1236 | do { \ | |
1237 | int blockn = (BLOCKNO); \ | |
a62eb16f | 1238 | fputs ("\tsubq $30,16,$30\n", (FILE)); \ |
70a76f06 RK |
1239 | fputs ("\tstq $26,0($30)\n", (FILE)); \ |
1240 | fputs ("\tstq $27,8($30)\n", (FILE)); \ | |
1241 | fputs ("\tlda $26,$PBX34\n", (FILE)); \ | |
1242 | fprintf ((FILE), "\tldq $27,%d($26)\n", 8*blockn); \ | |
1243 | fputs ("\taddq $27,1,$27\n", (FILE)); \ | |
1244 | fprintf ((FILE), "\tstq $27,%d($26)\n", 8*blockn); \ | |
1245 | fputs ("\tldq $26,0($30)\n", (FILE)); \ | |
1246 | fputs ("\tldq $27,8($30)\n", (FILE)); \ | |
a62eb16f | 1247 | fputs ("\taddq $30,16,$30\n", (FILE)); \ |
85d159a3 | 1248 | } while (0) |
1a94ca49 | 1249 | |
1a94ca49 RK |
1250 | |
1251 | /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, | |
1252 | the stack pointer does not matter. The value is tested only in | |
1253 | functions that have frame pointers. | |
1254 | No definition is equivalent to always zero. */ | |
1255 | ||
1256 | #define EXIT_IGNORE_STACK 1 | |
c112e233 RH |
1257 | |
1258 | /* Define registers used by the epilogue and return instruction. */ | |
1259 | ||
1260 | #define EPILOGUE_USES(REGNO) ((REGNO) == 26) | |
1a94ca49 RK |
1261 | \f |
1262 | /* Output assembler code for a block containing the constant parts | |
1263 | of a trampoline, leaving space for the variable parts. | |
1264 | ||
1265 | The trampoline should set the static chain pointer to value placed | |
7981384f RK |
1266 | into the trampoline and should branch to the specified routine. |
1267 | Note that $27 has been set to the address of the trampoline, so we can | |
1268 | use it for addressability of the two data items. Trampolines are always | |
1269 | aligned to FUNCTION_BOUNDARY, which is 64 bits. */ | |
1a94ca49 RK |
1270 | |
1271 | #define TRAMPOLINE_TEMPLATE(FILE) \ | |
c714f03d | 1272 | do { \ |
7981384f | 1273 | fprintf (FILE, "\tldq $1,24($27)\n"); \ |
1a94ca49 | 1274 | fprintf (FILE, "\tldq $27,16($27)\n"); \ |
7981384f RK |
1275 | fprintf (FILE, "\tjmp $31,($27),0\n"); \ |
1276 | fprintf (FILE, "\tnop\n"); \ | |
1a94ca49 | 1277 | fprintf (FILE, "\t.quad 0,0\n"); \ |
c714f03d | 1278 | } while (0) |
1a94ca49 | 1279 | |
3a523eeb RS |
1280 | /* Section in which to place the trampoline. On Alpha, instructions |
1281 | may only be placed in a text segment. */ | |
1282 | ||
1283 | #define TRAMPOLINE_SECTION text_section | |
1284 | ||
1a94ca49 RK |
1285 | /* Length in units of the trampoline for entering a nested function. */ |
1286 | ||
7981384f | 1287 | #define TRAMPOLINE_SIZE 32 |
1a94ca49 RK |
1288 | |
1289 | /* Emit RTL insns to initialize the variable parts of a trampoline. | |
1290 | FNADDR is an RTX for the address of the function's pure code. | |
c714f03d | 1291 | CXT is an RTX for the static chain value for the function. */ |
1a94ca49 | 1292 | |
9ec36da5 | 1293 | #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ |
c714f03d | 1294 | alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, 8) |
675f0e7c RK |
1295 | |
1296 | /* A C expression whose value is RTL representing the value of the return | |
1297 | address for the frame COUNT steps up from the current frame. | |
1298 | FRAMEADDR is the frame pointer of the COUNT frame, or the frame pointer of | |
952fc2ed | 1299 | the COUNT-1 frame if RETURN_ADDR_IN_PREVIOUS_FRAME is defined. */ |
675f0e7c | 1300 | |
9ecc37f0 | 1301 | #define RETURN_ADDR_RTX alpha_return_addr |
9ecc37f0 | 1302 | |
6abc6f40 RH |
1303 | /* Before the prologue, RA lives in $26. */ |
1304 | #define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, 26) | |
8034da37 | 1305 | #define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (26) |
4573b4de RH |
1306 | |
1307 | /* Describe how we implement __builtin_eh_return. */ | |
1308 | #define EH_RETURN_DATA_REGNO(N) ((N) < 4 ? (N) + 16 : INVALID_REGNUM) | |
1309 | #define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 28) | |
1310 | #define EH_RETURN_HANDLER_RTX \ | |
1311 | gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \ | |
1312 | current_function_outgoing_args_size)) | |
675f0e7c | 1313 | \f |
1a94ca49 RK |
1314 | /* Addressing modes, and classification of registers for them. */ |
1315 | ||
940da324 JL |
1316 | /* #define HAVE_POST_INCREMENT 0 */ |
1317 | /* #define HAVE_POST_DECREMENT 0 */ | |
1a94ca49 | 1318 | |
940da324 JL |
1319 | /* #define HAVE_PRE_DECREMENT 0 */ |
1320 | /* #define HAVE_PRE_INCREMENT 0 */ | |
1a94ca49 RK |
1321 | |
1322 | /* Macros to check register numbers against specific register classes. */ | |
1323 | ||
1324 | /* These assume that REGNO is a hard or pseudo reg number. | |
1325 | They give nonzero only if REGNO is a hard reg of the suitable class | |
1326 | or a pseudo reg currently allocated to a suitable hard reg. | |
1327 | Since they use reg_renumber, they are safe only once reg_renumber | |
1328 | has been allocated, which happens in local-alloc.c. */ | |
1329 | ||
1330 | #define REGNO_OK_FOR_INDEX_P(REGNO) 0 | |
1331 | #define REGNO_OK_FOR_BASE_P(REGNO) \ | |
52a69200 RK |
1332 | ((REGNO) < 32 || (unsigned) reg_renumber[REGNO] < 32 \ |
1333 | || (REGNO) == 63 || reg_renumber[REGNO] == 63) | |
1a94ca49 RK |
1334 | \f |
1335 | /* Maximum number of registers that can appear in a valid memory address. */ | |
1336 | #define MAX_REGS_PER_ADDRESS 1 | |
1337 | ||
1338 | /* Recognize any constant value that is a valid address. For the Alpha, | |
1339 | there are only constants none since we want to use LDA to load any | |
1340 | symbolic addresses into registers. */ | |
1341 | ||
1342 | #define CONSTANT_ADDRESS_P(X) \ | |
1343 | (GET_CODE (X) == CONST_INT \ | |
1344 | && (unsigned HOST_WIDE_INT) (INTVAL (X) + 0x8000) < 0x10000) | |
1345 | ||
1346 | /* Include all constant integers and constant doubles, but not | |
1347 | floating-point, except for floating-point zero. */ | |
1348 | ||
1349 | #define LEGITIMATE_CONSTANT_P(X) \ | |
1350 | (GET_MODE_CLASS (GET_MODE (X)) != MODE_FLOAT \ | |
1351 | || (X) == CONST0_RTX (GET_MODE (X))) | |
1352 | ||
1353 | /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx | |
1354 | and check its validity for a certain class. | |
1355 | We have two alternate definitions for each of them. | |
1356 | The usual definition accepts all pseudo regs; the other rejects | |
1357 | them unless they have been allocated suitable hard regs. | |
1358 | The symbol REG_OK_STRICT causes the latter definition to be used. | |
1359 | ||
1360 | Most source files want to accept pseudo regs in the hope that | |
1361 | they will get allocated to the class that the insn wants them to be in. | |
1362 | Source files for reload pass need to be strict. | |
1363 | After reload, it makes no difference, since pseudo regs have | |
1364 | been eliminated by then. */ | |
1365 | ||
1366 | #ifndef REG_OK_STRICT | |
1367 | ||
1368 | /* Nonzero if X is a hard reg that can be used as an index | |
1369 | or if it is a pseudo reg. */ | |
1370 | #define REG_OK_FOR_INDEX_P(X) 0 | |
5d02b6c2 | 1371 | |
1a94ca49 RK |
1372 | /* Nonzero if X is a hard reg that can be used as a base reg |
1373 | or if it is a pseudo reg. */ | |
1374 | #define REG_OK_FOR_BASE_P(X) \ | |
52a69200 | 1375 | (REGNO (X) < 32 || REGNO (X) == 63 || REGNO (X) >= FIRST_PSEUDO_REGISTER) |
1a94ca49 | 1376 | |
5d02b6c2 RH |
1377 | /* ??? Nonzero if X is the frame pointer, or some virtual register |
1378 | that may eliminate to the frame pointer. These will be allowed to | |
1379 | have offsets greater than 32K. This is done because register | |
1380 | elimination offsets will change the hi/lo split, and if we split | |
1381 | before reload, we will require additional instructions. */ | |
1382 | #define REG_OK_FP_BASE_P(X) \ | |
1383 | (REGNO (X) == 31 || REGNO (X) == 63 \ | |
1384 | || (REGNO (X) >= FIRST_PSEUDO_REGISTER \ | |
1385 | && REGNO (X) < LAST_VIRTUAL_REGISTER)) | |
1386 | ||
1a94ca49 RK |
1387 | #else |
1388 | ||
1389 | /* Nonzero if X is a hard reg that can be used as an index. */ | |
1390 | #define REG_OK_FOR_INDEX_P(X) REGNO_OK_FOR_INDEX_P (REGNO (X)) | |
5d02b6c2 | 1391 | |
1a94ca49 RK |
1392 | /* Nonzero if X is a hard reg that can be used as a base reg. */ |
1393 | #define REG_OK_FOR_BASE_P(X) REGNO_OK_FOR_BASE_P (REGNO (X)) | |
1394 | ||
5d02b6c2 RH |
1395 | #define REG_OK_FP_BASE_P(X) 0 |
1396 | ||
1a94ca49 RK |
1397 | #endif |
1398 | \f | |
1399 | /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression | |
1400 | that is a valid memory address for an instruction. | |
1401 | The MODE argument is the machine mode for the MEM expression | |
1402 | that wants to use this address. | |
1403 | ||
1404 | For Alpha, we have either a constant address or the sum of a register | |
1405 | and a constant address, or just a register. For DImode, any of those | |
1406 | forms can be surrounded with an AND that clear the low-order three bits; | |
1407 | this is an "unaligned" access. | |
1408 | ||
1a94ca49 RK |
1409 | First define the basic valid address. */ |
1410 | ||
4c020733 RH |
1411 | #define GO_IF_LEGITIMATE_SIMPLE_ADDRESS(MODE, X, ADDR) \ |
1412 | { \ | |
1413 | rtx tmp = (X); \ | |
1414 | if (GET_CODE (tmp) == SUBREG \ | |
1415 | && (GET_MODE_SIZE (GET_MODE (tmp)) \ | |
1416 | < GET_MODE_SIZE (GET_MODE (SUBREG_REG (tmp))))) \ | |
1417 | tmp = SUBREG_REG (tmp); \ | |
1418 | if (REG_P (tmp) && REG_OK_FOR_BASE_P (tmp)) \ | |
1419 | goto ADDR; \ | |
1420 | if (CONSTANT_ADDRESS_P (X)) \ | |
1421 | goto ADDR; \ | |
1422 | if (GET_CODE (X) == PLUS) \ | |
1423 | { \ | |
1424 | tmp = XEXP (X, 0); \ | |
1425 | if (GET_CODE (tmp) == SUBREG \ | |
1426 | && (GET_MODE_SIZE (GET_MODE (tmp)) \ | |
1427 | < GET_MODE_SIZE (GET_MODE (SUBREG_REG (tmp))))) \ | |
1428 | tmp = SUBREG_REG (tmp); \ | |
1429 | if (REG_P (tmp)) \ | |
1430 | { \ | |
1431 | if (REG_OK_FP_BASE_P (tmp) \ | |
1432 | && GET_CODE (XEXP (X, 1)) == CONST_INT) \ | |
1433 | goto ADDR; \ | |
1434 | if (REG_OK_FOR_BASE_P (tmp) \ | |
1435 | && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ | |
1436 | goto ADDR; \ | |
1437 | } \ | |
0c5912f4 RH |
1438 | else if (GET_CODE (tmp) == ADDRESSOF \ |
1439 | && CONSTANT_ADDRESS_P (XEXP (X, 1))) \ | |
1440 | goto ADDR; \ | |
4c020733 | 1441 | } \ |
1a94ca49 RK |
1442 | } |
1443 | ||
1444 | /* Now accept the simple address, or, for DImode only, an AND of a simple | |
1445 | address that turns off the low three bits. */ | |
1446 | ||
1a94ca49 RK |
1447 | #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ |
1448 | { GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, X, ADDR); \ | |
1449 | if ((MODE) == DImode \ | |
1450 | && GET_CODE (X) == AND \ | |
1451 | && GET_CODE (XEXP (X, 1)) == CONST_INT \ | |
1452 | && INTVAL (XEXP (X, 1)) == -8) \ | |
1453 | GO_IF_LEGITIMATE_SIMPLE_ADDRESS (MODE, XEXP (X, 0), ADDR); \ | |
1a94ca49 RK |
1454 | } |
1455 | ||
1456 | /* Try machine-dependent ways of modifying an illegitimate address | |
1457 | to be legitimate. If we find one, return the new, valid address. | |
1458 | This macro is used in only one place: `memory_address' in explow.c. | |
1459 | ||
1460 | OLDX is the address as it was before break_out_memory_refs was called. | |
1461 | In some cases it is useful to look at this to decide what needs to be done. | |
1462 | ||
1463 | MODE and WIN are passed so that this macro can use | |
1464 | GO_IF_LEGITIMATE_ADDRESS. | |
1465 | ||
1466 | It is always safe for this macro to do nothing. It exists to recognize | |
1467 | opportunities to optimize the output. | |
1468 | ||
1469 | For the Alpha, there are three cases we handle: | |
1470 | ||
1471 | (1) If the address is (plus reg const_int) and the CONST_INT is not a | |
1472 | valid offset, compute the high part of the constant and add it to the | |
1473 | register. Then our address is (plus temp low-part-const). | |
1474 | (2) If the address is (const (plus FOO const_int)), find the low-order | |
1475 | part of the CONST_INT. Then load FOO plus any high-order part of the | |
1476 | CONST_INT into a register. Our address is (plus reg low-part-const). | |
1477 | This is done to reduce the number of GOT entries. | |
1478 | (3) If we have a (plus reg const), emit the load as in (2), then add | |
1479 | the two registers, and finally generate (plus reg low-part-const) as | |
1480 | our address. */ | |
1481 | ||
1482 | #define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \ | |
1483 | { if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ | |
1484 | && GET_CODE (XEXP (X, 1)) == CONST_INT \ | |
1485 | && ! CONSTANT_ADDRESS_P (XEXP (X, 1))) \ | |
1486 | { \ | |
1487 | HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ | |
1488 | HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \ | |
1489 | HOST_WIDE_INT highpart = val - lowpart; \ | |
1490 | rtx high = GEN_INT (highpart); \ | |
1491 | rtx temp = expand_binop (Pmode, add_optab, XEXP (x, 0), \ | |
80f251fe | 1492 | high, NULL_RTX, 1, OPTAB_LIB_WIDEN); \ |
1a94ca49 RK |
1493 | \ |
1494 | (X) = plus_constant (temp, lowpart); \ | |
1495 | goto WIN; \ | |
1496 | } \ | |
1497 | else if (GET_CODE (X) == CONST \ | |
1498 | && GET_CODE (XEXP (X, 0)) == PLUS \ | |
1499 | && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT) \ | |
1500 | { \ | |
1501 | HOST_WIDE_INT val = INTVAL (XEXP (XEXP (X, 0), 1)); \ | |
1502 | HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \ | |
1503 | HOST_WIDE_INT highpart = val - lowpart; \ | |
1504 | rtx high = XEXP (XEXP (X, 0), 0); \ | |
1505 | \ | |
1506 | if (highpart) \ | |
1507 | high = plus_constant (high, highpart); \ | |
1508 | \ | |
1509 | (X) = plus_constant (force_reg (Pmode, high), lowpart); \ | |
1510 | goto WIN; \ | |
1511 | } \ | |
1512 | else if (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \ | |
1513 | && GET_CODE (XEXP (X, 1)) == CONST \ | |
1514 | && GET_CODE (XEXP (XEXP (X, 1), 0)) == PLUS \ | |
1515 | && GET_CODE (XEXP (XEXP (XEXP (X, 1), 0), 1)) == CONST_INT) \ | |
1516 | { \ | |
1517 | HOST_WIDE_INT val = INTVAL (XEXP (XEXP (XEXP (X, 1), 0), 1)); \ | |
1518 | HOST_WIDE_INT lowpart = (val & 0xffff) - 2 * (val & 0x8000); \ | |
1519 | HOST_WIDE_INT highpart = val - lowpart; \ | |
1520 | rtx high = XEXP (XEXP (XEXP (X, 1), 0), 0); \ | |
1521 | \ | |
1522 | if (highpart) \ | |
1523 | high = plus_constant (high, highpart); \ | |
1524 | \ | |
1525 | high = expand_binop (Pmode, add_optab, XEXP (X, 0), \ | |
1526 | force_reg (Pmode, high), \ | |
80f251fe | 1527 | high, 1, OPTAB_LIB_WIDEN); \ |
1a94ca49 RK |
1528 | (X) = plus_constant (high, lowpart); \ |
1529 | goto WIN; \ | |
1530 | } \ | |
1531 | } | |
1532 | ||
a9a2595b JR |
1533 | /* Try a machine-dependent way of reloading an illegitimate address |
1534 | operand. If we find one, push the reload and jump to WIN. This | |
1535 | macro is used in only one place: `find_reloads_address' in reload.c. | |
1536 | ||
1537 | For the Alpha, we wish to handle large displacements off a base | |
1538 | register by splitting the addend across an ldah and the mem insn. | |
1539 | This cuts number of extra insns needed from 3 to 1. */ | |
1540 | ||
1541 | #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN) \ | |
1542 | do { \ | |
c8ab9901 RH |
1543 | /* We must recognize output that we have already generated ourselves. */ \ |
1544 | if (GET_CODE (X) == PLUS \ | |
1545 | && GET_CODE (XEXP (X, 0)) == PLUS \ | |
1546 | && GET_CODE (XEXP (XEXP (X, 0), 0)) == REG \ | |
1547 | && GET_CODE (XEXP (XEXP (X, 0), 1)) == CONST_INT \ | |
1548 | && GET_CODE (XEXP (X, 1)) == CONST_INT) \ | |
1549 | { \ | |
df4ae160 | 1550 | push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \ |
c8ab9901 RH |
1551 | BASE_REG_CLASS, GET_MODE (X), VOIDmode, 0, 0, \ |
1552 | OPNUM, TYPE); \ | |
1553 | goto WIN; \ | |
1554 | } \ | |
a9a2595b JR |
1555 | if (GET_CODE (X) == PLUS \ |
1556 | && GET_CODE (XEXP (X, 0)) == REG \ | |
1557 | && REGNO (XEXP (X, 0)) < FIRST_PSEUDO_REGISTER \ | |
1558 | && REG_MODE_OK_FOR_BASE_P (XEXP (X, 0), MODE) \ | |
1559 | && GET_CODE (XEXP (X, 1)) == CONST_INT) \ | |
1560 | { \ | |
1561 | HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \ | |
1562 | HOST_WIDE_INT low = ((val & 0xffff) ^ 0x8000) - 0x8000; \ | |
1563 | HOST_WIDE_INT high \ | |
1564 | = (((val - low) & 0xffffffff) ^ 0x80000000) - 0x80000000; \ | |
1565 | \ | |
1566 | /* Check for 32-bit overflow. */ \ | |
1567 | if (high + low != val) \ | |
1568 | break; \ | |
1569 | \ | |
1570 | /* Reload the high part into a base reg; leave the low part \ | |
1571 | in the mem directly. */ \ | |
1572 | \ | |
1573 | X = gen_rtx_PLUS (GET_MODE (X), \ | |
1574 | gen_rtx_PLUS (GET_MODE (X), XEXP (X, 0), \ | |
1575 | GEN_INT (high)), \ | |
1576 | GEN_INT (low)); \ | |
1577 | \ | |
df4ae160 | 1578 | push_reload (XEXP (X, 0), NULL_RTX, &XEXP (X, 0), NULL, \ |
a9a2595b JR |
1579 | BASE_REG_CLASS, GET_MODE (X), VOIDmode, 0, 0, \ |
1580 | OPNUM, TYPE); \ | |
1581 | goto WIN; \ | |
1582 | } \ | |
1583 | } while (0) | |
1584 | ||
1a94ca49 RK |
1585 | /* Go to LABEL if ADDR (a legitimate address expression) |
1586 | has an effect that depends on the machine mode it is used for. | |
1587 | On the Alpha this is true only for the unaligned modes. We can | |
1588 | simplify this test since we know that the address must be valid. */ | |
1589 | ||
1590 | #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR,LABEL) \ | |
1591 | { if (GET_CODE (ADDR) == AND) goto LABEL; } | |
1592 | ||
1593 | /* Compute the cost of an address. For the Alpha, all valid addresses are | |
1594 | the same cost. */ | |
1595 | ||
1596 | #define ADDRESS_COST(X) 0 | |
1597 | ||
2ea844d3 RH |
1598 | /* Machine-dependent reorg pass. */ |
1599 | #define MACHINE_DEPENDENT_REORG(X) alpha_reorg(X) | |
1a94ca49 RK |
1600 | \f |
1601 | /* Specify the machine mode that this machine uses | |
1602 | for the index in the tablejump instruction. */ | |
1603 | #define CASE_VECTOR_MODE SImode | |
1604 | ||
18543a22 ILT |
1605 | /* Define as C expression which evaluates to nonzero if the tablejump |
1606 | instruction expects the table to contain offsets from the address of the | |
3aa9d5b6 | 1607 | table. |
b0435cf4 | 1608 | |
3aa9d5b6 | 1609 | Do not define this if the table should contain absolute addresses. |
260ced47 RK |
1610 | On the Alpha, the table is really GP-relative, not relative to the PC |
1611 | of the table, but we pretend that it is PC-relative; this should be OK, | |
0076aa6b | 1612 | but we should try to find some better way sometime. */ |
18543a22 | 1613 | #define CASE_VECTOR_PC_RELATIVE 1 |
1a94ca49 RK |
1614 | |
1615 | /* Specify the tree operation to be used to convert reals to integers. */ | |
1616 | #define IMPLICIT_FIX_EXPR FIX_ROUND_EXPR | |
1617 | ||
1618 | /* This is the kind of divide that is easiest to do in the general case. */ | |
1619 | #define EASY_DIV_EXPR TRUNC_DIV_EXPR | |
1620 | ||
1621 | /* Define this as 1 if `char' should by default be signed; else as 0. */ | |
1622 | #define DEFAULT_SIGNED_CHAR 1 | |
1623 | ||
1624 | /* This flag, if defined, says the same insns that convert to a signed fixnum | |
1625 | also convert validly to an unsigned one. | |
1626 | ||
1627 | We actually lie a bit here as overflow conditions are different. But | |
1628 | they aren't being checked anyway. */ | |
1629 | ||
1630 | #define FIXUNS_TRUNC_LIKE_FIX_TRUNC | |
1631 | ||
1632 | /* Max number of bytes we can move to or from memory | |
1633 | in one reasonably fast instruction. */ | |
1634 | ||
1635 | #define MOVE_MAX 8 | |
1636 | ||
7e24ffc9 HPN |
1637 | /* If a memory-to-memory move would take MOVE_RATIO or more simple |
1638 | move-instruction pairs, we will do a movstr or libcall instead. | |
1639 | ||
1640 | Without byte/word accesses, we want no more than four instructions; | |
1641 | with, several single byte accesses are better. */ | |
6c174fc0 RH |
1642 | |
1643 | #define MOVE_RATIO (TARGET_BWX ? 7 : 2) | |
1644 | ||
1a94ca49 RK |
1645 | /* Largest number of bytes of an object that can be placed in a register. |
1646 | On the Alpha we have plenty of registers, so use TImode. */ | |
1647 | #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (TImode) | |
1648 | ||
1649 | /* Nonzero if access to memory by bytes is no faster than for words. | |
1650 | Also non-zero if doing byte operations (specifically shifts) in registers | |
1651 | is undesirable. | |
1652 | ||
1653 | On the Alpha, we want to not use the byte operation and instead use | |
1654 | masking operations to access fields; these will save instructions. */ | |
1655 | ||
1656 | #define SLOW_BYTE_ACCESS 1 | |
1657 | ||
9a63901f RK |
1658 | /* Define if operations between registers always perform the operation |
1659 | on the full register even if a narrower mode is specified. */ | |
1660 | #define WORD_REGISTER_OPERATIONS | |
1661 | ||
1662 | /* Define if loading in MODE, an integral mode narrower than BITS_PER_WORD | |
1663 | will either zero-extend or sign-extend. The value of this macro should | |
1664 | be the code that says which one of the two operations is implicitly | |
1665 | done, NIL if none. */ | |
b7747781 | 1666 | #define LOAD_EXTEND_OP(MODE) ((MODE) == SImode ? SIGN_EXTEND : ZERO_EXTEND) |
1a94ca49 | 1667 | |
225211e2 RK |
1668 | /* Define if loading short immediate values into registers sign extends. */ |
1669 | #define SHORT_IMMEDIATES_SIGN_EXTEND | |
1670 | ||
1a94ca49 RK |
1671 | /* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits |
1672 | is done just by pretending it is already truncated. */ | |
1673 | #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 | |
1674 | ||
1675 | /* We assume that the store-condition-codes instructions store 0 for false | |
1676 | and some other value for true. This is the value stored for true. */ | |
1677 | ||
1678 | #define STORE_FLAG_VALUE 1 | |
1679 | ||
1680 | /* Define the value returned by a floating-point comparison instruction. */ | |
1681 | ||
12530dbe RH |
1682 | #define FLOAT_STORE_FLAG_VALUE(MODE) \ |
1683 | REAL_VALUE_ATOF ((TARGET_FLOAT_VAX ? "0.5" : "2.0"), (MODE)) | |
1a94ca49 | 1684 | |
35bb77fd RK |
1685 | /* Canonicalize a comparison from one we don't have to one we do have. */ |
1686 | ||
1687 | #define CANONICALIZE_COMPARISON(CODE,OP0,OP1) \ | |
1688 | do { \ | |
1689 | if (((CODE) == GE || (CODE) == GT || (CODE) == GEU || (CODE) == GTU) \ | |
1690 | && (GET_CODE (OP1) == REG || (OP1) == const0_rtx)) \ | |
1691 | { \ | |
1692 | rtx tem = (OP0); \ | |
1693 | (OP0) = (OP1); \ | |
1694 | (OP1) = tem; \ | |
1695 | (CODE) = swap_condition (CODE); \ | |
1696 | } \ | |
1697 | if (((CODE) == LT || (CODE) == LTU) \ | |
1698 | && GET_CODE (OP1) == CONST_INT && INTVAL (OP1) == 256) \ | |
1699 | { \ | |
1700 | (CODE) = (CODE) == LT ? LE : LEU; \ | |
1701 | (OP1) = GEN_INT (255); \ | |
1702 | } \ | |
1703 | } while (0) | |
1704 | ||
1a94ca49 RK |
1705 | /* Specify the machine mode that pointers have. |
1706 | After generation of rtl, the compiler makes no further distinction | |
1707 | between pointers and any other objects of this machine mode. */ | |
1708 | #define Pmode DImode | |
1709 | ||
1710 | /* Mode of a function address in a call instruction (for indexing purposes). */ | |
1711 | ||
1712 | #define FUNCTION_MODE Pmode | |
1713 | ||
1714 | /* Define this if addresses of constant functions | |
1715 | shouldn't be put through pseudo regs where they can be cse'd. | |
1716 | Desirable on machines where ordinary constants are expensive | |
1717 | but a CALL with constant address is cheap. | |
1718 | ||
1719 | We define this on the Alpha so that gen_call and gen_call_value | |
1720 | get to see the SYMBOL_REF (for the hint field of the jsr). It will | |
1721 | then copy it into a register, thus actually letting the address be | |
1722 | cse'ed. */ | |
1723 | ||
1724 | #define NO_FUNCTION_CSE | |
1725 | ||
d969caf8 | 1726 | /* Define this to be nonzero if shift instructions ignore all but the low-order |
1a94ca49 | 1727 | few bits. */ |
d969caf8 | 1728 | #define SHIFT_COUNT_TRUNCATED 1 |
1a94ca49 | 1729 | |
71d9b493 | 1730 | /* The EV4 is dual issue; EV5/EV6 are quad issue. */ |
74835ed8 RH |
1731 | #define ISSUE_RATE (alpha_cpu == PROCESSOR_EV4 ? 2 : 4) |
1732 | ||
7d0bfbd0 RH |
1733 | /* Describe the fact that MULTI instructions are multiple instructions |
1734 | and so to assume they don't pair with anything. */ | |
1735 | #define MD_SCHED_VARIABLE_ISSUE(DUMP, SCHED_VERBOSE, INSN, CAN_ISSUE_MORE) \ | |
1736 | if (recog_memoized (INSN) < 0 || get_attr_type (INSN) == TYPE_MULTI) \ | |
1737 | (CAN_ISSUE_MORE) = 0 | |
1738 | ||
1a94ca49 RK |
1739 | /* Compute the cost of computing a constant rtl expression RTX |
1740 | whose rtx-code is CODE. The body of this macro is a portion | |
1741 | of a switch statement. If the code is computed here, | |
1742 | return it with a return statement. Otherwise, break from the switch. | |
1743 | ||
8b7b2e36 RK |
1744 | If this is an 8-bit constant, return zero since it can be used |
1745 | nearly anywhere with no cost. If it is a valid operand for an | |
1746 | ADD or AND, likewise return 0 if we know it will be used in that | |
1747 | context. Otherwise, return 2 since it might be used there later. | |
1748 | All other constants take at least two insns. */ | |
1a94ca49 RK |
1749 | |
1750 | #define CONST_COSTS(RTX,CODE,OUTER_CODE) \ | |
1751 | case CONST_INT: \ | |
06eb8e92 | 1752 | if (INTVAL (RTX) >= 0 && INTVAL (RTX) < 256) \ |
8b7b2e36 | 1753 | return 0; \ |
1a94ca49 | 1754 | case CONST_DOUBLE: \ |
5d02ee66 RH |
1755 | if ((RTX) == CONST0_RTX (GET_MODE (RTX))) \ |
1756 | return 0; \ | |
1757 | else if (((OUTER_CODE) == PLUS && add_operand (RTX, VOIDmode)) \ | |
8b7b2e36 RK |
1758 | || ((OUTER_CODE) == AND && and_operand (RTX, VOIDmode))) \ |
1759 | return 0; \ | |
1760 | else if (add_operand (RTX, VOIDmode) || and_operand (RTX, VOIDmode)) \ | |
1761 | return 2; \ | |
1762 | else \ | |
1763 | return COSTS_N_INSNS (2); \ | |
1a94ca49 RK |
1764 | case CONST: \ |
1765 | case SYMBOL_REF: \ | |
1766 | case LABEL_REF: \ | |
f6f6a13c RK |
1767 | switch (alpha_cpu) \ |
1768 | { \ | |
1769 | case PROCESSOR_EV4: \ | |
1770 | return COSTS_N_INSNS (3); \ | |
1771 | case PROCESSOR_EV5: \ | |
5d02ee66 | 1772 | case PROCESSOR_EV6: \ |
f6f6a13c | 1773 | return COSTS_N_INSNS (2); \ |
5d02ee66 | 1774 | default: abort(); \ |
f6f6a13c | 1775 | } |
1a94ca49 RK |
1776 | |
1777 | /* Provide the costs of a rtl expression. This is in the body of a | |
1778 | switch on CODE. */ | |
1779 | ||
1780 | #define RTX_COSTS(X,CODE,OUTER_CODE) \ | |
3bda6d11 RK |
1781 | case PLUS: case MINUS: \ |
1782 | if (FLOAT_MODE_P (GET_MODE (X))) \ | |
f6f6a13c RK |
1783 | switch (alpha_cpu) \ |
1784 | { \ | |
1785 | case PROCESSOR_EV4: \ | |
1786 | return COSTS_N_INSNS (6); \ | |
1787 | case PROCESSOR_EV5: \ | |
5d02ee66 | 1788 | case PROCESSOR_EV6: \ |
f6f6a13c | 1789 | return COSTS_N_INSNS (4); \ |
5d02ee66 | 1790 | default: abort(); \ |
f6f6a13c | 1791 | } \ |
b49e978e RK |
1792 | else if (GET_CODE (XEXP (X, 0)) == MULT \ |
1793 | && const48_operand (XEXP (XEXP (X, 0), 1), VOIDmode)) \ | |
a5da0afe RK |
1794 | return (2 + rtx_cost (XEXP (XEXP (X, 0), 0), OUTER_CODE) \ |
1795 | + rtx_cost (XEXP (X, 1), OUTER_CODE)); \ | |
1a94ca49 RK |
1796 | break; \ |
1797 | case MULT: \ | |
f6f6a13c RK |
1798 | switch (alpha_cpu) \ |
1799 | { \ | |
1800 | case PROCESSOR_EV4: \ | |
1801 | if (FLOAT_MODE_P (GET_MODE (X))) \ | |
1802 | return COSTS_N_INSNS (6); \ | |
1803 | return COSTS_N_INSNS (23); \ | |
1804 | case PROCESSOR_EV5: \ | |
1805 | if (FLOAT_MODE_P (GET_MODE (X))) \ | |
1806 | return COSTS_N_INSNS (4); \ | |
1807 | else if (GET_MODE (X) == DImode) \ | |
1808 | return COSTS_N_INSNS (12); \ | |
1809 | else \ | |
1810 | return COSTS_N_INSNS (8); \ | |
5d02ee66 RH |
1811 | case PROCESSOR_EV6: \ |
1812 | if (FLOAT_MODE_P (GET_MODE (X))) \ | |
1813 | return COSTS_N_INSNS (4); \ | |
1814 | else \ | |
1815 | return COSTS_N_INSNS (7); \ | |
1816 | default: abort(); \ | |
f6f6a13c | 1817 | } \ |
b49e978e RK |
1818 | case ASHIFT: \ |
1819 | if (GET_CODE (XEXP (X, 1)) == CONST_INT \ | |
1820 | && INTVAL (XEXP (X, 1)) <= 3) \ | |
1821 | break; \ | |
1822 | /* ... fall through ... */ \ | |
5d02ee66 | 1823 | case ASHIFTRT: case LSHIFTRT: \ |
f6f6a13c RK |
1824 | switch (alpha_cpu) \ |
1825 | { \ | |
1826 | case PROCESSOR_EV4: \ | |
1827 | return COSTS_N_INSNS (2); \ | |
1828 | case PROCESSOR_EV5: \ | |
5d02ee66 | 1829 | case PROCESSOR_EV6: \ |
f6f6a13c | 1830 | return COSTS_N_INSNS (1); \ |
5d02ee66 RH |
1831 | default: abort(); \ |
1832 | } \ | |
1833 | case IF_THEN_ELSE: \ | |
1834 | switch (alpha_cpu) \ | |
1835 | { \ | |
1836 | case PROCESSOR_EV4: \ | |
1837 | case PROCESSOR_EV6: \ | |
1838 | return COSTS_N_INSNS (2); \ | |
1839 | case PROCESSOR_EV5: \ | |
1840 | return COSTS_N_INSNS (1); \ | |
1841 | default: abort(); \ | |
f6f6a13c | 1842 | } \ |
3bda6d11 | 1843 | case DIV: case UDIV: case MOD: case UMOD: \ |
f6f6a13c RK |
1844 | switch (alpha_cpu) \ |
1845 | { \ | |
1846 | case PROCESSOR_EV4: \ | |
1847 | if (GET_MODE (X) == SFmode) \ | |
1848 | return COSTS_N_INSNS (34); \ | |
1849 | else if (GET_MODE (X) == DFmode) \ | |
1850 | return COSTS_N_INSNS (63); \ | |
1851 | else \ | |
1852 | return COSTS_N_INSNS (70); \ | |
1853 | case PROCESSOR_EV5: \ | |
1854 | if (GET_MODE (X) == SFmode) \ | |
1855 | return COSTS_N_INSNS (15); \ | |
1856 | else if (GET_MODE (X) == DFmode) \ | |
1857 | return COSTS_N_INSNS (22); \ | |
1858 | else \ | |
5d02ee66 RH |
1859 | return COSTS_N_INSNS (70); /* ??? */ \ |
1860 | case PROCESSOR_EV6: \ | |
1861 | if (GET_MODE (X) == SFmode) \ | |
1862 | return COSTS_N_INSNS (12); \ | |
1863 | else if (GET_MODE (X) == DFmode) \ | |
1864 | return COSTS_N_INSNS (15); \ | |
1865 | else \ | |
1866 | return COSTS_N_INSNS (70); /* ??? */ \ | |
1867 | default: abort(); \ | |
f6f6a13c | 1868 | } \ |
1a94ca49 | 1869 | case MEM: \ |
f6f6a13c RK |
1870 | switch (alpha_cpu) \ |
1871 | { \ | |
1872 | case PROCESSOR_EV4: \ | |
5d02ee66 | 1873 | case PROCESSOR_EV6: \ |
f6f6a13c RK |
1874 | return COSTS_N_INSNS (3); \ |
1875 | case PROCESSOR_EV5: \ | |
1876 | return COSTS_N_INSNS (2); \ | |
5d02ee66 | 1877 | default: abort(); \ |
f6f6a13c RK |
1878 | } \ |
1879 | case NEG: case ABS: \ | |
1880 | if (! FLOAT_MODE_P (GET_MODE (X))) \ | |
1881 | break; \ | |
1882 | /* ... fall through ... */ \ | |
3bda6d11 RK |
1883 | case FLOAT: case UNSIGNED_FLOAT: case FIX: case UNSIGNED_FIX: \ |
1884 | case FLOAT_EXTEND: case FLOAT_TRUNCATE: \ | |
f6f6a13c RK |
1885 | switch (alpha_cpu) \ |
1886 | { \ | |
1887 | case PROCESSOR_EV4: \ | |
1888 | return COSTS_N_INSNS (6); \ | |
1889 | case PROCESSOR_EV5: \ | |
5d02ee66 | 1890 | case PROCESSOR_EV6: \ |
f6f6a13c | 1891 | return COSTS_N_INSNS (4); \ |
5d02ee66 | 1892 | default: abort(); \ |
f6f6a13c | 1893 | } |
1a94ca49 RK |
1894 | \f |
1895 | /* Control the assembler format that we output. */ | |
1896 | ||
1a94ca49 RK |
1897 | /* Output to assembler file text saying following lines |
1898 | may contain character constants, extra white space, comments, etc. */ | |
1899 | ||
1900 | #define ASM_APP_ON "" | |
1901 | ||
1902 | /* Output to assembler file text saying following lines | |
1903 | no longer contain unusual constructs. */ | |
1904 | ||
1905 | #define ASM_APP_OFF "" | |
1906 | ||
93de6f51 | 1907 | #define TEXT_SECTION_ASM_OP "\t.text" |
1a94ca49 RK |
1908 | |
1909 | /* Output before read-only data. */ | |
1910 | ||
93de6f51 | 1911 | #define READONLY_DATA_SECTION_ASM_OP "\t.rdata" |
1a94ca49 RK |
1912 | |
1913 | /* Output before writable data. */ | |
1914 | ||
93de6f51 | 1915 | #define DATA_SECTION_ASM_OP "\t.data" |
1a94ca49 RK |
1916 | |
1917 | /* Define an extra section for read-only data, a routine to enter it, and | |
c0388f29 RK |
1918 | indicate that it is for read-only data. |
1919 | ||
abc95ed3 | 1920 | The first time we enter the readonly data section for a file, we write |
c0388f29 RK |
1921 | eight bytes of zero. This works around a bug in DEC's assembler in |
1922 | some versions of OSF/1 V3.x. */ | |
1a94ca49 RK |
1923 | |
1924 | #define EXTRA_SECTIONS readonly_data | |
1925 | ||
1926 | #define EXTRA_SECTION_FUNCTIONS \ | |
1927 | void \ | |
1928 | literal_section () \ | |
1929 | { \ | |
1930 | if (in_section != readonly_data) \ | |
1931 | { \ | |
c0388f29 RK |
1932 | static int firsttime = 1; \ |
1933 | \ | |
1a94ca49 | 1934 | fprintf (asm_out_file, "%s\n", READONLY_DATA_SECTION_ASM_OP); \ |
c0388f29 RK |
1935 | if (firsttime) \ |
1936 | { \ | |
1937 | firsttime = 0; \ | |
1938 | ASM_OUTPUT_DOUBLE_INT (asm_out_file, const0_rtx); \ | |
1939 | } \ | |
1940 | \ | |
1a94ca49 RK |
1941 | in_section = readonly_data; \ |
1942 | } \ | |
1943 | } \ | |
1944 | ||
1945 | #define READONLY_DATA_SECTION literal_section | |
1946 | ||
ac030a7b RK |
1947 | /* If we are referencing a function that is static, make the SYMBOL_REF |
1948 | special. We use this to see indicate we can branch to this function | |
1949 | without setting PV or restoring GP. */ | |
130d2d72 RK |
1950 | |
1951 | #define ENCODE_SECTION_INFO(DECL) \ | |
ac030a7b | 1952 | if (TREE_CODE (DECL) == FUNCTION_DECL && ! TREE_PUBLIC (DECL)) \ |
130d2d72 RK |
1953 | SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; |
1954 | ||
1a94ca49 RK |
1955 | /* How to refer to registers in assembler output. |
1956 | This sequence is indexed by compiler's hard-register-number (see above). */ | |
1957 | ||
1958 | #define REGISTER_NAMES \ | |
1959 | {"$0", "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", \ | |
1960 | "$9", "$10", "$11", "$12", "$13", "$14", "$15", \ | |
1961 | "$16", "$17", "$18", "$19", "$20", "$21", "$22", "$23", \ | |
130d2d72 | 1962 | "$24", "$25", "$26", "$27", "$28", "$29", "$30", "AP", \ |
1a94ca49 RK |
1963 | "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "$f6", "$f7", "$f8", \ |
1964 | "$f9", "$f10", "$f11", "$f12", "$f13", "$f14", "$f15", \ | |
1965 | "$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",\ | |
52a69200 | 1966 | "$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "FP"} |
1a94ca49 RK |
1967 | |
1968 | /* How to renumber registers for dbx and gdb. */ | |
1969 | ||
1970 | #define DBX_REGISTER_NUMBER(REGNO) (REGNO) | |
1971 | ||
1972 | /* This is how to output the definition of a user-level label named NAME, | |
1973 | such as the label on a static function or variable NAME. */ | |
1974 | ||
1975 | #define ASM_OUTPUT_LABEL(FILE,NAME) \ | |
1976 | do { assemble_name (FILE, NAME); fputs (":\n", FILE); } while (0) | |
1977 | ||
1978 | /* This is how to output a command to make the user-level label named NAME | |
1979 | defined for reference from other files. */ | |
1980 | ||
1981 | #define ASM_GLOBALIZE_LABEL(FILE,NAME) \ | |
1982 | do { fputs ("\t.globl ", FILE); assemble_name (FILE, NAME); fputs ("\n", FILE);} while (0) | |
1983 | ||
4e0c8ad2 | 1984 | /* The prefix to add to user-visible assembler symbols. */ |
1a94ca49 | 1985 | |
4e0c8ad2 | 1986 | #define USER_LABEL_PREFIX "" |
1a94ca49 RK |
1987 | |
1988 | /* This is how to output an internal numbered label where | |
1989 | PREFIX is the class of label and NUM is the number within the class. */ | |
1990 | ||
1991 | #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ | |
531ea24e | 1992 | fprintf (FILE, "$%s%d:\n", PREFIX, NUM) |
1a94ca49 RK |
1993 | |
1994 | /* This is how to output a label for a jump table. Arguments are the same as | |
1995 | for ASM_OUTPUT_INTERNAL_LABEL, except the insn for the jump table is | |
1996 | passed. */ | |
1997 | ||
1998 | #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \ | |
1999 | { ASM_OUTPUT_ALIGN (FILE, 2); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); } | |
2000 | ||
2001 | /* This is how to store into the string LABEL | |
2002 | the symbol_ref name of an internal numbered label where | |
2003 | PREFIX is the class of label and NUM is the number within the class. | |
2004 | This is suitable for output with `assemble_name'. */ | |
2005 | ||
2006 | #define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \ | |
d1e6b55b | 2007 | sprintf ((LABEL), "*$%s%ld", (PREFIX), (long)(NUM)) |
1a94ca49 | 2008 | |
e247ca2a RK |
2009 | /* Check a floating-point value for validity for a particular machine mode. */ |
2010 | ||
2011 | #define CHECK_FLOAT_VALUE(MODE, D, OVERFLOW) \ | |
2012 | ((OVERFLOW) = check_float_value (MODE, &D, OVERFLOW)) | |
2013 | ||
5495cc55 RH |
2014 | /* This is how to output an assembler line defining a `long double' |
2015 | constant. */ | |
2016 | ||
2017 | #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \ | |
2018 | do { \ | |
2019 | long t[4]; \ | |
2020 | REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), t); \ | |
2021 | fprintf (FILE, "\t.quad 0x%lx%08lx,0x%lx%08lx\n", \ | |
2022 | t[1] & 0xffffffff, t[0] & 0xffffffff, \ | |
2023 | t[3] & 0xffffffff, t[2] & 0xffffffff); \ | |
2024 | } while (0) | |
2025 | ||
1a94ca49 RK |
2026 | /* This is how to output an assembler line defining a `double' constant. */ |
2027 | ||
e99300f1 | 2028 | #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \ |
5495cc55 RH |
2029 | do { \ |
2030 | long t[2]; \ | |
2031 | REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), t); \ | |
2032 | fprintf (FILE, "\t.quad 0x%lx%08lx\n", \ | |
2033 | t[1] & 0xffffffff, t[0] & 0xffffffff); \ | |
2034 | } while (0) | |
1a94ca49 RK |
2035 | |
2036 | /* This is how to output an assembler line defining a `float' constant. */ | |
2037 | ||
e247ca2a RK |
2038 | #define ASM_OUTPUT_FLOAT(FILE,VALUE) \ |
2039 | do { \ | |
2040 | long t; \ | |
2041 | REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \ | |
2042 | fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \ | |
5495cc55 | 2043 | } while (0) |
2700ac93 | 2044 | |
1a94ca49 RK |
2045 | /* This is how to output an assembler line defining an `int' constant. */ |
2046 | ||
2047 | #define ASM_OUTPUT_INT(FILE,VALUE) \ | |
0076aa6b RK |
2048 | ( fprintf (FILE, "\t.long "), \ |
2049 | output_addr_const (FILE, (VALUE)), \ | |
2050 | fprintf (FILE, "\n")) | |
1a94ca49 RK |
2051 | |
2052 | /* This is how to output an assembler line defining a `long' constant. */ | |
2053 | ||
2054 | #define ASM_OUTPUT_DOUBLE_INT(FILE,VALUE) \ | |
2055 | ( fprintf (FILE, "\t.quad "), \ | |
2056 | output_addr_const (FILE, (VALUE)), \ | |
2057 | fprintf (FILE, "\n")) | |
2058 | ||
2059 | /* Likewise for `char' and `short' constants. */ | |
2060 | ||
2061 | #define ASM_OUTPUT_SHORT(FILE,VALUE) \ | |
690ef02f | 2062 | fprintf (FILE, "\t.word %d\n", \ |
3c303f52 | 2063 | (int)(GET_CODE (VALUE) == CONST_INT \ |
45c45e79 | 2064 | ? INTVAL (VALUE) & 0xffff : (abort (), 0))) |
1a94ca49 RK |
2065 | |
2066 | #define ASM_OUTPUT_CHAR(FILE,VALUE) \ | |
45c45e79 | 2067 | fprintf (FILE, "\t.byte %d\n", \ |
3c303f52 | 2068 | (int)(GET_CODE (VALUE) == CONST_INT \ |
45c45e79 | 2069 | ? INTVAL (VALUE) & 0xff : (abort (), 0))) |
1a94ca49 RK |
2070 | |
2071 | /* We use the default ASCII-output routine, except that we don't write more | |
2072 | than 50 characters since the assembler doesn't support very long lines. */ | |
2073 | ||
2074 | #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \ | |
2075 | do { \ | |
2076 | FILE *_hide_asm_out_file = (MYFILE); \ | |
e03c5670 | 2077 | const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \ |
1a94ca49 RK |
2078 | int _hide_thissize = (MYLENGTH); \ |
2079 | int _size_so_far = 0; \ | |
2080 | { \ | |
2081 | FILE *asm_out_file = _hide_asm_out_file; \ | |
e03c5670 | 2082 | const unsigned char *p = _hide_p; \ |
1a94ca49 RK |
2083 | int thissize = _hide_thissize; \ |
2084 | int i; \ | |
2085 | fprintf (asm_out_file, "\t.ascii \""); \ | |
2086 | \ | |
2087 | for (i = 0; i < thissize; i++) \ | |
2088 | { \ | |
2089 | register int c = p[i]; \ | |
2090 | \ | |
2091 | if (_size_so_far ++ > 50 && i < thissize - 4) \ | |
2092 | _size_so_far = 0, fprintf (asm_out_file, "\"\n\t.ascii \""); \ | |
2093 | \ | |
2094 | if (c == '\"' || c == '\\') \ | |
2095 | putc ('\\', asm_out_file); \ | |
2096 | if (c >= ' ' && c < 0177) \ | |
2097 | putc (c, asm_out_file); \ | |
2098 | else \ | |
2099 | { \ | |
2100 | fprintf (asm_out_file, "\\%o", c); \ | |
2101 | /* After an octal-escape, if a digit follows, \ | |
2102 | terminate one string constant and start another. \ | |
2103 | The Vax assembler fails to stop reading the escape \ | |
2104 | after three digits, so this is the only way we \ | |
2105 | can get it to parse the data properly. */ \ | |
2106 | if (i < thissize - 1 \ | |
2107 | && p[i + 1] >= '0' && p[i + 1] <= '9') \ | |
b2d5e311 | 2108 | _size_so_far = 0, fprintf (asm_out_file, "\"\n\t.ascii \""); \ |
1a94ca49 RK |
2109 | } \ |
2110 | } \ | |
2111 | fprintf (asm_out_file, "\"\n"); \ | |
2112 | } \ | |
2113 | } \ | |
2114 | while (0) | |
52a69200 | 2115 | |
6690d24c | 2116 | /* To get unaligned data, we have to turn off auto alignment. */ |
93de6f51 HPN |
2117 | #define UNALIGNED_SHORT_ASM_OP "\t.align 0\n\t.word\t" |
2118 | #define UNALIGNED_INT_ASM_OP "\t.align 0\n\t.long\t" | |
2119 | #define UNALIGNED_DOUBLE_INT_ASM_OP "\t.align 0\n\t.quad\t" | |
6690d24c | 2120 | |
1a94ca49 RK |
2121 | /* This is how to output an insn to push a register on the stack. |
2122 | It need not be very fast code. */ | |
2123 | ||
2124 | #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ | |
2125 | fprintf (FILE, "\tsubq $30,8,$30\n\tst%s $%s%d,0($30)\n", \ | |
2126 | (REGNO) > 32 ? "t" : "q", (REGNO) > 32 ? "f" : "", \ | |
2127 | (REGNO) & 31); | |
2128 | ||
2129 | /* This is how to output an insn to pop a register from the stack. | |
2130 | It need not be very fast code. */ | |
2131 | ||
2132 | #define ASM_OUTPUT_REG_POP(FILE,REGNO) \ | |
2133 | fprintf (FILE, "\tld%s $%s%d,0($30)\n\taddq $30,8,$30\n", \ | |
2134 | (REGNO) > 32 ? "t" : "q", (REGNO) > 32 ? "f" : "", \ | |
2135 | (REGNO) & 31); | |
2136 | ||
2137 | /* This is how to output an assembler line for a numeric constant byte. */ | |
2138 | ||
2139 | #define ASM_OUTPUT_BYTE(FILE,VALUE) \ | |
3c303f52 | 2140 | fprintf (FILE, "\t.byte 0x%x\n", (int) ((VALUE) & 0xff)) |
1a94ca49 | 2141 | |
260ced47 RK |
2142 | /* This is how to output an element of a case-vector that is absolute. |
2143 | (Alpha does not use such vectors, but we must define this macro anyway.) */ | |
1a94ca49 | 2144 | |
260ced47 | 2145 | #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) abort () |
1a94ca49 | 2146 | |
260ced47 | 2147 | /* This is how to output an element of a case-vector that is relative. */ |
1a94ca49 | 2148 | |
33f7f353 | 2149 | #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ |
8dfe3c62 RH |
2150 | fprintf (FILE, "\t.%s $L%d\n", TARGET_WINDOWS_NT ? "long" : "gprel32", \ |
2151 | (VALUE)) | |
1a94ca49 RK |
2152 | |
2153 | /* This is how to output an assembler line | |
2154 | that says to advance the location counter | |
2155 | to a multiple of 2**LOG bytes. */ | |
2156 | ||
2157 | #define ASM_OUTPUT_ALIGN(FILE,LOG) \ | |
2158 | if ((LOG) != 0) \ | |
2159 | fprintf (FILE, "\t.align %d\n", LOG); | |
2160 | ||
2161 | /* This is how to advance the location counter by SIZE bytes. */ | |
2162 | ||
2163 | #define ASM_OUTPUT_SKIP(FILE,SIZE) \ | |
2164 | fprintf (FILE, "\t.space %d\n", (SIZE)) | |
2165 | ||
2166 | /* This says how to output an assembler line | |
2167 | to define a global common symbol. */ | |
2168 | ||
2169 | #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ | |
2170 | ( fputs ("\t.comm ", (FILE)), \ | |
2171 | assemble_name ((FILE), (NAME)), \ | |
2172 | fprintf ((FILE), ",%d\n", (SIZE))) | |
2173 | ||
2174 | /* This says how to output an assembler line | |
2175 | to define a local common symbol. */ | |
2176 | ||
2177 | #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE,ROUNDED) \ | |
2178 | ( fputs ("\t.lcomm ", (FILE)), \ | |
2179 | assemble_name ((FILE), (NAME)), \ | |
2180 | fprintf ((FILE), ",%d\n", (SIZE))) | |
2181 | ||
2182 | /* Store in OUTPUT a string (made with alloca) containing | |
2183 | an assembler-name for a local static variable named NAME. | |
2184 | LABELNO is an integer which is different for each call. */ | |
2185 | ||
2186 | #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \ | |
2187 | ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 10), \ | |
2188 | sprintf ((OUTPUT), "%s.%d", (NAME), (LABELNO))) | |
2189 | ||
2190 | /* Define the parentheses used to group arithmetic operations | |
2191 | in assembler code. */ | |
2192 | ||
2193 | #define ASM_OPEN_PAREN "(" | |
2194 | #define ASM_CLOSE_PAREN ")" | |
2195 | ||
60593797 RH |
2196 | /* Output code to add DELTA to the first argument, and then jump to FUNCTION. |
2197 | Used for C++ multiple inheritance. */ | |
f2720858 RH |
2198 | /* ??? This is only used with the v2 ABI, and alpha.c makes assumptions |
2199 | about current_function_is_thunk that are not valid with the v3 ABI. */ | |
2200 | #if 0 | |
60593797 RH |
2201 | #define ASM_OUTPUT_MI_THUNK(FILE, THUNK_FNDECL, DELTA, FUNCTION) \ |
2202 | do { \ | |
e03c5670 | 2203 | const char *fn_name = XSTR (XEXP (DECL_RTL (FUNCTION), 0), 0); \ |
54473ca7 | 2204 | int reg; \ |
60593797 | 2205 | \ |
4c646291 JJ |
2206 | if (! TARGET_OPEN_VMS && ! TARGET_WINDOWS_NT) \ |
2207 | fprintf (FILE, "\tldgp $29,0($27)\n"); \ | |
2208 | \ | |
acd92049 RH |
2209 | /* Mark end of prologue. */ \ |
2210 | output_end_prologue (FILE); \ | |
60593797 RH |
2211 | \ |
2212 | /* Rely on the assembler to macro expand a large delta. */ \ | |
2eecbd3f | 2213 | fprintf (FILE, "\t.set at\n"); \ |
54473ca7 L |
2214 | reg = aggregate_value_p (TREE_TYPE (TREE_TYPE (FUNCTION))) ? 17 : 16; \ |
2215 | fprintf (FILE, "\tlda $%d,%ld($%d)\n", reg, (long)(DELTA), reg); \ | |
60593797 | 2216 | \ |
b1afd7f4 KG |
2217 | if (current_file_function_operand (XEXP (DECL_RTL (FUNCTION), 0), \ |
2218 | VOIDmode)) \ | |
60593797 RH |
2219 | { \ |
2220 | fprintf (FILE, "\tbr $31,$"); \ | |
2221 | assemble_name (FILE, fn_name); \ | |
2222 | fprintf (FILE, "..ng\n"); \ | |
2223 | } \ | |
2224 | else \ | |
2225 | { \ | |
acd92049 | 2226 | fprintf (FILE, "\tjmp $31,"); \ |
60593797 RH |
2227 | assemble_name (FILE, fn_name); \ |
2228 | fputc ('\n', FILE); \ | |
2229 | } \ | |
2eecbd3f | 2230 | fprintf (FILE, "\t.set noat\n"); \ |
60593797 | 2231 | } while (0) |
f2720858 | 2232 | #endif |
60593797 | 2233 | \f |
9ec36da5 | 2234 | |
1a94ca49 RK |
2235 | /* Print operand X (an rtx) in assembler syntax to file FILE. |
2236 | CODE is a letter or dot (`z' in `%z0') or 0 if no letter was specified. | |
2237 | For `%' followed by punctuation, CODE is the punctuation and X is null. */ | |
2238 | ||
2239 | #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) | |
2240 | ||
2241 | /* Determine which codes are valid without a following integer. These must | |
941cc05a RK |
2242 | not be alphabetic. |
2243 | ||
2244 | ~ Generates the name of the current function. | |
2bf6230d RK |
2245 | |
2246 | & Generates fp-rounding mode suffix: nothing for normal, 'c' for | |
2247 | chopped, 'm' for minus-infinity, and 'd' for dynamic rounding | |
2248 | mode. alpha_fprm controls which suffix is generated. | |
2249 | ||
2250 | ' Generates trap-mode suffix for instructions that accept the | |
2251 | su suffix only (cmpt et al). | |
2252 | ||
e83015a9 RH |
2253 | ` Generates trap-mode suffix for instructions that accept the |
2254 | v and sv suffix. The only instruction that needs this is cvtql. | |
2255 | ||
0022a940 DMT |
2256 | ( Generates trap-mode suffix for instructions that accept the |
2257 | v, sv, and svi suffix. The only instruction that needs this | |
2258 | is cvttq. | |
2259 | ||
2bf6230d RK |
2260 | ) Generates trap-mode suffix for instructions that accept the |
2261 | u, su, and sui suffix. This is the bulk of the IEEE floating | |
2262 | point instructions (addt et al). | |
2263 | ||
2264 | + Generates trap-mode suffix for instructions that accept the | |
2265 | sui suffix (cvtqt and cvtqs). | |
e5958492 RK |
2266 | |
2267 | , Generates single precision suffix for floating point | |
2268 | instructions (s for IEEE, f for VAX) | |
2269 | ||
2270 | - Generates double precision suffix for floating point | |
2271 | instructions (t for IEEE, g for VAX) | |
2bf6230d | 2272 | */ |
1a94ca49 | 2273 | |
2bf6230d | 2274 | #define PRINT_OPERAND_PUNCT_VALID_P(CODE) \ |
e83015a9 | 2275 | ((CODE) == '&' || (CODE) == '`' || (CODE) == '\'' || (CODE) == '(' \ |
941cc05a RK |
2276 | || (CODE) == ')' || (CODE) == '+' || (CODE) == ',' || (CODE) == '-' \ |
2277 | || (CODE) == '~') | |
1a94ca49 RK |
2278 | \f |
2279 | /* Print a memory address as an operand to reference that memory location. */ | |
2280 | ||
714b019c RH |
2281 | #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \ |
2282 | print_operand_address((FILE), (ADDR)) | |
2283 | ||
1a94ca49 RK |
2284 | /* Define the codes that are matched by predicates in alpha.c. */ |
2285 | ||
e3208d53 RH |
2286 | #define PREDICATE_CODES \ |
2287 | {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \ | |
eb8da868 RH |
2288 | {"reg_or_6bit_operand", {SUBREG, REG, CONST_INT}}, \ |
2289 | {"reg_or_8bit_operand", {SUBREG, REG, CONST_INT}}, \ | |
2290 | {"cint8_operand", {CONST_INT}}, \ | |
2291 | {"reg_or_cint_operand", {SUBREG, REG, CONST_INT}}, \ | |
2292 | {"add_operand", {SUBREG, REG, CONST_INT}}, \ | |
2293 | {"sext_add_operand", {SUBREG, REG, CONST_INT}}, \ | |
e3208d53 | 2294 | {"const48_operand", {CONST_INT}}, \ |
eb8da868 RH |
2295 | {"and_operand", {SUBREG, REG, CONST_INT}}, \ |
2296 | {"or_operand", {SUBREG, REG, CONST_INT}}, \ | |
e3208d53 RH |
2297 | {"mode_mask_operand", {CONST_INT}}, \ |
2298 | {"mul8_operand", {CONST_INT}}, \ | |
2299 | {"mode_width_operand", {CONST_INT}}, \ | |
2300 | {"reg_or_fp0_operand", {SUBREG, REG, CONST_DOUBLE}}, \ | |
2301 | {"alpha_comparison_operator", {EQ, LE, LT, LEU, LTU}}, \ | |
8f4773ea | 2302 | {"alpha_zero_comparison_operator", {EQ, NE, LE, LT, LEU, LTU}}, \ |
e3208d53 RH |
2303 | {"alpha_swapped_comparison_operator", {EQ, GE, GT, GEU, GTU}}, \ |
2304 | {"signed_comparison_operator", {EQ, NE, LE, LT, GE, GT}}, \ | |
1eb8759b | 2305 | {"alpha_fp_comparison_operator", {EQ, LE, LT, UNORDERED}}, \ |
e3208d53 RH |
2306 | {"divmod_operator", {DIV, MOD, UDIV, UMOD}}, \ |
2307 | {"fp0_operand", {CONST_DOUBLE}}, \ | |
2308 | {"current_file_function_operand", {SYMBOL_REF}}, \ | |
2309 | {"call_operand", {REG, SYMBOL_REF}}, \ | |
2310 | {"input_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \ | |
eb8da868 | 2311 | SYMBOL_REF, CONST, LABEL_REF}}, \ |
e3208d53 | 2312 | {"some_operand", {SUBREG, REG, MEM, CONST_INT, CONST_DOUBLE, \ |
eb8da868 | 2313 | SYMBOL_REF, CONST, LABEL_REF}}, \ |
f711a22b | 2314 | {"some_ni_operand", {SUBREG, REG, MEM}}, \ |
e3208d53 RH |
2315 | {"aligned_memory_operand", {MEM}}, \ |
2316 | {"unaligned_memory_operand", {MEM}}, \ | |
2317 | {"reg_or_unaligned_mem_operand", {SUBREG, REG, MEM}}, \ | |
2318 | {"any_memory_operand", {MEM}}, \ | |
40b80dad | 2319 | {"hard_fp_register_operand", {SUBREG, REG}}, \ |
d2c6a1b6 | 2320 | {"hard_int_register_operand", {SUBREG, REG}}, \ |
67070f5c | 2321 | {"reg_not_elim_operand", {SUBREG, REG}}, \ |
3611aef0 RH |
2322 | {"reg_no_subreg_operand", {REG}}, \ |
2323 | {"addition_operation", {PLUS}}, | |
03f8c4cc | 2324 | \f |
63966b3b RH |
2325 | /* Define the `__builtin_va_list' type for the ABI. */ |
2326 | #define BUILD_VA_LIST_TYPE(VALIST) \ | |
2327 | (VALIST) = alpha_build_va_list () | |
2328 | ||
2329 | /* Implement `va_start' for varargs and stdarg. */ | |
2330 | #define EXPAND_BUILTIN_VA_START(stdarg, valist, nextarg) \ | |
2331 | alpha_va_start (stdarg, valist, nextarg) | |
2332 | ||
2333 | /* Implement `va_arg'. */ | |
2334 | #define EXPAND_BUILTIN_VA_ARG(valist, type) \ | |
2335 | alpha_va_arg (valist, type) | |
2336 | \f | |
34fa88ab RK |
2337 | /* Tell collect that the object format is ECOFF. */ |
2338 | #define OBJECT_FORMAT_COFF | |
2339 | #define EXTENDED_COFF | |
2340 | ||
2341 | /* If we use NM, pass -g to it so it only lists globals. */ | |
2342 | #define NM_FLAGS "-pg" | |
2343 | ||
03f8c4cc RK |
2344 | /* Definitions for debugging. */ |
2345 | ||
2346 | #define SDB_DEBUGGING_INFO /* generate info for mips-tfile */ | |
2347 | #define DBX_DEBUGGING_INFO /* generate embedded stabs */ | |
2348 | #define MIPS_DEBUGGING_INFO /* MIPS specific debugging info */ | |
2349 | ||
2350 | #ifndef PREFERRED_DEBUGGING_TYPE /* assume SDB_DEBUGGING_INFO */ | |
fe0986b4 | 2351 | #define PREFERRED_DEBUGGING_TYPE SDB_DEBUG |
03f8c4cc RK |
2352 | #endif |
2353 | ||
2354 | ||
2355 | /* Correct the offset of automatic variables and arguments. Note that | |
2356 | the Alpha debug format wants all automatic variables and arguments | |
2357 | to be in terms of two different offsets from the virtual frame pointer, | |
2358 | which is the stack pointer before any adjustment in the function. | |
2359 | The offset for the argument pointer is fixed for the native compiler, | |
2360 | it is either zero (for the no arguments case) or large enough to hold | |
2361 | all argument registers. | |
2362 | The offset for the auto pointer is the fourth argument to the .frame | |
2363 | directive (local_offset). | |
2364 | To stay compatible with the native tools we use the same offsets | |
2365 | from the virtual frame pointer and adjust the debugger arg/auto offsets | |
2366 | accordingly. These debugger offsets are set up in output_prolog. */ | |
2367 | ||
9a0b18f2 RK |
2368 | extern long alpha_arg_offset; |
2369 | extern long alpha_auto_offset; | |
03f8c4cc RK |
2370 | #define DEBUGGER_AUTO_OFFSET(X) \ |
2371 | ((GET_CODE (X) == PLUS ? INTVAL (XEXP (X, 1)) : 0) + alpha_auto_offset) | |
2372 | #define DEBUGGER_ARG_OFFSET(OFFSET, X) (OFFSET + alpha_arg_offset) | |
2373 | ||
2374 | ||
2375 | #define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \ | |
2376 | alpha_output_lineno (STREAM, LINE) | |
03f8c4cc RK |
2377 | |
2378 | #define ASM_OUTPUT_SOURCE_FILENAME(STREAM, NAME) \ | |
2379 | alpha_output_filename (STREAM, NAME) | |
03f8c4cc | 2380 | |
4330b0e7 JW |
2381 | /* mips-tfile.c limits us to strings of one page. We must underestimate this |
2382 | number, because the real length runs past this up to the next | |
2383 | continuation point. This is really a dbxout.c bug. */ | |
2384 | #define DBX_CONTIN_LENGTH 3000 | |
03f8c4cc RK |
2385 | |
2386 | /* By default, turn on GDB extensions. */ | |
2387 | #define DEFAULT_GDB_EXTENSIONS 1 | |
2388 | ||
7aadc7c2 RK |
2389 | /* Stabs-in-ECOFF can't handle dbxout_function_end(). */ |
2390 | #define NO_DBX_FUNCTION_END 1 | |
2391 | ||
03f8c4cc RK |
2392 | /* If we are smuggling stabs through the ALPHA ECOFF object |
2393 | format, put a comment in front of the .stab<x> operation so | |
2394 | that the ALPHA assembler does not choke. The mips-tfile program | |
2395 | will correctly put the stab into the object file. */ | |
2396 | ||
93de6f51 HPN |
2397 | #define ASM_STABS_OP ((TARGET_GAS) ? "\t.stabs\t" : " #.stabs\t") |
2398 | #define ASM_STABN_OP ((TARGET_GAS) ? "\t.stabn\t" : " #.stabn\t") | |
2399 | #define ASM_STABD_OP ((TARGET_GAS) ? "\t.stabd\t" : " #.stabd\t") | |
03f8c4cc RK |
2400 | |
2401 | /* Forward references to tags are allowed. */ | |
2402 | #define SDB_ALLOW_FORWARD_REFERENCES | |
2403 | ||
2404 | /* Unknown tags are also allowed. */ | |
2405 | #define SDB_ALLOW_UNKNOWN_REFERENCES | |
2406 | ||
2407 | #define PUT_SDB_DEF(a) \ | |
2408 | do { \ | |
2409 | fprintf (asm_out_file, "\t%s.def\t", \ | |
2410 | (TARGET_GAS) ? "" : "#"); \ | |
2411 | ASM_OUTPUT_LABELREF (asm_out_file, a); \ | |
2412 | fputc (';', asm_out_file); \ | |
2413 | } while (0) | |
2414 | ||
2415 | #define PUT_SDB_PLAIN_DEF(a) \ | |
2416 | do { \ | |
2417 | fprintf (asm_out_file, "\t%s.def\t.%s;", \ | |
2418 | (TARGET_GAS) ? "" : "#", (a)); \ | |
2419 | } while (0) | |
2420 | ||
2421 | #define PUT_SDB_TYPE(a) \ | |
2422 | do { \ | |
2423 | fprintf (asm_out_file, "\t.type\t0x%x;", (a)); \ | |
2424 | } while (0) | |
2425 | ||
2426 | /* For block start and end, we create labels, so that | |
2427 | later we can figure out where the correct offset is. | |
2428 | The normal .ent/.end serve well enough for functions, | |
2429 | so those are just commented out. */ | |
2430 | ||
2431 | extern int sdb_label_count; /* block start/end next label # */ | |
2432 | ||
2433 | #define PUT_SDB_BLOCK_START(LINE) \ | |
2434 | do { \ | |
2435 | fprintf (asm_out_file, \ | |
2436 | "$Lb%d:\n\t%s.begin\t$Lb%d\t%d\n", \ | |
2437 | sdb_label_count, \ | |
2438 | (TARGET_GAS) ? "" : "#", \ | |
2439 | sdb_label_count, \ | |
2440 | (LINE)); \ | |
2441 | sdb_label_count++; \ | |
2442 | } while (0) | |
2443 | ||
2444 | #define PUT_SDB_BLOCK_END(LINE) \ | |
2445 | do { \ | |
2446 | fprintf (asm_out_file, \ | |
2447 | "$Le%d:\n\t%s.bend\t$Le%d\t%d\n", \ | |
2448 | sdb_label_count, \ | |
2449 | (TARGET_GAS) ? "" : "#", \ | |
2450 | sdb_label_count, \ | |
2451 | (LINE)); \ | |
2452 | sdb_label_count++; \ | |
2453 | } while (0) | |
2454 | ||
2455 | #define PUT_SDB_FUNCTION_START(LINE) | |
2456 | ||
2457 | #define PUT_SDB_FUNCTION_END(LINE) | |
2458 | ||
3c303f52 | 2459 | #define PUT_SDB_EPILOGUE_END(NAME) ((void)(NAME)) |
03f8c4cc | 2460 | |
03f8c4cc RK |
2461 | /* Macros for mips-tfile.c to encapsulate stabs in ECOFF, and for |
2462 | mips-tdump.c to print them out. | |
2463 | ||
2464 | These must match the corresponding definitions in gdb/mipsread.c. | |
2465 | Unfortunately, gcc and gdb do not currently share any directories. */ | |
2466 | ||
2467 | #define CODE_MASK 0x8F300 | |
2468 | #define MIPS_IS_STAB(sym) (((sym)->index & 0xFFF00) == CODE_MASK) | |
2469 | #define MIPS_MARK_STAB(code) ((code)+CODE_MASK) | |
2470 | #define MIPS_UNMARK_STAB(code) ((code)-CODE_MASK) | |
2471 | ||
2472 | /* Override some mips-tfile definitions. */ | |
2473 | ||
2474 | #define SHASH_SIZE 511 | |
2475 | #define THASH_SIZE 55 | |
1e6c6f11 RK |
2476 | |
2477 | /* Align ecoff symbol tables to avoid OSF1/1.3 nm complaints. */ | |
2478 | ||
2479 | #define ALIGN_SYMTABLE_OFFSET(OFFSET) (((OFFSET) + 7) & ~7) | |
2f55b70b | 2480 | |
b0435cf4 RH |
2481 | /* The system headers under Alpha systems are generally C++-aware. */ |
2482 | #define NO_IMPLICIT_EXTERN_C | |
b517dcd2 RH |
2483 | |
2484 | /* Generate calls to memcpy, etc., not bcopy, etc. */ | |
2485 | #define TARGET_MEM_FUNCTIONS 1 |