xref: /openbsd/gnu/usr.bin/gcc/gcc/config/m68k/sun2o4.h (revision 771fbea0)
1 /* Definitions of target machine for GNU compiler.  Sun 2 running SunOS 4.
2    Copyright (C) 1987, 1988, 1993, 1996, 1997 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 2, 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, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20 
21 #include "m68k/sun2.h"
22 
23 
24 /* Define __HAVE_SKY__ in preprocessor, according to the -m flags.
25    Also inform the program which CPU this is for.  */
26 
27 #undef CPP_SPEC
28 
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
37 
38 #if TARGET_DEFAULT & MASK_SKY
39 
40 /* -msky is the default */
41 #define CPP_SPEC \
42 "%{!msoft-float:-D__HAVE_SKY__}\
43 %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
44 
45 #else
46 
47 /* -msoft-float is the default */
48 #define CPP_SPEC \
49 "%{msky:-D__HAVE_SKY__ }\
50 %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
51 
52 #endif
53 
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) */
58 
59 #undef STARTFILE_SPEC
60 
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
74 
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.  */
78 
79 #undef LIB_SPEC
80 
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
94 
95 #undef LINK_SPEC
96 #define LINK_SPEC \
97   "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic}"
98 
99 #undef ASM_OUTPUT_FLOAT_OPERAND
100 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE)		\
101  do { 								\
102       if (CODE != 'f')						\
103         {							\
104           long l;						\
105           REAL_VALUE_TO_TARGET_SINGLE (VALUE, l);		\
106           if (sizeof (int) == sizeof (long))			\
107             asm_fprintf ((FILE), "%I0x%x", (int) l);		\
108           else							\
109             asm_fprintf ((FILE), "%I0x%lx", l);			\
110         }							\
111       else if (REAL_VALUE_ISINF (VALUE))			\
112         {							\
113           if (REAL_VALUE_NEGATIVE (VALUE))			\
114             fprintf (FILE, "#0r-99e999");			\
115           else							\
116             fprintf (FILE, "#0r99e999");			\
117         }							\
118       else if (REAL_VALUE_MINUS_ZERO (VALUE))			\
119         {							\
120           fprintf (FILE, "#0r-0.0");				\
121         }							\
122       else							\
123         { char dstr[30];					\
124 	  real_to_decimal (dstr, &(VALUE), sizeof (dstr), 9, 0); \
125           fprintf (FILE, "#0r%s", dstr);			\
126         }							\
127     } while (0)
128 
129 #undef ASM_OUTPUT_DOUBLE_OPERAND
130 #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)				\
131  do { if (REAL_VALUE_ISINF (VALUE))					\
132         {								\
133           if (REAL_VALUE_NEGATIVE (VALUE))				\
134             fprintf (FILE, "#0r-99e999");				\
135           else								\
136             fprintf (FILE, "#0r99e999");				\
137         }								\
138       else if (REAL_VALUE_MINUS_ZERO (VALUE))				\
139         {								\
140           fprintf (FILE, "#0r-0.0");					\
141         }								\
142       else								\
143         { char dstr[30];						\
144 	  real_to_decimal (dstr, &(VALUE), sizeof (dstr), 0, 1);	\
145           fprintf (FILE, "#0r%s", dstr);				\
146         }								\
147     } while (0)
148