|
|
1.1 root 1: /* Definitions of target machine for GNU compiler. Sun 68000/68020 version.
2: Copyright (C) 1987, 1988 Free Software Foundation, Inc.
3:
4: This file is part of GNU CC.
5:
6: GNU CC is free software; you can redistribute it and/or modify
7: it under the terms of the GNU General Public License as published by
8: the Free Software Foundation; either version 1, or (at your option)
9: any later version.
10:
11: GNU CC is distributed in the hope that it will be useful,
12: but WITHOUT ANY WARRANTY; without even the implied warranty of
13: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: GNU General Public License for more details.
15:
16: You should have received a copy of the GNU General Public License
17: along with GNU CC; see the file COPYING. If not, write to
18: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19:
20: /* This comment is here to see if it will keep Sun's cpp from dying. */
21:
22: #include "tm-m68k.h"
23:
24: /* See tm-m68k.h. 7 means 68020 with 68881. */
25:
26: #ifndef TARGET_DEFAULT
27: #define TARGET_DEFAULT 7
28: #endif
29:
30: /* Define __HAVE_FPA__ or __HAVE_68881__ in preprocessor,
31: according to the -m flags.
32: This will control the use of inline 68881 insns in certain macros.
33: Also inform the program which CPU this is for. */
34:
35: #if TARGET_DEFAULT & 02
36:
37: /* -m68881 is the default */
38: #define CPP_SPEC \
39: "%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}\
40: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
41:
42: #else
43: #if TARGET_DEFAULT & 0100
44:
45: /* -mfpa is the default */
46: #define CPP_SPEC \
47: "%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}\
48: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
49:
50: #else
51:
52: /* -msoft-float is the default */
53: #define CPP_SPEC \
54: "%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
55: %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
56:
57: #endif
58: #endif
59:
1.1.1.3 root 60: /* Prevent error on `-sun3' and `-target sun3' options. */
1.1 root 61:
1.1.1.3 root 62: #define CC1_SPEC "%{sun3:} %{target:}"
63:
64: /* These compiler options take an argument. We ignore -target for now. */
65:
1.1.1.4 ! root 66: #define WORD_SWITCH_TAKES_ARG(STR) \
! 67: (!strcmp (STR, "target") || !strcmp (STR, "Tdata"))
1.1 root 68:
69: /* -m68000 requires special flags to the assembler. */
70:
71: #define ASM_SPEC \
72: "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}}"
73:
74: /* Names to predefine in the preprocessor for this target machine. */
75:
76: #define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix"
77:
78: /* STARTFILE_SPEC to include sun floating point initialization
79: This is necessary (tr: Sun does it) for both the m68881 and the fpa
80: routines.
81: Note that includes knowledge of the default specs for gcc, ie. no
82: args translates to the same effect as -m68881
83: I'm not sure what would happen below if people gave contradictory
84: arguments (eg. -msoft-float -mfpa) */
85:
86: #if TARGET_DEFAULT & 0100
87: /* -mfpa is the default */
88: #define STARTFILE_SPEC \
89: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
90: %{m68881:Mcrt1.o%s} \
91: %{msoft-float:Fcrt1.o%s} \
92: %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
93: #else
94: #if TARGET_DEFAULT & 2
95: /* -m68881 is the default */
96: #define STARTFILE_SPEC \
97: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
98: %{mfpa:Wcrt1.o%s} \
99: %{msoft-float:Fcrt1.o%s} \
100: %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
101: #else
102: /* -msoft-float is the default */
103: #define STARTFILE_SPEC \
104: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
105: %{m68881:Mcrt1.o%s} \
106: %{mfpa:Wcrt1.o%s} \
107: %{!m68881:%{!mfpa:Fcrt1.o%s}}"
108: #endif
109: #endif
110:
111: /* Specify library to handle `-a' basic block profiling. */
112:
1.1.1.2 root 113: /* Specify library to handle `-a' basic block profiling.
114: Control choice of libm.a (if user says -lm)
115: based on fp arith default and options. */
116:
117: #if TARGET_DEFAULT & 0100
118: /* -mfpa is the default */
119: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 root 120: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 121: %{msoft-float:-L/usr/lib/fsoft}%{m68881:-L/usr/lib/f68881}\
122: %{!msoft_float:%{!m68881:-L/usr/lib/ffpa}}"
123: #else
124: #if TARGET_DEFAULT & 2
125: /* -m68881 is the default */
126: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 root 127: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 128: %{msoft-float:-L/usr/lib/fsoft}%{!msoft-float:%{!mfpa:-L/usr/lib/f68881}}\
129: %{mfpa:-L/usr/lib/ffpa}"
130: #else
131: /* -msoft-float is the default */
1.1 root 132: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 root 133: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 134: %{!m68881:%{!mfpa:-L/usr/lib/fsoft}}%{m68881:-L/usr/lib/f68881}\
135: %{mfpa:-L/usr/lib/ffpa}"
136: #endif
137: #endif
1.1 root 138:
139: /* Provide required defaults for linker -e and -d switches.
140: Also, it is hard to debug with shared libraries,
141: so don't use them if going to debug. */
142:
1.1.1.4 ! root 143: #define LINK_SPEC "%{!e*:-e start} -dc -dp %{static:-Bstatic} %{-Bstatic}"
1.1 root 144:
145: /* Every structure or union's size must be a multiple of 2 bytes. */
146:
147: #define STRUCTURE_SIZE_BOUNDARY 16
148:
149: /* This is BSD, so it wants DBX format. */
150:
151: #define DBX_DEBUGGING_INFO
152:
153: /* This is how to output an assembler line defining a `double' constant. */
154:
155: #undef ASM_OUTPUT_DOUBLE
156: #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
157: (isinf ((VALUE)) \
158: ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
1.1.1.3 root 159: : double_is_minus_zero ((VALUE)) \
160: ? fprintf (FILE, "\t.long 0x80000000,0\n") \
1.1 root 161: : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
162:
163: /* This is how to output an assembler line defining a `float' constant. */
164:
165: #undef ASM_OUTPUT_FLOAT
166: #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
167: (isinf ((VALUE)) \
168: ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
1.1.1.3 root 169: : double_is_minus_zero ((VALUE)) \
170: ? fprintf (FILE, "\t.long 0x80000000\n") \
1.1 root 171: : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
172:
173: #undef ASM_OUTPUT_FLOAT_OPERAND
174: #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
175: (isinf ((VALUE)) \
1.1.1.3 root 176: ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
177: : double_is_minus_zero ((VALUE)) \
178: ? fprintf (FILE, "#0r-0.0") \
1.1 root 179: : fprintf (FILE, "#0r%.9g", (VALUE)))
180:
181: #undef ASM_OUTPUT_DOUBLE_OPERAND
182: #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
183: (isinf ((VALUE)) \
1.1.1.3 root 184: ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
185: : double_is_minus_zero ((VALUE)) \
186: ? fprintf (FILE, "#0r-0.0") \
1.1 root 187: : fprintf (FILE, "#0r%.20g", (VALUE)))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.