|
|
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:
! 66: #define WORD_SWITCH_TAKES_ARG(STR) (!strcmp (STR, "target"))
1.1 root 67:
68: /* -m68000 requires special flags to the assembler. */
69:
70: #define ASM_SPEC \
71: "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}}"
72:
73: /* Names to predefine in the preprocessor for this target machine. */
74:
75: #define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix"
76:
77: /* STARTFILE_SPEC to include sun floating point initialization
78: This is necessary (tr: Sun does it) for both the m68881 and the fpa
79: routines.
80: Note that includes knowledge of the default specs for gcc, ie. no
81: args translates to the same effect as -m68881
82: I'm not sure what would happen below if people gave contradictory
83: arguments (eg. -msoft-float -mfpa) */
84:
85: #if TARGET_DEFAULT & 0100
86: /* -mfpa is the default */
87: #define STARTFILE_SPEC \
88: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
89: %{m68881:Mcrt1.o%s} \
90: %{msoft-float:Fcrt1.o%s} \
91: %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
92: #else
93: #if TARGET_DEFAULT & 2
94: /* -m68881 is the default */
95: #define STARTFILE_SPEC \
96: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
97: %{mfpa:Wcrt1.o%s} \
98: %{msoft-float:Fcrt1.o%s} \
99: %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
100: #else
101: /* -msoft-float is the default */
102: #define STARTFILE_SPEC \
103: "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
104: %{m68881:Mcrt1.o%s} \
105: %{mfpa:Wcrt1.o%s} \
106: %{!m68881:%{!mfpa:Fcrt1.o%s}}"
107: #endif
108: #endif
109:
110: /* Specify library to handle `-a' basic block profiling. */
111:
1.1.1.2 root 112: /* Specify library to handle `-a' basic block profiling.
113: Control choice of libm.a (if user says -lm)
114: based on fp arith default and options. */
115:
116: #if TARGET_DEFAULT & 0100
117: /* -mfpa is the default */
118: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 ! root 119: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 120: %{msoft-float:-L/usr/lib/fsoft}%{m68881:-L/usr/lib/f68881}\
121: %{!msoft_float:%{!m68881:-L/usr/lib/ffpa}}"
122: #else
123: #if TARGET_DEFAULT & 2
124: /* -m68881 is the default */
125: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 ! root 126: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 127: %{msoft-float:-L/usr/lib/fsoft}%{!msoft-float:%{!mfpa:-L/usr/lib/f68881}}\
128: %{mfpa:-L/usr/lib/ffpa}"
129: #else
130: /* -msoft-float is the default */
1.1 root 131: #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
1.1.1.3 ! root 132: %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
1.1.1.2 root 133: %{!m68881:%{!mfpa:-L/usr/lib/fsoft}}%{m68881:-L/usr/lib/f68881}\
134: %{mfpa:-L/usr/lib/ffpa}"
135: #endif
136: #endif
1.1 root 137:
138: /* Provide required defaults for linker -e and -d switches.
139: Also, it is hard to debug with shared libraries,
140: so don't use them if going to debug. */
141:
142: #define LINK_SPEC "%{!e*:-e start} -dc -dp %{g:-Bstatic} %{static:-Bstatic} %{-Bstatic}"
143:
144: /* Every structure or union's size must be a multiple of 2 bytes. */
145:
146: #define STRUCTURE_SIZE_BOUNDARY 16
147:
148: /* This is BSD, so it wants DBX format. */
149:
150: #define DBX_DEBUGGING_INFO
151:
152: /* This is how to output an assembler line defining a `double' constant. */
153:
154: #undef ASM_OUTPUT_DOUBLE
155: #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
156: (isinf ((VALUE)) \
157: ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
1.1.1.3 ! root 158: : double_is_minus_zero ((VALUE)) \
! 159: ? fprintf (FILE, "\t.long 0x80000000,0\n") \
1.1 root 160: : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
161:
162: /* This is how to output an assembler line defining a `float' constant. */
163:
164: #undef ASM_OUTPUT_FLOAT
165: #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
166: (isinf ((VALUE)) \
167: ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
1.1.1.3 ! root 168: : double_is_minus_zero ((VALUE)) \
! 169: ? fprintf (FILE, "\t.long 0x80000000\n") \
1.1 root 170: : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
171:
172: #undef ASM_OUTPUT_FLOAT_OPERAND
173: #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
174: (isinf ((VALUE)) \
1.1.1.3 ! root 175: ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
! 176: : double_is_minus_zero ((VALUE)) \
! 177: ? fprintf (FILE, "#0r-0.0") \
1.1 root 178: : fprintf (FILE, "#0r%.9g", (VALUE)))
179:
180: #undef ASM_OUTPUT_DOUBLE_OPERAND
181: #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
182: (isinf ((VALUE)) \
1.1.1.3 ! root 183: ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
! 184: : double_is_minus_zero ((VALUE)) \
! 185: ? fprintf (FILE, "#0r-0.0") \
1.1 root 186: : fprintf (FILE, "#0r%.20g", (VALUE)))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.