]> gcc.gnu.org Git - gcc.git/blob - gcc/config/i386/osfrose.h
(OPTIMIZATION_OPTIONS): Delete; we don't want to set
[gcc.git] / gcc / config / i386 / osfrose.h
1 /* Definitions of target machine for GNU compiler.
2 Intel 386 (OSF/1 with OSF/rose) version.
3 Copyright (C) 1991 Free Software Foundation, Inc.
4
5 This file is part of GNU CC.
6
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
11
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20
21 /* Put leading underscores in front of names. */
22 #define YES_UNDERSCORES
23
24 #include "halfpic.h"
25 #include "i386/gstabs.h"
26
27 #define OSF_OS
28
29 #undef WORD_SWITCH_TAKES_ARG
30 #define WORD_SWITCH_TAKES_ARG(STR) \
31 (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
32 || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \
33 || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
34 || !strcmp (STR, "pic-names"))
35
36 #define MASK_HALF_PIC 0x40000000 /* Mask for half-pic code */
37 #define MASK_HALF_PIC_DEBUG 0x20000000 /* Debug flag */
38
39 #define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC)
40 #define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG)
41 #define HALF_PIC_DEBUG TARGET_DEBUG
42
43 #undef SUBTARGET_SWITCHES
44 #define SUBTARGET_SWITCHES \
45 { "half-pic", MASK_HALF_PIC}, \
46 { "no-half-pic", -MASK_HALF_PIC}, \
47 { "debugb", MASK_HALF_PIC_DEBUG},
48
49 /* Prefix that appears before all global/static identifiers, except for
50 temporary labels. */
51
52 #define IDENTIFIER_PREFIX "_"
53
54 /* Suffix that appears after all global/static identifiers, except for
55 temporary labels. */
56
57 #define IDENTIFIER_SUFFIX ""
58
59 /* Change default predefines. */
60 #undef CPP_PREDEFINES
61 #define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Di386"
62
63 #undef CPP_SPEC
64 #define CPP_SPEC "\
65 %{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
66 %{.cc: -D__LANGUAGE_C_PLUS_PLUS} \
67 %{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \
68 %{.C: -D__LANGUAGE_C_PLUS_PLUS} \
69 %{.m: -D__LANGUAGE_OBJECTIVE_C} \
70 %{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"
71
72 /* Turn on -mpic-extern by default. */
73 #undef CC1_SPEC
74 #define CC1_SPEC "\
75 %{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \
76 %{pic-none: -mno-half-pic} \
77 %{pic-lib: -mhalf-pic} \
78 %{pic-extern: -mhalf-pic} \
79 %{pic-calls: -mhalf-pic} \
80 %{pic-names*: -mhalf-pic} \
81 %{!pic-*: -mhalf-pic}"
82
83 #undef ASM_SPEC
84 #define ASM_SPEC ""
85
86 #undef LINK_SPEC
87 #define LINK_SPEC "%{v*: -v} \
88 %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \
89 %{nostdlib} %{noshrlib} %{glue}"
90
91 #undef LIB_SPEC
92 #define LIB_SPEC "-lc"
93
94 #undef LIBG_SPEC
95 #define LIBG_SPEC ""
96
97 #undef STARTFILE_SPEC
98 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
99
100 #undef TARGET_VERSION_INTERNAL
101 #undef TARGET_VERSION
102
103 #define I386_VERSION " 80386, OSF/rose objects"
104
105 #define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM)
106 #define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
107
108 #undef MD_EXEC_PREFIX
109 #define MD_EXEC_PREFIX "/usr/ccs/gcc/"
110
111 #undef MD_STARTFILE_PREFIX
112 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
113
114 /* Specify size_t, ptrdiff_t, and wchar_t types. */
115 #undef SIZE_TYPE
116 #undef PTRDIFF_TYPE
117 #undef WCHAR_TYPE
118 #undef WCHAR_TYPE_SIZE
119
120 #define SIZE_TYPE "long unsigned int"
121 #define PTRDIFF_TYPE "int"
122 #define WCHAR_TYPE "unsigned int"
123 #define WCHAR_TYPE_SIZE BITS_PER_WORD
124
125 /* Tell final.c we don't need a label passed to mcount. */
126 #define NO_PROFILE_DATA
127
128 #undef FUNCTION_PROFILER
129 #define FUNCTION_PROFILER(FILE, LABELNO) fprintf (FILE, "\tcall _mcount\n")
130
131 /* A C expression that is 1 if the RTX X is a constant which is a
132 valid address. On most machines, this can be defined as
133 `CONSTANT_P (X)', but a few machines are more restrictive in
134 which constant addresses are supported.
135
136 `CONSTANT_P' accepts integer-values expressions whose values are
137 not explicitly known, such as `symbol_ref', `label_ref', and
138 `high' expressions and `const' arithmetic expressions, in
139 addition to `const_int' and `const_double' expressions. */
140
141 #undef CONSTANT_ADDRESS_P
142 #define CONSTANT_ADDRESS_P(X) \
143 (CONSTANT_P (X) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
144
145 /* Nonzero if the constant value X is a legitimate general operand.
146 It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */
147
148 #undef LEGITIMATE_CONSTANT_P
149 #define LEGITIMATE_CONSTANT_P(X) \
150 (!HALF_PIC_P () \
151 || GET_CODE (X) == CONST_DOUBLE \
152 || GET_CODE (X) == CONST_INT \
153 || !HALF_PIC_ADDRESS_P (X))
154
155 /* GO_IF_LEGITIMATE_ADDRESS recognizes an RTL expression
156 that is a valid memory address for an instruction.
157 The MODE argument is the machine mode for the MEM expression
158 that wants to use this address. */
159
160 #undef GO_IF_LEGITIMATE_ADDRESS
161 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
162 { \
163 if (CONSTANT_P (X)) \
164 { \
165 if (! HALF_PIC_P () || ! HALF_PIC_ADDRESS_P (X)) \
166 goto ADDR; \
167 } \
168 else \
169 { \
170 GO_IF_INDEXING (X, ADDR); \
171 \
172 if (GET_CODE (X) == PLUS) \
173 { \
174 rtx x1 = XEXP (X, 1); \
175 \
176 if (CONSTANT_P (x1)) \
177 { \
178 if (! HALF_PIC_P () || ! HALF_PIC_ADDRESS_P (x1)) \
179 { \
180 rtx x0 = XEXP (X, 0); \
181 GO_IF_INDEXING (x0, ADDR); \
182 } \
183 } \
184 } \
185 } \
186 }
187
188 /* Sometimes certain combinations of command options do not make sense
189 on a particular target machine. You can define a macro
190 `OVERRIDE_OPTIONS' to take account of this. This macro, if
191 defined, is executed once just after all the command options have
192 been parsed. */
193
194 #define OVERRIDE_OPTIONS \
195 { \
196 if (TARGET_HALF_PIC) \
197 half_pic_init (); \
198 }
199
200 /* Define this macro if references to a symbol must be treated
201 differently depending on something about the variable or
202 function named by the symbol (such as what section it is in).
203
204 The macro definition, if any, is executed immediately after the
205 rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
206 The value of the rtl will be a `mem' whose address is a
207 `symbol_ref'.
208
209 The usual thing for this macro to do is to a flag in the
210 `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
211 name string in the `symbol_ref' (if one bit is not enough
212 information).
213
214 The best way to modify the name string is by adding text to the
215 beginning, with suitable punctuation to prevent any ambiguity.
216 Allocate the new name in `saveable_obstack'. You will have to
217 modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
218 and output the name accordingly.
219
220 You can also check the information stored in the `symbol_ref' in
221 the definition of `GO_IF_LEGITIMATE_ADDRESS' or
222 `PRINT_OPERAND_ADDRESS'. */
223
224 #undef ENCODE_SECTION_INFO
225 #define ENCODE_SECTION_INFO(DECL) \
226 do \
227 { \
228 if (HALF_PIC_P ()) \
229 HALF_PIC_ENCODE (DECL); \
230 } \
231 while (0)
232
233
234 /* Given a decl node or constant node, choose the section to output it in
235 and select that section. */
236
237 #undef SELECT_RTX_SECTION
238 #define SELECT_RTX_SECTION(MODE, RTX) \
239 do \
240 { \
241 if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX)) \
242 data_section (); \
243 else \
244 readonly_data_section (); \
245 } \
246 while (0)
247
248 #undef SELECT_SECTION
249 #define SELECT_SECTION(DECL,RELOC) \
250 { \
251 if (TREE_CODE (DECL) == STRING_CST) \
252 { \
253 if (flag_writable_strings) \
254 data_section (); \
255 else \
256 readonly_data_section (); \
257 } \
258 else if (TREE_CODE (DECL) != VAR_DECL) \
259 readonly_data_section (); \
260 else if (!TREE_READONLY (DECL)) \
261 data_section (); \
262 else \
263 readonly_data_section (); \
264 }
265
266
267 /* A C statement (sans semicolon) to output to the stdio stream
268 STREAM any text necessary for declaring the name NAME of an
269 initialized variable which is being defined. This macro must
270 output the label definition (perhaps using `ASM_OUTPUT_LABEL').
271 The argument DECL is the `VAR_DECL' tree node representing the
272 variable.
273
274 If this macro is not defined, then the variable name is defined
275 in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
276
277 #undef ASM_DECLARE_OBJECT_NAME
278 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
279 do \
280 { \
281 ASM_OUTPUT_LABEL(STREAM,NAME); \
282 HALF_PIC_DECLARE (NAME); \
283 } \
284 while (0)
285
286 /* This is how to declare a function name. */
287
288 #define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
289 do \
290 { \
291 ASM_OUTPUT_LABEL(STREAM,NAME); \
292 HALF_PIC_DECLARE (NAME); \
293 } \
294 while (0)
295
296 /* This says what to print at the end of the assembly file */
297 #define ASM_FILE_END(STREAM) \
298 do \
299 { \
300 if (HALF_PIC_P ()) \
301 HALF_PIC_FINISH (STREAM); \
302 } \
303 while (0)
304
305 /* Tell collect that the object format is OSF/rose. */
306 #define OBJECT_FORMAT_ROSE
307
308 /* Tell collect where the appropriate binaries are. */
309 #define REAL_LD_FILE_NAME "/usr/ccs/gcc/gld"
310 #define REAL_NM_FILE_NAME "/usr/ccs/bin/nm"
311 #define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip"
312
313 /* Use atexit for static constructors/destructors, instead of defining
314 our own exit function. */
315 #define HAVE_ATEXIT
316
317 /* Define this macro meaning that gcc should find the library 'libgcc.a'
318 by hand, rather than passing the argument '-lgcc' to tell the linker
319 to do the search */
320 #define LINK_LIBGCC_SPECIAL
321
322 /* A C statement to output assembler commands which will identify the object
323 file as having been compile with GNU CC. We don't need or want this for
324 OSF1. GDB doesn't need it and kdb doesn't like it */
325 #define ASM_IDENTIFY_GCC(FILE)
326
327 /* This is how to output an assembler line defining a `double' constant.
328 Use "word" pseudos to avoid printing NaNs, infinity, etc. */
329
330 /* This is how to output an assembler line defining a `double' constant. */
331
332 #undef ASM_OUTPUT_DOUBLE
333
334 #ifndef CROSS_COMPILE
335 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
336 do \
337 { \
338 long value_long[2]; \
339 REAL_VALUE_TO_TARGET_DOUBLE (VALUE, value_long); \
340 \
341 fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.20g\n\t.long\t0x%08lx\n", \
342 value_long[0], VALUE, value_long[1]); \
343 } \
344 while (0)
345
346 #else
347 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
348 fprintf (STREAM, "\t.double\t%.20g\n", VALUE)
349 #endif
350
351 /* This is how to output an assembler line defining a `float' constant. */
352
353 #undef ASM_OUTPUT_FLOAT
354
355 #ifndef CROSS_COMPILE
356 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
357 do \
358 { \
359 long value_long; \
360 REAL_VALUE_TO_TARGET_SINGLE (VALUE, value_long); \
361 \
362 fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.12g (float)\n", \
363 value_long, VALUE); \
364 } \
365 while (0)
366
367 #else
368 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
369 fprintf (STREAM, "\t.float\t%.12g\n", VALUE)
370 #endif
371
372
373 /* Generate calls to memcpy, etc., not bcopy, etc. */
374 #define TARGET_MEM_FUNCTIONS
375
376
377 \f
378 /* Defines to be able to build libgcc.a with GCC. */
379
380 /* It might seem that these are not important, since gcc 2 will never
381 call libgcc for these functions. But programs might be linked with
382 code compiled by gcc 1, and then these will be used. */
383
384 #define perform_udivsi3(a,b) \
385 { \
386 register int dx asm("dx"); \
387 register int ax asm("ax"); \
388 \
389 dx = 0; \
390 ax = a; \
391 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
392 return ax; \
393 }
394
395 #define perform_divsi3(a,b) \
396 { \
397 register int dx asm("dx"); \
398 register int ax asm("ax"); \
399 \
400 ax = a; \
401 asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
402 return ax; \
403 }
404
405 #define perform_umodsi3(a,b) \
406 { \
407 register int dx asm("dx"); \
408 register int ax asm("ax"); \
409 \
410 dx = 0; \
411 ax = a; \
412 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
413 return dx; \
414 }
415
416 #define perform_modsi3(a,b) \
417 { \
418 register int dx asm("dx"); \
419 register int ax asm("ax"); \
420 \
421 ax = a; \
422 asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
423 return dx; \
424 }
425
426 #define perform_fixdfsi(a) \
427 { \
428 auto unsigned short ostatus; \
429 auto unsigned short nstatus; \
430 auto int ret; \
431 auto double tmp; \
432 \
433 &ostatus; /* guarantee these land in memory */ \
434 &nstatus; \
435 &ret; \
436 &tmp; \
437 \
438 asm volatile ("fnstcw %0" : "=m" (ostatus)); \
439 nstatus = ostatus | 0x0c00; \
440 asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
441 tmp = a; \
442 asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \
443 asm volatile ("fistpl %0" : "=m" (ret)); \
444 asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \
445 \
446 return ret; \
447 }
This page took 0.059575 seconds and 6 git commands to generate.