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