|
|
1.1 root 1: /* Definitions of target machine for GNU compiler.
2: Encore Multimax (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:
1.1.1.3 ! root 21: #include "halfpic.h"
1.1 root 22: #include "i386gas.h"
23:
24: #define OSF_OS
25:
26: /* Use a more friendly abort which prints internal compiler error,
27: rather than just dumping core. */
28:
29: #ifndef abort
30: #define abort fancy_abort
31: #endif
32:
1.1.1.3 ! root 33: #define MASK_HALF_PIC 0x00000100 /* Mask for half-pic code */
! 34: #define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC)
! 35:
! 36: #ifdef SUBTARGET_SWITCHES
! 37: #undef SUBTARGET_SWITCHES
! 38: #endif
! 39: #define SUBTARGET_SWITCHES \
! 40: { "half-pic", MASK_HALF_PIC}, \
! 41: { "no-half-pic", -MASK_HALF_PIC},
! 42:
1.1 root 43: /* Prefix that appears before all global/static identifiers, except for
44: temporary labels. */
45:
46: #define IDENTIFIER_PREFIX "_"
47:
48: /* Suffix that appears after all global/static identifiers, except for
49: temporary labels. */
50:
51: #define IDENTIFIER_SUFFIX ""
52:
53: /* Change default predefines. */
54: #ifdef CPP_PREDEFINES
55: #undef CPP_PREDEFINES
56: #endif
57: #define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Di386"
58:
59: #ifdef CPP_SPEC
60: #undef CPP_SPEC
61: #endif
62: #define CPP_SPEC "\
63: %{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
64: %{.cc: -D__LANGUAGE_C_PLUS_PLUS} \
65: %{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \
66: %{.C: -D__LANGUAGE_C_PLUS_PLUS} \
67: %{.m: -D__LANGUAGE_OBJECTIVE_C} \
68: %{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}"
69:
70: #ifdef CC1_SPEC
71: #undef CC1_SPEC
72: #endif
1.1.1.3 ! root 73: #define CC1_SPEC \
! 74: "%{pic-none: -mno-half-pic} \
! 75: %{pic-lib: -mhalf-pic} \
! 76: %{pic-extern: -mhalf-pic} \
! 77: %{pic-calls: -mhalf-pic}"
1.1 root 78:
79: #ifdef ASM_SPEC
80: #undef ASM_SPEC
81: #endif
82: #define ASM_SPEC ""
83:
84: #ifdef LINK_SPEC
85: #undef LINK_SPEC
86: #endif
87: #define LINK_SPEC "%{v*: -v} \
1.1.1.3 ! root 88: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \
! 89: %{nostdlib} %{noshrlib} %{glue}"
1.1 root 90:
91: #ifdef LIB_SPEC
92: #undef LIB_SPEC
93: #endif
94:
1.1.1.3 ! root 95: #define LIB_SPEC "-lc"
1.1 root 96:
97: #ifdef LIBG_SPEC
98: #undef LIBG_SPEC
99: #endif
100: #define LIBG_SPEC ""
101:
102: #ifdef STARTFILE_SPEC
103: #undef STARTFILE_SPEC
104: #endif
105: #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}"
106:
107: #ifdef MACHINE_TYPE
108: #undef MACHINE_TYPE
109: #endif
110:
111: #define MACHINE_TYPE ((!TARGET_486) ? "80386 running OSF/1 with OSF/rose objects" : \
112: "80486 running OSF/1 with OSF/rose objects")
113:
114: #ifdef MD_EXEC_PREFIX
115: #undef MD_EXEC_PREFIX
116: #endif
117: #define MD_EXEC_PREFIX "/usr/ccs/gcc/"
118:
119: #ifdef MD_STARTFILE_PREFIX
120: #undef MD_STARTFILE_PREFIX
121: #endif
122: #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
123:
124: /* Tell final.c we don't need a label passed to mcount. */
125: #define NO_PROFILE_DATA
126:
127: #undef FUNCTION_PROFILER
128: #define FUNCTION_PROFILER(FILE, LABELNO) fprintf (FILE, "\tcall _mcount\n")
129:
1.1.1.3 ! root 130: /* Some machines may desire to change what optimizations are
! 131: performed for various optimization levels. This macro, if
! 132: defined, is executed once just after the optimization level is
! 133: determined and before the remainder of the command options have
! 134: been parsed. Values set in this macro are used as the default
! 135: values for the other command line options.
! 136:
! 137: LEVEL is the optimization level specified; 2 if -O2 is
! 138: specified, 1 if -O is specified, and 0 if neither is specified. */
! 139:
! 140: #define OPTIMIZATION_OPTIONS(LEVEL) \
! 141: { \
! 142: flag_gnu_linker = FALSE; \
! 143: \
! 144: if (LEVEL) \
! 145: { \
! 146: flag_omit_frame_pointer = TRUE; \
! 147: flag_thread_jumps = TRUE; \
! 148: } \
! 149: \
! 150: if (LEVEL >= 2) \
! 151: { \
! 152: flag_strength_reduce = TRUE; \
! 153: flag_cse_follow_jumps = TRUE; \
! 154: flag_expensive_optimizations = TRUE; \
! 155: flag_rerun_cse_after_loop = TRUE; \
! 156: } \
! 157: \
! 158: if (LEVEL >= 3) \
! 159: { \
! 160: flag_inline_functions = TRUE; \
! 161: } \
! 162: }
! 163:
! 164: /* A C expression that is 1 if the RTX X is a constant which is a
! 165: valid address. On most machines, this can be defined as
! 166: `CONSTANT_P (X)', but a few machines are more restrictive in
! 167: which constant addresses are supported.
! 168:
! 169: `CONSTANT_P' accepts integer-values expressions whose values are
! 170: not explicitly known, such as `symbol_ref', `label_ref', and
! 171: `high' expressions and `const' arithmetic expressions, in
! 172: addition to `const_int' and `const_double' expressions. */
! 173:
! 174: #ifdef CONSTANT_ADDRESS_P
! 175: #undef CONSTANT_ADDRESS_P
! 176: #endif
! 177: #define CONSTANT_ADDRESS_P(X) \
! 178: (CONSTANT_P (X) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X)))
! 179:
! 180: /* Define this macro if references to a symbol must be treated
! 181: differently depending on something about the variable or
! 182: function named by the symbol (such as what section it is in).
! 183:
! 184: The macro definition, if any, is executed immediately after the
! 185: rtl for DECL has been created and stored in `DECL_RTL (DECL)'.
! 186: The value of the rtl will be a `mem' whose address is a
! 187: `symbol_ref'.
! 188:
! 189: The usual thing for this macro to do is to a flag in the
! 190: `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
! 191: name string in the `symbol_ref' (if one bit is not enough
! 192: information).
! 193:
! 194: The best way to modify the name string is by adding text to the
! 195: beginning, with suitable punctuation to prevent any ambiguity.
! 196: Allocate the new name in `saveable_obstack'. You will have to
! 197: modify `ASM_OUTPUT_LABELREF' to remove and decode the added text
! 198: and output the name accordingly.
! 199:
! 200: You can also check the information stored in the `symbol_ref' in
! 201: the definition of `GO_IF_LEGITIMATE_ADDRESS' or
! 202: `PRINT_OPERAND_ADDRESS'. */
! 203:
! 204: #ifdef ENCODE_SECTION_INFO
! 205: #undef ENCODE_SECTION_INFO
! 206: #endif
! 207: #define ENCODE_SECTION_INFO(DECL) \
! 208: do \
! 209: { \
! 210: if (HALF_PIC_P ()) \
! 211: HALF_PIC_ENCODE (DECL); \
! 212: } \
! 213: while (0)
! 214:
! 215:
! 216: /* A C statement (sans semicolon) to output to the stdio stream
! 217: STREAM any text necessary for declaring the name NAME of an
! 218: initialized variable which is being defined. This macro must
! 219: output the label definition (perhaps using `ASM_OUTPUT_LABEL').
! 220: The argument DECL is the `VAR_DECL' tree node representing the
! 221: variable.
! 222:
! 223: If this macro is not defined, then the variable name is defined
! 224: in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */
! 225:
! 226: #ifdef ASM_DECLARE_OBJECT_NAME
! 227: #undef ASM_DECLARE_OBJECT_NAME
! 228: #endif
! 229: #define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
! 230: do \
! 231: { \
! 232: ASM_OUTPUT_LABEL(STREAM,NAME); \
! 233: HALF_PIC_DECLARE (NAME); \
! 234: } \
! 235: while (0)
! 236:
! 237: /* This is how to declare a function name. */
! 238:
! 239: #define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \
! 240: do \
! 241: { \
! 242: ASM_OUTPUT_LABEL(STREAM,NAME); \
! 243: HALF_PIC_DECLARE (NAME); \
! 244: } \
! 245: while (0)
! 246:
1.1 root 247: /* Tell collect that the object format is OSF/rose. */
248: #define OBJECT_FORMAT_ROSE
249:
250: /* Use atexit for static constructors/destructors, instead of defining
251: our own exit function. */
252: #define HAVE_ATEXIT
253:
254: /* Define this macro meaning that gcc should find the library 'libgcc.a'
1.1.1.3 ! root 255: by hand, rather than passing the argument '-lgcc' to tell the linker
1.1 root 256: to do the search */
257: #define LINK_LIBGCC_SPECIAL
1.1.1.3 ! root 258:
! 259: /* A C statement to output assembler commands which will identify the object
! 260: file as having been compile with GNU CC. We don't need or want this for
! 261: OSF1. GDB doesn't need it and kdb doesn't like it */
! 262: #define ASM_IDENTIFY_GCC(FILE)
! 263:
! 264: /* This is how to output an assembler line defining a `double' constant.
! 265: Use "word" pseudos to avoid printing NaNs, infinity, etc. */
! 266:
! 267: /* This is how to output an assembler line defining a `double' constant. */
! 268:
! 269: #ifdef ASM_OUTPUT_DOUBLE
! 270: #undef ASM_OUTPUT_DOUBLE
! 271: #endif
! 272: #define ASM_OUTPUT_DOUBLE(STREAM,VALUE) \
! 273: { \
! 274: union { double d; long l[2]; } u2; \
! 275: u2.d = VALUE; \
! 276: fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.20g\n\t.long\t0x%08lx\n", \
! 277: u2.l[0], u2.d, u2.l[1]); \
! 278: }
! 279:
! 280: /* This is how to output an assembler line defining a `float' constant. */
! 281:
! 282: #ifdef ASM_OUTPUT_FLOAT
! 283: #undef ASM_OUTPUT_FLOAT
! 284: #endif
! 285: #define ASM_OUTPUT_FLOAT(STREAM,VALUE) \
! 286: { \
! 287: union { float f; long l; } u2; \
! 288: u2.f = VALUE; \
! 289: fprintf (STREAM, "\t.long\t0x%08lx\t\t# %.12g\n", u2.l, u2.f); \
! 290: }
! 291:
! 292: /* Generate calls to memcpy, etc., not bcopy, etc. */
! 293: #define TARGET_MEM_FUNCTIONS
! 294:
! 295:
1.1 root 296:
297: /* Defines to be able to build libgcc.a with GCC. */
298:
299: #define perform_udivsi3(a,b) \
300: { \
301: register int dx asm("dx"); \
302: register int ax asm("ax"); \
303: \
304: dx = 0; \
305: ax = a; \
306: asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
307: return ax; \
308: }
309:
1.1.1.2 root 310: #define perform_divsi3(a,b) \
1.1 root 311: { \
312: register int dx asm("dx"); \
313: register int ax asm("ax"); \
314: \
315: ax = a; \
316: asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
317: return ax; \
318: }
319:
320: #define perform_umodsi3(a,b) \
321: { \
322: register int dx asm("dx"); \
323: register int ax asm("ax"); \
324: \
325: dx = 0; \
326: ax = a; \
327: asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
328: return dx; \
329: }
330:
1.1.1.2 root 331: #define perform_modsi3(a,b) \
1.1 root 332: { \
333: register int dx asm("dx"); \
334: register int ax asm("ax"); \
335: \
336: ax = a; \
337: asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
338: return dx; \
339: }
340:
1.1.1.2 root 341: #define perform_fixdfsi(a) \
1.1 root 342: { \
343: auto unsigned short ostatus; \
344: auto unsigned short nstatus; \
345: auto int ret; \
346: \
347: &ostatus; /* guarantee these land in memory */ \
348: &nstatus; \
349: &ret; \
350: \
351: asm volatile ("fnstcw %0" : "=m" (ostatus)); \
352: nstatus = ostatus | 0x0c00; \
353: asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
354: asm volatile ("fldl %0" : /* no outputs */ : "m" (a)); \
355: asm volatile ("fistpl %0" : "=m" (ret)); \
1.1.1.2 root 356: asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \
1.1 root 357: \
358: return ret; \
359: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.