OSDN Git Service

* config/m68k/m68k-none.h: Introduce new ColdFire archs.
[pf3gnuchains/gcc-fork.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 /* Define __HAVE_68881__ or nothing (soft float), appropriately.  */
91 #undef CPP_FPU_SPEC
92 #if TARGET_DEFAULT & MASK_68881
93 #define CPP_FPU_SPEC "\
94 %{!mc68000:%{!m68000:%{!m68302:%{!mcpu32:%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%{!msoft-float:%{!mno-68881:-D__HAVE_68881__ }}}}}}}}}}}} \
95 %{m68881:-D__HAVE_68881__ }"
96 #else
97 #define CPP_FPU_SPEC "\
98 %{m68881:-D__HAVE_68881__ }"
99 #endif
100
101 /* Names to predefine in the preprocessor for this target machine.
102    Other definitions depend on what the default cpu is and switches
103    given to the compiler:
104
105    -m68000, -mc68000: define nothing else
106    -m68010: define mc68010
107    -m68020, -mc68020: define mc68020
108    -m68030: define mc68030
109    -m68040: define mc68040
110    -m68060: define mc68060
111    -m68020-40: define mc68020 mc68030 mc68040
112    -m68020-60: define mc68020 mc68030 mc68040 mc68060
113    -m68302: define mc68302 
114    -m68332: define mc68332 mcpu32
115    -mcpu32: define mcpu32
116    -m5200: define mcoldfire mcf5200
117    -m5206e: define mcoldfire mcf5200 mcf5206e
118    -m528x: define mcoldfire mc5200 mc528x
119    -m5307: define mcoldfire mc5300 mc5307
120    -m5407: define mcoldfire mc5400 mc5407
121
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:-Dmcoldfire -Dmcf5200 }%{m5206e:-Dmcoldfire -Dmcf5200 -Dmcf5206e }%{m528x:-Dmcoldfire -Dmcf5200 -Dmcf528x }%{m5307:-Dmcoldfire -Dmcf5300 -Dmcf5307 }%{m5407: -Dmcoldfire -Dmcf5400 -Dmcf5407 }} \
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 -D__mcoldfire__ } \
131 %{m5206e:-D__mcoldfire__ -D__mcf5200__ -D__mcf5200 -D__mcf5206e__ -D__mcf5206e } \
132 %{m528x:-D__mcoldfire__ -D__mcf5200__ -D__mcf5200 -D__mcf528x__ -D__mcf528x } \
133 %{m5307:-D__mcoldfire__ -D__mcf5300__ -D__mcf5300 -D__mcf5307__ -D__mcf5307 } \
134 %{m5407:-D__mcoldfire__ -D__mcf5400__ -D__mcf5400 -D__mcf5407__ -D__mcf5407 } \
135 %{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32: %{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%(cpp_cpu_default)}}}}}}}}}}}}}}}}}} \
136 %(cpp_subtarget) \
137 "
138
139 /* Pass flags to gas indicating which type of processor we have.  */
140
141 #undef ASM_SPEC
142 #define ASM_SPEC "\
143 %{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}%{m5206e}%{m528x}%{m5307}%{m5407}%{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32:%{!m68332:%{!m5200:%{!m5206e:%{!m528x:%{!m5307:%{!m5407:%(asm_cpu_default)}}}}}}}}}}}}}}}}}} \
144 "
145
146 /* cc1/cc1plus always receives all the -m flags. If the specs strings above 
147    are consistent with the TARGET_OPTIONS flags in m68k.h, there should be no
148    need for any further cc1/cc1plus specs.  */
149
150 #undef CC1_SPEC
151 #define CC1_SPEC ""
152
153 /* This macro defines names of additional specifications to put in the specs
154    that can be used in various specifications like CC1_SPEC.  Its definition
155    is an initializer with a subgrouping for each command option.
156
157    Each subgrouping contains a string constant, that defines the
158    specification name, and a string constant that used by the GNU CC driver
159    program.
160
161    Do not define this macro if it does not need to do anything.  */
162
163 #define EXTRA_SPECS                                     \
164   { "cpp_cpu_default",  CPP_CPU_DEFAULT_SPEC },         \
165   { "cpp_fpu",          CPP_FPU_SPEC },                 \
166   { "cpp_subtarget",    CPP_SUBTARGET_SPEC },           \
167   { "asm_cpu_default",  ASM_CPU_DEFAULT_SPEC },         \
168 /*{ "cc1_cpu_default",  CC1_CPU_DEFAULT__SPEC },*/      \
169   SUBTARGET_EXTRA_SPECS
170
171 #define CPP_SUBTARGET_SPEC ""
172 #define SUBTARGET_EXTRA_SPECS
173 \f
174 /* Avoid building multilib libraries for the defaults.
175    For targets not handled here, just build the full set of multilibs.
176    The default is m68k 99.9% of the time anyway.  */
177
178 #if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
179 #if TARGET_DEFAULT & MASK_68881
180 #define MULTILIB_DEFAULTS { "m68020", "m68881" }
181 #else
182 #define MULTILIB_DEFAULTS { "m68020", "msoft-float" }
183 #endif
184 #endif
185
186 #if TARGET_CPU_DEFAULT == M68K_CPU_m68000 || TARGET_CPU_DEFAULT == M68K_CPU_m68302
187 #if TARGET_DEFAULT & MASK_68881
188 #define MULTILIB_DEFAULTS { "m68000", "m68881" }
189 #else
190 #define MULTILIB_DEFAULTS { "m68000", "msoft-float" }
191 #endif
192 #endif