1 /* Definitions of target machine for GNU compiler, for DEC Alpha
3 Copyright (C) 1995, 1996, 1999, 2000, 2002 Free Software Foundation, Inc.
5 Donn Terry, Softway Systems, Inc.
7 Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
9 This file is part of GNU CC.
11 GNU CC is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2, or (at your option)
16 GNU CC is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with GNU CC; see the file COPYING. If not, write to
23 the Free Software Foundation, 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. */
26 /* cpp handles __STDC__ */
27 /* The three "Alpha" defines on the first such line are from the CLAXP spec */
28 #define TARGET_OS_CPP_BUILTINS() \
30 builtin_define ("__INTERIX"); \
31 builtin_define ("__OPENNT"); \
32 builtin_define ("__Alpha_AXP"); \
33 builtin_define ("_M_ALPHA"); \
34 builtin_define ("_ALPHA_"); \
35 builtin_define ("__stdcall="); \
36 builtin_define ("__cdecl="); \
37 builtin_assert ("system=unix"); \
38 builtin_assert ("system=interix"); \
41 #undef CPP_SUBTARGET_SPEC
42 #define CPP_SUBTARGET_SPEC "\
44 %{posix:-D_POSIX_SOURCE} \
45 -isystem %$INTERIX_ROOT/usr/include"
48 #define TARGET_VERSION fprintf (stderr, " (alpha Interix)");
50 /* alpha.h sets this, but it doesn't apply to us */
51 #undef OBJECT_FORMAT_ECOFF
52 #undef OBJECT_FORMAT_COFF
56 /* MD_STARTFILE_PREFIX */
58 /* ASM_OUTPUT_LOOP_ALIGN; ASM_OUTPUT_ALIGN_CODE */
60 /* Codegen macro overrides for NT internal conventions */
62 /* the below are ecoff specific... we don't need them, so
63 undef them (they'll get a default later) */
65 #undef PUT_SDB_BLOCK_START
66 #undef PUT_SDB_BLOCK_END
68 /* The following are needed for C++, but also needed for profiling */
70 /* Support const sections and the ctors and dtors sections for g++. */
72 #define READONLY_DATA_SECTION_ASM_OP "\t.rdata"
74 /* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
76 Note that we want to give these sections the SHF_WRITE attribute
77 because these sections will actually contain data (i.e. tables of
78 addresses of functions in the current root executable or shared library
79 file) and, in the case of a shared library, the relocatable addresses
80 will have to be properly resolved/relocated (and then written into) by
81 the dynamic linker when it actually attaches the given shared library
82 to the executing process. (Note that on SVR4, you may wish to use the
83 `-z text' option to the ELF linker, when building a shared library, as
84 an additional check that you are doing everything right. But if you do
85 use the `-z text' option when building a shared library, you will get
86 errors unless the .ctors and .dtors sections are marked as writable
87 via the SHF_WRITE attribute.) */
89 #define CTORS_SECTION_ASM_OP "\t.ctors"
90 #define DTORS_SECTION_ASM_OP "\t.dtors"
92 /* The linker will take care of this, and having them causes problems with
93 ld -r (specifically -rU). */
94 #define CTOR_LISTS_DEFINED_EXTERNALLY 1
96 #define SET_ASM_OP "\t.set\t"
97 /* Output a definition (implements alias) */
98 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
101 fprintf ((FILE), "\t"); \
102 assemble_name (FILE, LABEL1); \
103 fprintf (FILE, "="); \
104 assemble_name (FILE, LABEL2); \
105 fprintf (FILE, "\n"); \
109 /* We use the defaults, so undef the null definitions */
110 #undef PUT_SDB_FUNCTION_START
111 #undef PUT_SDB_FUNCTION_END
112 #undef PUT_SDB_EPILOGUE_END
114 #define HOST_PTR_PRINTF "%p"
115 #define HOST_PTR_AS_INT unsigned long
117 #define PCC_BITFIELD_TYPE_MATTERS 1
118 #define PCC_BITFIELD_TYPE_TEST TYPE_NATIVE(rec)
119 #define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
121 /* DWARF2 Unwinding doesn't work with exception handling yet. */
122 #undef DWARF2_UNWIND_INFO
123 #define DWARF2_UNWIND_INFO 0
125 /* Don't assume anything about the header files. */
126 #define NO_IMPLICIT_EXTERN_C
128 /* The definition of this macro implies that there are cases where
129 a scalar value cannot be returned in registers.
131 On NT (according to the spec) anything except strings/array that fits
132 in 64 bits is returned in the registers (this appears to differ from
133 the rest of the Alpha family). */
135 #undef RETURN_IN_MEMORY
136 #define RETURN_IN_MEMORY(TYPE) \
137 (TREE_CODE (TYPE) == ARRAY_TYPE || int_size_in_bytes(TYPE) > 8)
139 #define ASM_LOAD_ADDR(loc, reg) " lda " #reg "," #loc "\n"
141 #undef ASM_FILE_START
142 #define ASM_FILE_START(FILE) \
144 alpha_write_verstamp (FILE); \
145 fprintf (FILE, "\t.set noreorder\n"); \
146 fprintf (FILE, "\t.set volatile\n"); \
147 fprintf (FILE, "\t.set noat\n"); \
148 fprintf (FILE, "\t.globl\t__fltused\n"); \
149 ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \