]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/i860/fx2800.h
i * libgcc1-test.c, libgcc1.c, config/i386/perform.h: Delete file.
[thirdparty/gcc.git] / gcc / config / i860 / fx2800.h
CommitLineData
4f22dc71
RS
1/* Target definitions for GNU compiler for Alliant FX/2800
2 running Concentrix 2.2
de323aa1 3 Copyright (C) 1991, 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
a67c93c8 4 Contributed by Howard Chu (hyc@hanauma.jpl.nasa.gov).
4f22dc71
RS
5
6This file is part of GNU CC.
7
8GNU CC is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2, or (at your option)
11any later version.
12
13GNU CC is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with GNU CC; see the file COPYING. If not, write to
5b1a918b
RK
20the Free Software Foundation, 59 Temple Place - Suite 330,
21Boston, MA 02111-1307, USA. */
4f22dc71 22
4f22dc71
RS
23/* The Alliant fx2800 running Concentrix 2.x is weird. This is basically
24 a BSD 4.3 based operating system, but it uses svr4 ELF format object
25 files and it somehow puts BSD stabs records into the ELF files for
26 symbolic debug information. The assembler is "mostly an SVR4 assembler
27 with some Alliant additions. We based it on the `Intel 80860 Assembly
28 Language Specification' from AT&T." */
29
30/* This file consists of three sections. The first section establishes
31 definitions unique to the Alliant FX/2800. The next section reconciles
32 differences between Alliant and i860v4.h, and the last overrides the
33 remaining differences with svr4.h */
34
35#undef TARGET_VERSION
36#define TARGET_VERSION fprintf (stderr, " (i860 Alliant)");
37
38/* atexit is not present prior to Concentrix 2.2. Uncomment the following
39 if you're on 2.1 or older. */
40
c063dc98 41/* #define NEED_ATEXIT */
4f22dc71 42
ce60ce93 43#define I860_STRICT_ABI_PROLOGUES
f093e272
RS
44
45/* There is no avoiding this; -L does not exist at all (in Concentrix 2.2). */
6cc98222 46#define LINK_LIBGCC_SPECIAL 1
ce60ce93 47
4f22dc71
RS
48/* Most of the Alliant-specific definitions here are to get stab info that
49 Alliant's dbx can understand. */
50
51#define DBX_DEBUGGING_INFO
52#define DEFAULT_GDB_EXTENSIONS 0
53#define DBX_NO_XREFS
54#define DBX_NO_EXTRA_TAGS
55
56/* Alliant dbx also needs to see the function stab before anything
57 else in the function. */
58
59#define DBX_FUNCTION_FIRST
60#define DBX_LBRAC_FIRST
61
62/* Alliant dbx also needs to see the end of a function somewhere. */
63
64#define DBX_OUTPUT_FUNCTION_END(file,decl) \
65 fprintf (file, ".stab \"\",.,0x%x,0,0\n", N_EFUN)
66
67/* Alliant dbx has predefined types, so they must be emitted with the
68 proper type numbers. The defined types are:
69
70 Type # C, Fortran, Pascal Types
71 -- ------------------------
72 1 char, integer*1
73 2 short, integer*2
74 3 int, long, integer*4, integer
75 4 logical*1, byte
76 5 logical*2
77 6 logical*4, logical
78 7 float, real*4, real
79 8 double, real*8, double
80 9 single complex, complex*8, complex
81 10 double complex, doublecomplex
82 11 character
83 12 void
84 13 nil
85 14 boolean
86 15 unsigned char, ubyte
87 16 unsigned short, uword
88 17 unsigned, unsigned int, unsigned long, ulong
89 18 quad, logical*8
90 19 long long, integer*8
91 20 unsigned long long, uquad*8
92 21-100 reserved for future predefined types
93 100 long redefine same as 3
94 101 unsigned long same as 17
95 -- --------------------
96 102 First user program type
97
98 Since long and unsigned long are int references, they must be handled
99 as special cases. The Alliant compiler doesn't use types 18-20, so it
100 sets long & unsigned long in 18 & 19, not in 100 & 101 as shown above. */
101
102#define DBX_OUTPUT_STANDARD_TYPES(syms) \
103{ char *dtyps[]={"", "char", "short int", "int", "logical*1", \
104 "logical*2", "logical*4", "float", "double", "complex", \
105 "doublecomplex", "character", "void", "nil", "boolean", \
106 "unsigned char", "short unsigned int", "unsigned int", \
107 "logical*8", "long long int", "long long unsigned int",""}; \
108 \
109 tree decl; \
110 int i; \
111 \
b505fab8
RS
112 for (i=1;*dtyps[i];i++) \
113 for (decl = syms; decl; decl = TREE_CHAIN(decl)) \
6cc98222 114 if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) && \
b505fab8 115 !strcmp(IDENTIFIER_POINTER(DECL_NAME(decl)), dtyps[i])) { \
4f22dc71
RS
116 TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i; \
117 typevec[i] = TYPE_DEFINED; \
118 dbxout_symbol (decl, 0); \
b505fab8 119 break; \
4f22dc71 120 } \
4f22dc71 121 \
b505fab8 122 for (decl = syms; decl; decl = TREE_CHAIN(decl)) \
6cc98222 123 if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) && \
b505fab8
RS
124 !strcmp(IDENTIFIER_POINTER(DECL_NAME(decl)),"long int")) { \
125 TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i; \
126 typevec[i] = TYPE_DEFINED; \
127 fprintf(asmfile,".stab \"long int:t%d=3\",0,0x%x,0,0\n", \
128 i++,N_LSYM); \
129 TREE_ASM_WRITTEN (decl) = 1; \
130 break; \
131 } \
4f22dc71 132 \
b505fab8 133 for (decl = syms; decl; decl = TREE_CHAIN(decl)) \
6cc98222 134 if ((TREE_CODE (decl) == TYPE_DECL) && DECL_NAME(decl) && !strcmp( \
b505fab8
RS
135 IDENTIFIER_POINTER(DECL_NAME(decl)),"long unsigned int")) { \
136 TYPE_SYMTAB_ADDRESS (TREE_TYPE (decl)) = i; \
137 typevec[i] = TYPE_DEFINED; \
138 fprintf(asmfile,".stab \"long unsigned int:t%d=17\",0,0x%x,0,0\n",\
139 i++,N_LSYM); \
140 TREE_ASM_WRITTEN (decl) = 1; \
141 break; \
142 } \
4f22dc71
RS
143 next_type_number = i; };
144
145/* Alliant dbx doesn't understand split names... */
146
147#define DBX_CONTIN_LENGTH 0
148
149/* The syntax for stabs records is also different; there is only a single
150 ".stab" directive instead of the 3 directives in BSD, and the order of
151 arguments is slightly changed. */
152
de323aa1
HPN
153#define ASM_STABS_OP "\t.stab "
154#define ASM_STABN_OP "\t.stab "
155#define ASM_STABD_OP "\t.stab "
4f22dc71
RS
156
157#define DBX_MEMPARM_STABS_LETTER 'k'
158#define DBX_REGPARM_STABS_LETTER 'r'
159
160#define ASM_OUTPUT_SOURCE_LINE(file,num) \
161 fprintf (file, "\t.stab \"\",.,0x%x,0,%d\n", \
162 N_SLINE,num)
163
164#if 0 /* Alliant dbx only reads first N_SO, so it
165 ignores the filename if dir is present. */
166#define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(file,name) \
167 fprintf (file, ".stab \"%s/\",.Ltext0,0x%x,0,0\n", \
168 name, N_SO)
169#else
170#define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(file,name)
171#endif
172
173#define DBX_OUTPUT_MAIN_SOURCE_FILENAME(file,name) \
73e2c650
PE
174 fprintf (file, ".stab "); \
175 output_quoted_string (file, name); \
176 fprintf (file, ",.Ltext0,0x%x,0,0\n", N_SO); \
4f22dc71
RS
177 text_section (); \
178 ASM_OUTPUT_INTERNAL_LABEL (file, "Ltext", 0)
179
180#define DBX_OUTPUT_SOURCE_FILENAME(file,name) \
73e2c650
PE
181 do { fprintf (file, ".stab "); \
182 output_quoted_string (file, name); \
183 fprintf (file, ",.Ltext0,0x%x,0,0\n", N_SOL); \
184 } while (0)
4f22dc71
RS
185
186#define DBX_OUTPUT_CONSTANT_SYMBOL(file,name,ival) \
187 fprintf (file, ".stab \"%s:c=i%d\",0,0x%x,0,0\n", \
188 name, ival, N_LSYM)
189
190#define DBX_FINISH_SYMBOL(decl) \
191 int line = 0; \
192 fprintf (asmfile, "\","); \
193 if (current_sym_addr) \
194 output_addr_const (asmfile, current_sym_addr); \
195 else \
196 fprintf (asmfile, "%d", current_sym_value); \
197 if (decl != 0 && TREE_CODE(decl) == FUNCTION_DECL) \
198 line=DECL_SOURCE_LINE (decl); \
199 fprintf (asmfile, ",0x%x,%d,%d\n", current_sym_code, \
200 line!=0?64:0,line)
201
202#define DBX_OUTPUT_CATCH(file,decl,name) \
cebfccda
RS
203 fprintf (file, ".stab \"%s:C1\",", \
204 IDENTIFIER_POINTER (DECL_NAME (decl))); \
205 assemble_name (file, name); \
206 fprintf (file, ",0x%x,0,0\n", N_CATCH)
4f22dc71
RS
207
208#define DBX_OUTPUT_LBRAC(file,name) \
cebfccda
RS
209 if (depth > 1) { \
210 fprintf (file, ".stab \"\","); \
211 assemble_name (file, name); \
212 fprintf (file, ",0x%x,0,%d\n", N_LBRAC, depth); }
4f22dc71
RS
213
214#define DBX_OUTPUT_RBRAC(file,name) \
cebfccda
RS
215 if (depth > 1) { \
216 fprintf (file, ".stab \"\","); \
217 assemble_name (file, name); \
218 fprintf (file, ",0x%x,0,%d\n", N_RBRAC, depth); }
219
ce60ce93 220#define DBX_OUTPUT_ENUM(file,type) \
cebfccda 221 fprintf (file, "e3"); \
ce60ce93 222 CHARS(2); \
cebfccda
RS
223 for (tem = TYPE_VALUES (type); tem; tem = TREE_CHAIN (tem)) \
224 { \
225 fprintf (asmfile, "%s:%d,", \
226 IDENTIFIER_POINTER (TREE_PURPOSE (tem)), \
227 TREE_INT_CST_LOW (TREE_VALUE (tem))); \
228 CHARS (11 + IDENTIFIER_LENGTH (TREE_PURPOSE (tem))); \
229 if (TREE_CHAIN (tem) != 0) \
230 CONTIN; \
231 } \
232 putc (';', asmfile); \
233 CHARS (1);
4f22dc71
RS
234
235/* Undefine some things defined in i860.h because the native C compiler
236 on the FX/2800 emits code to do these operations inline. For GCC,
237 we will use the default implementation of these things... i.e.
7857f134 238 generating calls to libgcc routines. */
4f22dc71
RS
239
240#undef DIVSI3_LIBCALL
241#undef UDIVSI3_LIBCALL
242#undef REMSI3_LIBCALL
243#undef UREMSI3_LIBCALL
244
4f22dc71
RS
245/* Global pointer needs to be 8 byte aligned? Link error if not... */
246
247#define DATA_ALIGNMENT(dummy,align) \
248 ((TREE_PUBLIC (decl) && \
a0d66c8d 249 (POINTER_TYPE_P (TREE_TYPE (decl)))) ? 64: align)
4f22dc71
RS
250
251#undef FUNCTION_PROFILER
252#define FUNCTION_PROFILER(FILE, LABELNO) \
253 fprintf (FILE, "\tcall __mcount_\n\tnop\n")
254
255/* Overrides for i860v4.h begin here */
256
257/* Provide a set of pre-definitions and pre-assertions appropriate for
258 the i860 running Concentrix 2.x. */
259
260#undef CPP_PREDEFINES
2b57e919 261#define CPP_PREDEFINES "-Di860 -Dunix -DBSD4_3 -Dalliant -Asystem=unix -Asystem=bsd -Acpu=i860 -Amachine=i860"
4f22dc71
RS
262
263#undef I860_REG_PREFIX
264#undef ASM_COMMENT_START
265#define ASM_COMMENT_START "//"
ce60ce93
RS
266
267/* Use definitions of ASM_OUTPUT_{DOUBLE,FLOAT} as given in i860.h */
268
269#undef ASM_OUTPUT_DOUBLE
270#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
271 fprintf(FILE, "\t.double %.20e\n", (VALUE))
272#undef ASM_OUTPUT_FLOAT
273#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
274 fprintf(FILE, "\t.float %.12e\n", (VALUE))
275
4f22dc71
RS
276#undef ASM_FILE_START
277#define ASM_FILE_START(FILE)
278#undef ASM_OUTPUT_FUNCTION_PREFIX
e241407e
RS
279#define ASM_OUTPUT_FUNCTION_PREFIX(FILE,NAME) \
280 fputs("\tnop\n", (FILE)); \
281 current_function_original_name = (NAME)
4f22dc71
RS
282#undef ASM_OUTPUT_PROLOGUE_SUFFIX
283
284/* Overrides for svr4.h begin here */
285
4f22dc71
RS
286#undef SWITCH_TAKES_ARG
287#undef WORD_SWITCH_TAKES_ARG
288
289#undef ASM_SPEC
290#undef ASM_FINAL_SPEC
291#undef MD_STARTFILE_PREFIX
ce60ce93 292#undef MD_EXEC_PREFIX
4f22dc71
RS
293
294/* Generate an error message if -p option is selected. Concentrix 2.x
295 does not support prof format profiling, only gprof is supported. */
296
297#define CPP_SPEC "%{p:%e-p option not supported: use -pg instead}"
298
299/* Provide an appropriate LIB_SPEC. The crtend.o file provides part of the
300 support for getting C++ file-scope static objects constructed before
301 entering `main'. */
302
303#undef LIB_SPEC
304#define LIB_SPEC \
305 "%{g*:-lg} %{!pg:-lc}%{pg:-lc_p} crtend.o%s"
306
307/* Tell linker to strip local symbols, since assembler may not. */
308
309#undef LINK_SPEC
310#define LINK_SPEC "-X"
311
312/* Get the correct startup file for regular or profiled code. Also
313 use the crtbegin.o file for C++ ... */
314
315#undef STARTFILE_SPEC
316#define STARTFILE_SPEC \
317 "%{!pg:crt0.o%s}%{pg:gcrt0.o%s} crtbegin.o%s"
318
319#undef SCCS_DIRECTIVE
320#undef NO_DOLLAR_IN_LABEL
321#undef TARGET_MEM_FUNCTIONS
322
323#undef DWARF_DEBUGGING_INFO
324
66dae892
RK
325/* The prefix to add to user-visible assembler symbols. */
326
327#undef USER_LABEL_PREFIX
328#define USER_LABEL_PREFIX "_"
329
4f22dc71
RS
330#undef ASM_OUTPUT_EXTERNAL_LIBCALL
331
24f34136 332/* ??? Is this used anywhere? */
4f22dc71 333#undef BSS_ASM_OP
de323aa1 334#define BSS_ASM_OP "\t.lcomm "
a67c93c8
RK
335
336#undef ASM_FILE_END
337#define ASM_FILE_END(FILE) \
338do { \
339 if (current_function_original_name != NULL) { \
340 tdesc_section(); \
341 fprintf ((FILE), "%s __ETEXT\n", ASM_LONG); \
342 fprintf ((FILE), "%s 0\n", ASM_LONG); \
343 text_section(); \
344 fputs("__ETEXT:\n", (FILE)); \
345 } \
be163a70
ZW
346 if (!flag_no_ident) \
347 fprintf ((FILE), "\t.ident\t\"GCC: (GNU) %s\"\n", \
348 version_string); \
a67c93c8 349 } while (0)