]>
gcc.gnu.org Git - gcc.git/blob - 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.
5 This file is part of GNU CC.
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)
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.
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. */
21 /* Put leading underscores in front of names. */
22 #define YES_UNDERSCORES
25 #include "i386/gstabs.h"
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"))
36 #define MASK_HALF_PIC 0x40000000 /* Mask for half-pic code */
37 #define MASK_HALF_PIC_DEBUG 0x20000000 /* Debug flag */
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
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},
49 /* Prefix that appears before all global/static identifiers, except for
52 #define IDENTIFIER_PREFIX "_"
54 /* Suffix that appears after all global/static identifiers, except for
57 #define IDENTIFIER_SUFFIX ""
59 /* Change default predefines. */
61 #define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Di386"
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}}"
72 /* Turn on -mpic-extern by default. */
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}"
87 #define LINK_SPEC "%{v*: -v} \
88 %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \
89 %{nostdlib} %{noshrlib} %{glue}"
92 #define LIB_SPEC "-lc"
98 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
100 #undef TARGET_VERSION_INTERNAL
101 #undef TARGET_VERSION
103 #define I386_VERSION " 80386, OSF/rose objects"
105 #define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM)
106 #define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr)
108 #undef MD_EXEC_PREFIX
109 #define MD_EXEC_PREFIX "/usr/ccs/gcc/"
111 #undef MD_STARTFILE_PREFIX
112 #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
114 /* Specify size_t, ptrdiff_t, and wchar_t types. */
118 #undef WCHAR_TYPE_SIZE
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
125 /* Tell final.c we don't need a label passed to mcount. */
126 #define NO_PROFILE_DATA
128 #undef FUNCTION_PROFILER
129 #define FUNCTION_PROFILER(FILE, LABELNO) fprintf (FILE, "\tcall _mcount\n")
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.
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. */
141 #undef CONSTANT_ADDRESS_P
142 #define CONSTANT_ADDRESS_P(X) \
143 (CONSTANT_P (X) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
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. */
148 #undef LEGITIMATE_CONSTANT_P
149 #define LEGITIMATE_CONSTANT_P(X) \
151 || GET_CODE (X) == CONST_DOUBLE \
152 || GET_CODE (X) == CONST_INT \
153 || !HALF_PIC_ADDRESS_P (X))
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. */
160 #undef GO_IF_LEGITIMATE_ADDRESS
161 #define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
163 if (CONSTANT_P (X)) \
165 if (! HALF_PIC_P () || ! HALF_PIC_ADDRESS_P (X)) \
170 GO_IF_INDEXING (X, ADDR); \
172 if (GET_CODE (X) == PLUS) \
174 rtx x1 = XEXP (X, 1); \
176 if (CONSTANT_P (x1)) \
178 if (! HALF_PIC_P () || ! HALF_PIC_ADDRESS_P (x1)) \
180 rtx x0 = XEXP (X, 0); \
181 GO_IF_INDEXING (x0, ADDR); \
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
194 #define OVERRIDE_OPTIONS \
196 if (TARGET_HALF_PIC) \
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).
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
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
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.
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'. */
224 #undef ENCODE_SECTION_INFO
225 #define ENCODE_SECTION_INFO(DECL) \
229 HALF_PIC_ENCODE (DECL); \
234 /* Given a decl node or constant node, choose the section to output it in
235 and select that section. */
237 #undef SELECT_RTX_SECTION
238 #define SELECT_RTX_SECTION(MODE, RTX) \
241 if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX)) \
244 readonly_data_section (); \
248 #undef SELECT_SECTION
249 #define SELECT_SECTION(DECL,RELOC) \
251 if (TREE_CODE (DECL) == STRING_CST) \
253 if (flag_writable_strings) \
256 readonly_data_section (); \
258 else if (TREE_CODE (DECL) != VAR_DECL) \
259 readonly_data_section (); \
260 else if (!TREE_READONLY (DECL)) \
263 readonly_data_section (); \
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
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'). */
277 #undef ASM_DECLARE_OBJECT_NAME
278 #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
281 ASM_OUTPUT_LABEL(STREAM,NAME); \
282 HALF_PIC_DECLARE (NAME); \
286 /* This is how to declare a function name. */
288 #define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
291 ASM_OUTPUT_LABEL(STREAM,NAME); \
292 HALF_PIC_DECLARE (NAME); \
296 /* This says what to print at the end of the assembly file */
297 #define ASM_FILE_END(STREAM) \
301 HALF_PIC_FINISH (STREAM); \
305 /* Tell collect that the object format is OSF/rose. */
306 #define OBJECT_FORMAT_ROSE
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"
313 /* Use atexit for static constructors/destructors, instead of defining
314 our own exit function. */
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
320 #define LINK_LIBGCC_SPECIAL
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)
327 /* This is how to output an assembler line defining a `double' constant.
328 Use "word" pseudos to avoid printing NaNs, infinity, etc. */
330 /* This is how to output an assembler line defining a `double' constant. */
332 #undef ASM_OUTPUT_DOUBLE
334 #ifndef CROSS_COMPILE
335 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
338 long value_long[2]; \
339 REAL_VALUE_TO_TARGET_DOUBLE (VALUE, value_long); \
341 fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.20g\n\t.long\t0x%08lx\n", \
342 value_long[0], VALUE, value_long[1]); \
347 #define ASM_OUTPUT_DOUBLE(STREAM, VALUE) \
348 fprintf (STREAM, "\t.double\t%.20g\n", VALUE)
351 /* This is how to output an assembler line defining a `float' constant. */
353 #undef ASM_OUTPUT_FLOAT
355 #ifndef CROSS_COMPILE
356 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
360 REAL_VALUE_TO_TARGET_SINGLE (VALUE, value_long); \
362 fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.12g (float)\n", \
363 value_long, VALUE); \
368 #define ASM_OUTPUT_FLOAT(STREAM, VALUE) \
369 fprintf (STREAM, "\t.float\t%.12g\n", VALUE)
373 /* Generate calls to memcpy, etc., not bcopy, etc. */
374 #define TARGET_MEM_FUNCTIONS
378 /* Defines to be able to build libgcc.a with GCC. */
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. */
384 #define perform_udivsi3(a,b) \
386 register int dx asm("dx"); \
387 register int ax asm("ax"); \
391 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
395 #define perform_divsi3(a,b) \
397 register int dx asm("dx"); \
398 register int ax asm("ax"); \
401 asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
405 #define perform_umodsi3(a,b) \
407 register int dx asm("dx"); \
408 register int ax asm("ax"); \
412 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
416 #define perform_modsi3(a,b) \
418 register int dx asm("dx"); \
419 register int ax asm("ax"); \
422 asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
426 #define perform_fixdfsi(a) \
428 auto unsigned short ostatus; \
429 auto unsigned short nstatus; \
433 &ostatus; /* guarantee these land in memory */ \
438 asm volatile ("fnstcw %0" : "=m" (ostatus)); \
439 nstatus = ostatus | 0x0c00; \
440 asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
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)); \
This page took 0.059575 seconds and 6 git commands to generate.