1 /* Output variables, constants and external declarations, for GNU compiler.
2 Copyright (C) 1996, 1997 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
23 /* This enables certain macros in alpha.h, which will make an indirect
24 reference to an external symbol an invalid address. This needs to be
25 defined before we include alpha.h, since it determines which macros
26 are used for GO_IF_*. */
28 #define NO_EXTERNAL_INDIRECT_ADDRESS
30 #include "alpha/alpha.h"
32 /* Predefine this in CPP because VMS limits the size of command options
33 and GNU CPP is not used on VMS except with GNU C. */
35 #define CPP_PREDEFINES \
36 "-Dalpha -D__ALPHA -Dvms -DVMS -D__alpha__ -D__alpha -D__vms__ -D__VMS__\
37 -D__VMS_VER=70000022 \
38 -D__GNUC__=2 -D__GNUC_MINOR__=7 -Asystem(vms) -Acpu(alpha) -Amachine(alpha)"
42 %{mfloat-ieee:-D__IEEE_FLOAT} \
43 %{mfloat-vax:-D__G_FLOAT} \
44 %{!mfloat-vax:-D__IEEE_FLOAT} \
45 %{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
46 %{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
47 %{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
48 %{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
49 %{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
50 %{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C}"
52 /* We allow $'s in identifiers unless -ansi is used .. */
54 #define DOLLARS_IN_IDENTIFIERS 2
56 /* These match the definitions used in DECCRTL, the VMS C run-time library
58 #define SIZE_TYPE "unsigned int"
59 #define PTRDIFF_TYPE "int"
62 /* Use memcpy for structure copying, and so forth. */
63 #define TARGET_MEM_FUNCTIONS
65 /* By default, allow $ to be part of an identifier. */
66 #define DOLLARS_IN_IDENTIFIERS 2
69 #define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS|MASK_OPEN_VMS)
71 #define TARGET_NAME "OpenVMS/Alpha"
73 #define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
75 /* The structure return address arrives as an "argument" on VMS. */
76 #undef STRUCT_VALUE_REGNUM
77 #define STRUCT_VALUE 0
78 #undef PCC_STATIC_STRUCT_RETURN
80 /* no floating emulation. */
81 #undef REAL_ARITHMETIC
83 /* "long" is 32 bits. */
85 #define LONG_TYPE_SIZE 32
87 /* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
89 #define POINTER_SIZE 32
90 #define POINTERS_EXTEND_UNSIGNED 0
92 /* No data type wants to be aligned rounder than this. */
93 #undef BIGGEST_ALIGNMENT
94 #define BIGGEST_ALIGNMENT 128 /* X Complex */
95 #define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Test CD40VRA */
97 #undef FIXED_REGISTERS
98 #define FIXED_REGISTERS \
99 {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
100 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
101 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
102 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
104 #undef CALL_USED_REGISTERS
105 #define CALL_USED_REGISTERS \
106 {1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
107 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
108 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
109 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
111 #undef HARD_FRAME_POINTER_REGNUM
112 #define HARD_FRAME_POINTER_REGNUM 29
115 #define CAN_ELIMINATE(FROM, TO) \
116 ((TO) != STACK_POINTER_REGNUM || ! alpha_using_fp ())
118 #undef INITIAL_ELIMINATION_OFFSET
119 #define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
120 { if ((FROM) == FRAME_POINTER_REGNUM) \
121 (OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \
122 else if ((FROM) == ARG_POINTER_REGNUM) \
123 (OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \
124 + get_frame_size () \
125 + current_function_pretend_args_size) \
126 - current_function_pretend_args_size); \
127 if ((TO) == STACK_POINTER_REGNUM) \
128 (OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \
131 #undef FUNCTION_ARG_ADVANCE
132 #define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
133 if (MUST_PASS_IN_STACK (MODE, TYPE)) \
134 (CUM) = (CUM & ~0xff) + 6; \
136 (CUM) += ALPHA_ARG_SIZE (MODE, TYPE, NAMED)
138 #undef FUNCTION_ARG_PARTIAL_NREGS
139 #define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
140 ((CUM & 0xff) < 6 && 6 < (CUM & 0xff) \
141 + ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
142 ? 6 - (CUM & 0xff) : 0)
144 extern char *vmskrunch ();
145 #undef ENCODE_SECTION_INFO
146 #define ENCODE_SECTION_INFO(DECL) \
148 if (TREE_CODE (DECL) == FUNCTION_DECL && ! TREE_PUBLIC (DECL)) \
149 SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1; \
151 if (TREE_CODE_CLASS (TREE_CODE (DECL)) == 'd' \
152 && GET_CODE (DECL_RTL (DECL)) == MEM \
153 && GET_CODE (XEXP (DECL_RTL (DECL), 0)) == SYMBOL_REF) \
154 XSTR (XEXP (DECL_RTL (DECL), 0), 0) \
155 = vmskrunch (XSTR (XEXP (DECL_RTL (DECL), 0), 0)); \
158 /* Perform any needed actions needed for a function that is receiving a
159 variable number of arguments.
161 CUM is as for INIT_CUMULATIVE_ARGS.
163 MODE and TYPE are the mode and type of the current parameter.
165 PRETEND_SIZE is a variable that should be set to the amount of stack
166 that must be pushed by the prolog to pretend that our caller pushed
169 Normally, this macro will push all remaining incoming registers on the
170 stack and set PRETEND_SIZE to the length of the registers pushed.
172 For VMS, we allocate space for all 6 arg registers plus a count.
174 However, if NO registers need to be saved, don't allocate any space.
175 This is not only because we won't need the space, but because AP includes
176 the current_pretend_args_size and we don't want to mess up any
177 ap-relative addresses already made. */
179 #undef SETUP_INCOMING_VARARGS
180 #define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
185 emit_move_insn (gen_rtx (REG, DImode, 1), \
186 virtual_incoming_args_rtx); \
187 emit_insn (gen_arg_home ()); \
190 PRETEND_SIZE = 7 * UNITS_PER_WORD; \
194 #undef ASM_DECLARE_FUNCTION_NAME
195 #define ASM_DECLARE_FUNCTION_NAME(FILE,NAME,DECL) \
197 alpha_function_name = vmskrunch (NAME); \
200 #undef ASM_FILE_START
201 #define ASM_FILE_START(FILE) \
203 alpha_write_verstamp (FILE); \
204 fprintf (FILE, "\t.set noreorder\n"); \
205 fprintf (FILE, "\t.set volatile\n"); \
206 ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
209 #undef ASM_OUTPUT_FLOAT
210 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
212 if (REAL_VALUE_ISINF (VALUE) \
213 || REAL_VALUE_ISNAN (VALUE) \
214 || REAL_VALUE_MINUS_ZERO (VALUE)) \
217 REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
218 fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
223 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
224 fprintf (FILE, "\t.%c_floating %s\n", (TARGET_FLOAT_VAX)?'f':'s', str); \
228 #define LINK_SECTION_ASM_OP ".link"
230 #define READONLY_SECTION_ASM_OP ".rdata"
232 #undef EXTRA_SECTIONS
233 #define EXTRA_SECTIONS in_link, in_rdata
235 #undef EXTRA_SECTION_FUNCTIONS
236 #define EXTRA_SECTION_FUNCTIONS \
238 readonly_section () \
240 if (in_section != in_rdata) \
242 fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
243 in_section = in_rdata; \
249 if (in_section != in_link) \
251 fprintf (asm_out_file, "%s\n", LINK_SECTION_ASM_OP); \
252 in_section = in_link; \
256 #undef ASM_OUTPUT_ADDR_DIFF_ELT
257 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) abort ()
259 #undef ASM_OUTPUT_ADDR_VEC_ELT
260 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
261 fprintf (FILE, "\t.quad $%d\n", (VALUE) + 32)
263 #undef READONLY_DATA_SECTION
264 #define READONLY_DATA_SECTION readonly_section
266 #define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
269 void *function_arg ();
270 #define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) function_arg (&CUM, MODE, TYPE, NAMED)
272 #undef CASE_VECTOR_MODE
273 #define CASE_VECTOR_MODE DImode
274 #undef CASE_VECTOR_PC_RELATIVE
276 #undef ASM_OUTPUT_CASE_LABEL
277 #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
278 { ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
280 #define NO_MD_PROTOTYPES
282 /* Output assembler code for a block containing the constant parts
283 of a trampoline, leaving space for the variable parts.
285 The trampoline should set the static chain pointer to value placed
286 into the trampoline and should branch to the specified routine.
287 Note that $27 has been set to the address of the trampoline, so we can
288 use it for addressability of the two data items. Trampolines are always
289 aligned to FUNCTION_BOUNDARY, which is 64 bits. */
291 #undef TRAMPOLINE_TEMPLATE
292 #define TRAMPOLINE_TEMPLATE(FILE) \
294 fprintf (FILE, "\t.quad 0\n"); \
295 fprintf (FILE, "\t.linkage __tramp\n"); \
298 /* Length in units of the trampoline for entering a nested function. */
300 #undef TRAMPOLINE_SIZE
301 #define TRAMPOLINE_SIZE 24
303 /* Emit RTL insns to initialize the variable parts of a trampoline.
304 FNADDR is an RTX for the address of the function's pure code.
305 CXT is an RTX for the static chain value for the function. */
307 #undef INITIALIZE_TRAMPOLINE
308 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
310 emit_move_insn (gen_rtx (MEM, Pmode, (TRAMP)), (FNADDR)); \
311 emit_move_insn (gen_rtx (MEM, Pmode, \
312 memory_address (Pmode, \
313 plus_constant ((TRAMP), 16))), \
317 #undef TRANSFER_FROM_TRAMPOLINE
319 #undef SDB_DEBUGGING_INFO
320 #undef MIPS_DEBUGGING_INFO
322 #ifndef DBX_DEBUGGING_INFO
323 #define DBX_DEBUGGING_INFO
326 #ifdef PREFERRED_DEBUGGING_TYPE
327 #undef PREFERRED_DEBUGGING_TYPE
329 #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
331 #ifdef ASM_FORMAT_PRIVATE_NAME
332 #undef ASM_FORMAT_PRIVATE_NAME
334 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
335 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
336 sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
339 #define ASM_SPEC "-nocpp %{pg}"
341 #undef ASM_FINAL_SPEC
344 #define LIBGCC_SPEC "-lgcc2 -lgcclib"
346 #define OPTIMIZATION_OPTIONS \
348 write_symbols = PREFERRED_DEBUGGING_TYPE; \
349 debug_info_level = (enum debug_info_level) 2; \
352 #undef OVERRIDE_OPTIONS
353 #define OVERRIDE_OPTIONS \
355 if (write_symbols == NO_DEBUG) \
356 debug_info_level = (enum debug_info_level) 0; \
357 override_options (); \
361 #define LINK_SPEC "%{g3:-g3} %{g0:-g0}"
363 #undef STARTFILE_SPEC
364 #define STARTFILE_SPEC ""
367 #define ENDFILE_SPEC "gnu:[000000]crt0.obj"
369 /* Define the names of the division and modulus functions. */
370 #define DIVSI3_LIBCALL "ots$div_i"
371 #define DIVDI3_LIBCALL "ots$div_l"
372 #define UDIVSI3_LIBCALL "ots$div_ui"
373 #define UDIVDI3_LIBCALL "ots$div_ul"
374 #define MODSI3_LIBCALL "ots$mod_i"
375 #define MODDI3_LIBCALL "ots$mod_l"
376 #define UMODSI3_LIBCALL "ots$rem_ui"
377 #define UMODDI3_LIBCALL "ots$rem_ul"