Initial revision
[official-gcc.git] / gcc / config / m68k / sun2o4.h
blob6f1ae7a7a6cb54931f4f545206b46a1995ac5cda
1 /* Definitions of target machine for GNU compiler. Sun 2 running Sunos 4.
2 Copyright (C) 1987, 1988, 1993, 1996 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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 2, or (at your option)
9 any later version.
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.
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, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 #include "m68k/sun2.h"
24 /* Define __HAVE_SKY__ in preprocessor, according to the -m flags.
25 Also inform the program which CPU this is for. */
27 #undef CPP_SPEC
29 #undef PTRDIFF_TYPE
30 #define PTRDIFF_TYPE "int"
31 #undef SIZE_TYPE
32 #define SIZE_TYPE "int"
33 #undef WCHAR_TYPE
34 #define WCHAR_TYPE "short unsigned int"
35 #undef WCHAR_TYPE_SIZE
36 #define WCHAR_TYPE_SIZE 16
38 #if TARGET_DEFAULT & MASK_SKY
40 /* -msky is the default */
41 #define CPP_SPEC \
42 "%{!msoft-float:-D__HAVE_SKY__}\
43 %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
45 #else
47 /* -msoft-float is the default */
48 #define CPP_SPEC \
49 "%{msky:-D__HAVE_SKY__ }\
50 %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
52 #endif
54 /* STARTFILE_SPEC to include sun floating point initialization
55 This is necessary (tr: Sun does it) for the sky routines.
56 I'm not sure what would happen below if people gave contradictory
57 arguments (eg. -msoft-float -mfpa) */
59 #undef STARTFILE_SPEC
61 #if TARGET_DEFAULT & MASK_SKY
62 /* -msky is the default */
63 #define STARTFILE_SPEC \
64 "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
65 %{msoft-float:Fcrt1.o%s} \
66 %{!msoft-float:Scrt1.o%s}"
67 #else
68 /* -msoft-float is the default */
69 #define STARTFILE_SPEC \
70 "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}} \
71 %{msky:Scrt1.o%s} \
72 %{!msky:Fcrt1.o%s}"
73 #endif
75 /* Specify library to handle `-a' basic block profiling.
76 Control choice of libm.a (if user says -lm)
77 based on fp arith default and options. */
79 #undef LIB_SPEC
81 #if TARGET_DEFAULT & MASK_SKY
82 /* -msky is the default */
83 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
84 %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
85 %{msoft-float:-L/usr/lib/fsoft} \
86 %{!msoft_float:-L/usr/lib/fsky}"
87 #else
88 /* -msoft-float is the default */
89 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \
90 %{a:/usr/lib/bb_link.o -lc} %{g:-lg} \
91 %{!msky:-L/usr/lib/fsoft} \
92 %{msky:-L/usr/lib/ffpa}"
93 #endif
95 #undef LINK_SPEC
96 #define LINK_SPEC \
97 "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic}"
99 #undef ASM_OUTPUT_DOUBLE
100 #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
101 do { if (REAL_VALUE_ISINF (VALUE)) \
103 if (REAL_VALUE_NEGATIVE (VALUE)) \
104 fprintf (FILE, "\t.double 0r-99e999\n"); \
105 else \
106 fprintf (FILE, "\t.double 0r99e999\n"); \
108 else if (REAL_VALUE_MINUS_ZERO (VALUE)) \
110 fprintf (FILE, "\t.long 0x80000000,0\n"); \
112 else \
113 { char dstr[30]; \
114 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr); \
115 fprintf (FILE, "\t.double 0r%s\n", dstr); \
117 } while (0)
119 /* This is how to output an assembler line defining a `float' constant. */
121 #undef ASM_OUTPUT_FLOAT
122 #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
123 do { if (REAL_VALUE_ISINF (VALUE)) \
125 if (REAL_VALUE_NEGATIVE (VALUE)) \
126 fprintf (FILE, "\t.single 0r-99e999\n"); \
127 else \
128 fprintf (FILE, "\t.single 0r99e999\n"); \
130 else if (REAL_VALUE_MINUS_ZERO (VALUE)) \
132 fprintf (FILE, "\t.long 0x80000000\n"); \
134 else \
135 { char dstr[30]; \
136 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", dstr); \
137 fprintf (FILE, "\t.single 0r%s\n", dstr); \
139 } while (0)
141 #undef ASM_OUTPUT_FLOAT_OPERAND
142 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \
143 do { \
144 if (CODE != 'f') \
146 long l; \
147 REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
148 if (sizeof (int) == sizeof (long)) \
149 asm_fprintf ((FILE), "%I0x%x", l); \
150 else \
151 asm_fprintf ((FILE), "%I0x%lx", l); \
153 else if (REAL_VALUE_ISINF (VALUE)) \
155 if (REAL_VALUE_NEGATIVE (VALUE)) \
156 fprintf (FILE, "#0r-99e999"); \
157 else \
158 fprintf (FILE, "#0r99e999"); \
160 else if (REAL_VALUE_MINUS_ZERO (VALUE)) \
162 fprintf (FILE, "#0r-0.0"); \
164 else \
165 { char dstr[30]; \
166 REAL_VALUE_TO_DECIMAL ((VALUE), "%.9g", dstr); \
167 fprintf (FILE, "#0r%s", dstr); \
169 } while (0)
171 #undef ASM_OUTPUT_DOUBLE_OPERAND
172 #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
173 do { if (REAL_VALUE_ISINF (VALUE)) \
175 if (REAL_VALUE_NEGATIVE (VALUE)) \
176 fprintf (FILE, "#0r-99e999"); \
177 else \
178 fprintf (FILE, "#0r99e999"); \
180 else if (REAL_VALUE_MINUS_ZERO (VALUE)) \
182 fprintf (FILE, "#0r-0.0"); \
184 else \
185 { char dstr[30]; \
186 REAL_VALUE_TO_DECIMAL ((VALUE), "%.20g", dstr); \
187 fprintf (FILE, "#0r%s", dstr); \
189 } while (0)