]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/m68k/m68k-none.h
Rewrite to use EXTRA_SPECS.
[thirdparty/gcc.git] / gcc / config / m68k / m68k-none.h
1 /* Definitions of target machine for GNU compiler. "naked" 68020.
2 Copyright (C) 1994, 1996 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 "-m68000"
76 #else
77 #if TARGET_CPU_DEFAULT == M68K_CPU_m68332
78 #define CPP_CPU_DEFAULT_SPEC "%{!ansi:-Dmc68332 } -D__mc68332 -D__mc68332__"
79 #define ASM_CPU_DEFAULT_SPEC "-mc68332"
80 #define CC1_CPU_DEFAULT_SPEC "-m68020 -mnobitfield %{!m68881:-msoft-float}"
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 one of __HAVE_68881__, __HAVE_FPA__, or nothing (soft float), appropriately. */
96 #undef CPP_FPU_SPEC
97 #if TARGET_DEFAULT & 02
98 /* ??? Why isn't m68302 treated like m68000 here? */
99 #define CPP_FPU_SPEC \
100 "%{!mc68000:%{!m68000:%{!m68332:%{!msoft-float:%{mfpa:-D__HAVE_FPA__ }%{!mfpa:-D__HAVE_68881__ }}}}}"
101 #else
102 /* This can't currently happen, but we code it anyway to show how it's done. */
103 #if TARGET_DEFAULT & 0100
104 #define CPP_FPU_SPEC \
105 "%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}"
106 #else
107 #define CPP_FPU_SPEC \
108 "%{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }"
109 #endif
110 #endif
111
112 /* Names to predefine in the preprocessor for this target machine.
113 Other definitions depend on what the default cpu is and switches
114 given to the compiler:
115
116 -m68000: define nothing else
117 -m68020, -mc68020: define mc68020
118 -m68030: define mc68030
119 -m68040: define mc68040
120 -m68020-40: define mc68020 mc68030 mc68040
121 -m68302: define mc68302
122 -m68332: define mc68332
123 default: define as above appropriately
124
125 GCC won't automatically add __'d versions, we have to mention them
126 explicitly. */
127
128 #undef CPP_SPEC
129 #define CPP_SPEC "\
130 %(cpp_fpu) \
131 %{!ansi:%{m68010:-Dmc68010 }%{m68020:-Dmc68020 }%{mc68020:-Dmc68020 }%{m68030:-Dmc68030 }%{m68040:-Dmc68040 }%{m68020-40:-Dmc68020 -Dmc68030 -Dmc68040 }%{m68302:-Dmc68302 }%{m68332:-Dmc68332 }} \
132 %{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 }%{m68302:-D__mc68302__ -D__mc68302 }%{m68332:-D__mc68332__ -D__mc68332 } \
133 %{!mc68000:%{!m68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(cpp_cpu_default)}}}}}}}}}} \
134 %(cpp_subtarget) \
135 "
136
137 /* Pass flags to gas indicating which type of processor we have. */
138
139 #undef ASM_SPEC
140 #define ASM_SPEC "\
141 %{m68851}%{mno-68851}%{m68881}%{mno-68881}%{msoft-float:-mno-68881 } \
142 %{m68000}%{mc68000}%{m68010}%{m68020}%{mc68020}%{m68030}%{m68040}%{m68020-40:-mc68040 }%{m68302}%{m68332} \
143 %{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(asm_cpu_default)}}}}}}}}}} \
144 "
145
146 #undef CC1_SPEC
147 #define CC1_SPEC "\
148 %{m68000:%{!m68881:-msoft-float }}%{m68302:-m68000 }%{m68332:-m68020 -mnobitfield %{!m68881:-msoft-float }} \
149 "
150 /* ??? Is this needed?
151 %{!m68000:%{!mc68000:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68302:%{!m68332:%(cc1_cpu_default)}}}}}}}}}}
152 */
153
154 /* This macro defines names of additional specifications to put in the specs
155 that can be used in various specifications like CC1_SPEC. Its definition
156 is an initializer with a subgrouping for each command option.
157
158 Each subgrouping contains a string constant, that defines the
159 specification name, and a string constant that used by the GNU CC driver
160 program.
161
162 Do not define this macro if it does not need to do anything. */
163
164 #define EXTRA_SPECS \
165 { "cpp_cpu_default", CPP_CPU_DEFAULT_SPEC }, \
166 { "cpp_fpu", CPP_FPU_SPEC }, \
167 { "cpp_subtarget", CPP_SUBTARGET_SPEC }, \
168 { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
169 /*{ "cc1_cpu_default", CC1_CPU_DEFAULT__SPEC },*/ \
170 SUBTARGET_EXTRA_SPECS
171
172 #define CPP_SUBTARGET_SPEC ""
173 #define SUBTARGET_EXTRA_SPECS
174 \f
175 /* Avoid building multilib libraries for the defaults.
176 t-m68kbare doesn't support -mfpa in the multilib'd libraries, so we don't
177 either.
178 For targets not handled here, just build the full set of multilibs.
179 The default is m68k 99.9% of the time anyway. */
180
181 #if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
182 #if TARGET_DEFAULT & 2
183 #define MULTILIB_DEFAULTS { "m68020", "m68881" }
184 #else
185 #define MULTILIB_DEFAULTS { "m68020", "msoft-float" }
186 #endif
187 #endif
188
189 #if TARGET_CPU_DEFAULT == M68K_CPU_m68000 || TARGET_CPU_DEFAULT == M68K_CPU_m68302
190 #if TARGET_DEFAULT & 2
191 #define MULTILIB_DEFAULTS { "m68000", "m68881" }
192 #else
193 #define MULTILIB_DEFAULTS { "m68000", "msoft-float" }
194 #endif
195 #endif