]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/m68k/m68k-none.h
coff.h: Remove support for Sun FPA and Sun SKY board.
[thirdparty/gcc.git] / gcc / config / m68k / m68k-none.h
1 /* Definitions of target machine for GNU compiler. "naked" 68020.
2 Copyright (C) 1994, 1996, 2003 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/m68k.h"
22
23 /* Default to m68k (m68020). */
24 #ifndef TARGET_CPU_DEFAULT
25 #define TARGET_CPU_DEFAULT M68K_CPU_m68k
26 #endif
27
28 /* These are values set by the configure script in TARGET_CPU_DEFAULT.
29 They are ((desired value for TARGET_DEFAULT) << 4) + sequential integer.
30 See m68k.h for the values (it should really define MASK_FOO so we can
31 use them). */
32 #define M68K_CPU_m68k ((7 << 4) + 0)
33 #define M68K_CPU_m68000 ((0 << 4) + 1)
34 #define M68K_CPU_m68010 ((0 << 4) + 1) /* make same as m68000 */
35 #define M68K_CPU_m68020 ((7 << 4) + 2)
36 #define M68K_CPU_m68030 ((7 << 4) + 3)
37 #define M68K_CPU_m68040 ((01007 << 4) + 4)
38 #define M68K_CPU_m68302 ((0 << 4) + 5)
39 #define M68K_CPU_m68332 ((1 << 4) + 6)
40
41 /* This is tested for below, so if target wants to override this, it
42 just set this first in cover file. */
43 #ifndef TARGET_DEFAULT
44 #define TARGET_DEFAULT (TARGET_CPU_DEFAULT >> 4)
45 #endif
46 \f
47 /* Defaults for the various specs below.
48 These are collected here so we only test TARGET_CPU_DEFAULT once. */
49 /* ??? CC1_CPU_DEFAULT_SPEC was copied over from the earlier version of
50 this file. However, it's not used anywhere here because it doesn't
51 seem to be necessary. */
52 #if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
53 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68020 } -D__mc68020 -D__mc68020__"
54 #define ASM_CPU_DEFAULT_SPEC "-mc68020"
55 #define CC1_CPU_DEFAULT_SPEC "-m68020"
56 #else
57 #if TARGET_CPU_DEFAULT == M68K_CPU_m68000
58 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68000 } -D__mc68000 -D__mc68000__"
59 #define ASM_CPU_DEFAULT_SPEC "-mc68000"
60 #define CC1_CPU_DEFAULT_SPEC "-m68000"
61 #else
62 #if TARGET_CPU_DEFAULT == M68K_CPU_m68030
63 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68030 } -D__mc68030 -D__mc68030__"
64 #define ASM_CPU_DEFAULT_SPEC "-mc68030"
65 #define CC1_CPU_DEFAULT_SPEC "-m68030"
66 #else
67 #if TARGET_CPU_DEFAULT == M68K_CPU_m68040
68 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68040 } -D__mc68040 -D__mc68040__"
69 #define ASM_CPU_DEFAULT_SPEC "-mc68040"
70 #define CC1_CPU_DEFAULT_SPEC "-m68040"
71 #else
72 #if TARGET_CPU_DEFAULT == M68K_CPU_m68302
73 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68302 } -D__mc68302 -D__mc68302__"
74 #define ASM_CPU_DEFAULT_SPEC "-mc68302"
75 #define CC1_CPU_DEFAULT_SPEC "-m68302"
76 #else
77 #if TARGET_CPU_DEFAULT == M68K_CPU_m68332
78 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68332 -Dmcpu32 } -D__mc68332 -D__mc68332__ -D__mcpu32 -D__mcpu32__"
79 #define ASM_CPU_DEFAULT_SPEC "-mc68332"
80 #define CC1_CPU_DEFAULT_SPEC "-m68332"
81 #else
82 Unrecognized value in TARGET_CPU_DEFAULT.
83 #endif
84 #endif
85 #endif
86 #endif
87 #endif
88 #endif
89 \f
90 /* Always define mc68000.
91 Remember that GCC will automatically add __mc68000 and __mc68000__. */
92 #undef CPP_PREDEFINES
93 #define CPP_PREDEFINES "-Dmc68000"
94
95 /* Define __HAVE_68881__ or nothing (soft float), appropriately. */
96 #undef CPP_FPU_SPEC
97 #if TARGET_DEFAULT & MASK_68881
98 #define CPP_FPU_SPEC "\
99 %{!mc68000:%{!m68000:%{!m68302:%{!mcpu32:%{!m68332:%{!m5200:%{!msoft-float:%{!mno-68881:-D__HAVE_68881__ }}}}}}}} \
100 %{m68881:-D__HAVE_68881__ }"
101 #else
102 #define CPP_FPU_SPEC "\
103 %{m68881:-D__HAVE_68881__ }"
104 #endif
105
106 /* Names to predefine in the preprocessor for this target machine.
107 Other definitions depend on what the default cpu is and switches
108 given to the compiler:
109
110 -m68000, -mc68000: define nothing else
111 -m68010: define mc68010
112 -m68020, -mc68020: define mc68020
113 -m68030: define mc68030
114 -m68040: define mc68040
115 -m68060: define mc68060
116 -m68020-40: define mc68020 mc68030 mc68040
117 -m68020-60: define mc68020 mc68030 mc68040 mc68060
118 -m68302: define mc68302
119 -m68332: define mc68332 mcpu32
120 -mcpu32: define mcpu32
121 -m5200: define mcf5200
122 default: define as above appropriately
123
124 GCC won't automatically add __'d versions, we have to mention them
125 explicitly. */
126
127 #undef CPP_SPEC
128 #define CPP_SPEC "\
129 %(cpp_fpu)%{!ansi:%{m68302:-Dmc68302 }%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68020-60:-Dmc68020 -Dmc68030 -Dmc68040 -Dmc68060 }%{m68060:-Dmc68060 }%{mcpu32:-Dmcpu32 } %{m68332:-Dmc68332 -Dmcpu32 }%{m5200:-Dmcf5200 }} \
130 %{m68302:-D__mc68302__ -D__mc68302 }%{m68010:-D__mc68010__ -D__mc68010 }%{m68020:-D__mc68020__ -D__mc68020 }%{mc68020:-D__mc68020__ -D__mc68020 }%{m68030:-D__mc68030__ -D__mc68030 }%{m68040:-D__mc68040__ -D__mc68040 }%{m68020-40:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 }%{m68020-60:-D__mc68020__ -D__mc68030__ -D__mc68040__ -D__mc68020 -D__mc68030 -D__mc68040 -D__mc68060__ -D__mc68060 }%{m68060:-D__mc68060__ -D__mc68060 }%{mcpu32:-D__mcpu32__ -D__mcpu32 }%{m68332:-D__mc68332__ -D__mc68332 -D__mcpu32__ -D__mcpu32 }%{m5200:-D__mcf5200__ -D__mcf5200 } \
131 %{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32: %{!m68332:%{!m5200:%(cpp_cpu_default)}}}}}}}}}}}}}} \
132 %(cpp_subtarget) \
133 "
134
135 /* Pass flags to gas indicating which type of processor we have. */
136
137 #undef ASM_SPEC
138 #define ASM_SPEC "\
139 %{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881} %{m68000}%{m68302}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040} %{m68020-60:-mc68040} %{m68060}%{mcpu32}%{m68332}%{m5200}%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:%{!m68332:%{!m5200:%(asm_cpu_default)}}}}}}}}}}}}}} \
140 "
141
142 /* cc1/cc1plus always receives all the -m flags. If the specs strings above
143 are consistent with the TARGET_OPTIONS flags in m68k.h, there should be no
144 need for any further cc1/cc1plus specs. */
145
146 #undef CC1_SPEC
147 #define CC1_SPEC ""
148
149 /* This macro defines names of additional specifications to put in the specs
150 that can be used in various specifications like CC1_SPEC. Its definition
151 is an initializer with a subgrouping for each command option.
152
153 Each subgrouping contains a string constant, that defines the
154 specification name, and a string constant that used by the GNU CC driver
155 program.
156
157 Do not define this macro if it does not need to do anything. */
158
159 #define EXTRA_SPECS \
160 { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
161 { "cpp_fpu", CPP_FPU_SPEC }, \
162 { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
163 { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
164 /*{ "cc1_cpu_default", CC1_CPU_DEFAULT__SPEC },*/ \
165 SUBTARGET_EXTRA_SPECS
166
167 #define CPP_SUBTARGET_SPEC ""
168 #define SUBTARGET_EXTRA_SPECS
169 \f
170 /* Avoid building multilib libraries for the defaults.
171 For targets not handled here, just build the full set of multilibs.
172 The default is m68k 99.9% of the time anyway. */
173
174 #if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
175 #if TARGET_DEFAULT & MASK_68881
176 #define MULTILIB_DEFAULTS { "m68020", "m68881" }
177 #else
178 #define MULTILIB_DEFAULTS { "m68020", "msoft-float" }
179 #endif
180 #endif
181
182 #if TARGET_CPU_DEFAULT == M68K_CPU_m68000 || TARGET_CPU_DEFAULT == M68K_CPU_m68302
183 #if TARGET_DEFAULT & MASK_68881
184 #define MULTILIB_DEFAULTS { "m68000", "m68881" }
185 #else
186 #define MULTILIB_DEFAULTS { "m68000", "msoft-float" }
187 #endif
188 #endif