]> gcc.gnu.org Git - gcc.git/blame - gcc/config/m68k/sun3.h
*** empty log message ***
[gcc.git] / gcc / config / m68k / sun3.h
CommitLineData
1bb87f28
JW
1/* Definitions of target machine for GNU compiler. Sun 68000/68020 version.
2 Copyright (C) 1987, 1988 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING. If not, write to
18the 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/* If you do not need to generate floating point code for the optional
23 Sun FPA board, you can safely comment out the SUPPORT_SUN_FPA define
24 to gain a little speed and code size. */
25
26#define SUPPORT_SUN_FPA
27
28#include "m68k.h"
29
30/* See m68k.h. 7 means 68020 with 68881. */
31
32#ifndef TARGET_DEFAULT
33#define TARGET_DEFAULT 7
34#endif
35
36/* Define __HAVE_FPA__ or __HAVE_68881__ in preprocessor,
37 according to the -m flags.
38 This will control the use of inline 68881 insns in certain macros.
39 Also inform the program which CPU this is for. */
40
41#if TARGET_DEFAULT & 02
42
43/* -m68881 is the default */
44#define CPP_SPEC \
45"%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}\
5089e22e 46%{m68000:-D__mc68010__}%{mc68000:-D__mc68010__}%{!mc68000:%{!m68000:-D__mc68020__}} \
1bb87f28
JW
47%{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
48
49#else
50
51/* -msoft-float is the default */
52#define CPP_SPEC \
53"%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }\
5089e22e 54%{m68000:-D__mc68010__}%{mc68000:-D__mc68010__}%{!mc68000:%{!m68000:-D__mc68020__}} \
1bb87f28
JW
55%{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
56
1bb87f28
JW
57#endif
58
59/* Prevent error on `-sun3' and `-target sun3' options. */
60
61#define CC1_SPEC "%{sun3:} %{target:}"
62
63#define PTRDIFF_TYPE "int"
64#define SIZE_TYPE "int"
65
66/* We must override m68k.h. */
67#undef WCHAR_TYPE
68#undef WCHAR_TYPE_SIZE
69#define WCHAR_TYPE "short unsigned int"
70#define WCHAR_TYPE_SIZE 16
71
72/* These compiler options take an argument. We ignore -target for now. */
73
74#define WORD_SWITCH_TAKES_ARG(STR) \
75 (!strcmp (STR, "Tdata") || !strcmp (STR, "include") \
76 || !strcmp (STR, "imacros") || !strcmp (STR, "target") \
b3865ca9 77 || !strcmp (STR, "assert") || !strcmp (STR, "aux-info"))
1bb87f28
JW
78
79/* -m68000 requires special flags to the assembler. */
80
81#define ASM_SPEC \
82 "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}} \
83 %{fpic:-k} %{fPIC:-k}"
84
85/* Names to predefine in the preprocessor for this target machine. */
86
87#define CPP_PREDEFINES "-Dmc68000 -Dsun -Dunix"
88
89/* STARTFILE_SPEC to include sun floating point initialization
90 This is necessary (tr: Sun does it) for both the m68881 and the fpa
91 routines.
92 Note that includes knowledge of the default specs for gcc, ie. no
93 args translates to the same effect as -m68881
94 I'm not sure what would happen below if people gave contradictory
95 arguments (eg. -msoft-float -mfpa) */
96
97#if TARGET_DEFAULT & 0100
98/* -mfpa is the default */
99#define STARTFILE_SPEC \
100 "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
101 %{m68881:Mcrt1.o%s} \
102 %{msoft-float:Fcrt1.o%s} \
103 %{!m68881:%{!msoft-float:Wcrt1.o%s}}"
104#else
105#if TARGET_DEFAULT & 2
106/* -m68881 is the default */
107#define STARTFILE_SPEC \
108 "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
109 %{mfpa:Wcrt1.o%s} \
110 %{msoft-float:Fcrt1.o%s} \
111 %{!mfpa:%{!msoft-float:Mcrt1.o%s}}"
112#else
113/* -msoft-float is the default */
114#define STARTFILE_SPEC \
115 "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
116 %{m68881:Mcrt1.o%s} \
117 %{mfpa:Wcrt1.o%s} \
118 %{!m68881:%{!mfpa:Fcrt1.o%s}}"
119#endif
120#endif
121
122/* Specify library to handle `-a' basic block profiling.
123 Control choice of libm.a (if user says -lm)
124 based on fp arith default and options. */
125
126#if TARGET_DEFAULT & 0100
127/* -mfpa is the default */
128#define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
129%{a:/usr/lib/bb_link.o} %{g:-lg} \
130%{msoft-float:-L/usr/lib/fsoft}%{m68881:-L/usr/lib/f68881}\
131%{!msoft_float:%{!m68881:-L/usr/lib/ffpa}}"
132#else
133#if TARGET_DEFAULT & 2
134/* -m68881 is the default */
135#define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
136%{a:/usr/lib/bb_link.o} %{g:-lg} \
137%{msoft-float:-L/usr/lib/fsoft}%{!msoft-float:%{!mfpa:-L/usr/lib/f68881}}\
138%{mfpa:-L/usr/lib/ffpa}"
139#else
140/* -msoft-float is the default */
141#define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
142%{a:/usr/lib/bb_link.o} %{g:-lg} \
143%{!m68881:%{!mfpa:-L/usr/lib/fsoft}}%{m68881:-L/usr/lib/f68881}\
144%{mfpa:-L/usr/lib/ffpa}"
145#endif
146#endif
147
98ccf8fe 148/* Provide required defaults for linker -e and -d switches. */
1bb87f28 149
d6f04508
RS
150#define LINK_SPEC \
151 "%{nostdlib:%{!e*:-e start}} -dc -dp %{static:-Bstatic} %{assert*}"
1bb87f28
JW
152
153/* Every structure or union's size must be a multiple of 2 bytes. */
154
155#define STRUCTURE_SIZE_BOUNDARY 16
156
157/* This is BSD, so it wants DBX format. */
158
159#define DBX_DEBUGGING_INFO
160
161/* Allow folding division by zero. */
162#define REAL_INFINITY
163
b3865ca9
RS
164/* Generate calls to memcpy, memcmp and memset. */
165#define TARGET_MEM_FUNCTIONS
166
1bb87f28
JW
167/* This is how to output an assembler line defining a `double' constant. */
168
169#undef ASM_OUTPUT_DOUBLE
170#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
171 { \
172 if (REAL_VALUE_ISINF (VALUE)) \
173 fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \
b3865ca9 174 else if (REAL_VALUE_ISNAN (VALUE)) \
1bb87f28
JW
175 { \
176 union { double d; long l[2];} t; \
177 t.d = (VALUE); \
178 fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \
179 } \
180 else \
181 fprintf (FILE, "\t.double 0r%.17g\n", VALUE); \
182 }
183
184/* This is how to output an assembler line defining a `float' constant. */
185
186#undef ASM_OUTPUT_FLOAT
187#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
188 { \
189 if (REAL_VALUE_ISINF (VALUE)) \
190 fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-"); \
b3865ca9 191 else if (REAL_VALUE_ISNAN (VALUE)) \
1bb87f28
JW
192 { \
193 union { float f; long l;} t; \
194 t.f = (VALUE); \
195 fprintf (FILE, "\t.long 0x%lx\n", t.l); \
196 } \
197 else \
198 fprintf (FILE, "\t.single 0r%.9g\n", VALUE); \
199 }
200
201/* This is how to output an assembler lines defining floating operands.
202 There's no way to output a NaN's fraction, so we lose it. */
203
204#undef ASM_OUTPUT_FLOAT_OPERAND
205#define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE) \
206 (REAL_VALUE_ISINF ((VALUE)) \
207 ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \
208 : (VALUE) == -0.0 \
209 ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \
210 : (asm_fprintf (FILE, "%I0r%.9g", (VALUE)), 0))
211
212#undef ASM_OUTPUT_DOUBLE_OPERAND
213#define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
214 (REAL_VALUE_ISINF ((VALUE)) \
215 ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \
216 : (VALUE) == -0.0 \
217 ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \
218 : (asm_fprintf (FILE, "%I0r%.17g", (VALUE)), 0))
This page took 0.107481 seconds and 5 git commands to generate.