OSDN Git Service

2002-04-12 Eric Norum <eric.norum@usask.ca>
[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 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 one of __HAVE_68881__, __HAVE_FPA__, __HAVE_SKY__, or nothing 
96    (soft float), appropriately.  */
97 #undef CPP_FPU_SPEC
98 #if TARGET_DEFAULT & MASK_68881
99 #define CPP_FPU_SPEC "\
100 %{!mc68000:%{!m68000:%{!m68302:%{!mcpu32:%{!m68332:%{!m5200:%{!msoft-float:%{!mno-68881:%{!mfpa:%{!msky:-D__HAVE_68881__ }}}}}}}}}} \
101 %{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }%{msky:-D__HAVE_SKY__ }"
102 #else
103 /* This can't currently happen, but we code it anyway to show how it's done.  */
104 #if TARGET_DEFAULT & MASK_FPA
105 #define CPP_FPU_SPEC \
106 "%{!msoft-float:%{m68881:-D__HAVE_68881__ }%{!m68881:-D__HAVE_FPA__ }}"
107 #else
108 #define CPP_FPU_SPEC "\
109 %{m68881:-D__HAVE_68881__ }%{mfpa:-D__HAVE_FPA__ }%{msky:-D__HAVE_SKY__ }"
110 #endif
111 #endif
112
113 /* Names to predefine in the preprocessor for this target machine.
114    Other definitions depend on what the default cpu is and switches
115    given to the compiler:
116
117    -m68000, -mc68000: define nothing else
118    -m68010: define mc68010
119    -m68020, -mc68020: define mc68020
120    -m68030: define mc68030
121    -m68040: define mc68040
122    -m68060: define mc68060
123    -m68020-40: define mc68020 mc68030 mc68040
124    -m68020-60: define mc68020 mc68030 mc68040 mc68060
125    -m68302: define mc68302 
126    -m68332: define mc68332 mcpu32
127    -mcpu32: define mcpu32
128    -m5200: define mcf5200
129    default: define as above appropriately
130
131    GCC won't automatically add __'d versions, we have to mention them
132    explicitly.  */
133
134 #undef CPP_SPEC
135 #define CPP_SPEC "\
136 %(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 }} \
137 %{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 } \
138 %{!mc68000:%{!m68000:%{!m68302:%{!m68010:%{!mc68020:%{!m68020:%{!m68030:%{!m68040:%{!m68020-40:%{!m68020-60:%{!m68060:%{!mcpu32: %{!m68332:%{!m5200:%(cpp_cpu_default)}}}}}}}}}}}}}} \
139 %(cpp_subtarget) \
140 "
141
142 /* Pass flags to gas indicating which type of processor we have.  */
143
144 #undef ASM_SPEC
145 #define ASM_SPEC "\
146 %{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) }}}}}}}}}}}}}} \
147 "
148
149 /* cc1/cc1plus always receives all the -m flags. If the specs strings above 
150    are consistent with the TARGET_OPTIONS flags in m68k.h, there should be no
151    need for any further cc1/cc1plus specs.  */
152
153 #undef CC1_SPEC
154 #define CC1_SPEC ""
155
156 /* This macro defines names of additional specifications to put in the specs
157    that can be used in various specifications like CC1_SPEC.  Its definition
158    is an initializer with a subgrouping for each command option.
159
160    Each subgrouping contains a string constant, that defines the
161    specification name, and a string constant that used by the GNU CC driver
162    program.
163
164    Do not define this macro if it does not need to do anything.  */
165
166 #define EXTRA_SPECS                                     \
167   { "cpp_cpu_default",  CPP_CPU_DEFAULT_SPEC },         \
168   { "cpp_fpu",          CPP_FPU_SPEC },                 \
169   { "cpp_subtarget",    CPP_SUBTARGET_SPEC },           \
170   { "asm_cpu_default",  ASM_CPU_DEFAULT_SPEC },         \
171 /*{ "cc1_cpu_default",  CC1_CPU_DEFAULT__SPEC },*/      \
172   SUBTARGET_EXTRA_SPECS
173
174 #define CPP_SUBTARGET_SPEC ""
175 #define SUBTARGET_EXTRA_SPECS
176 \f
177 /* Avoid building multilib libraries for the defaults.
178    t-m68kbare doesn't support -mfpa in the multilib'd libraries, so we don't
179    either.
180    For targets not handled here, just build the full set of multilibs.
181    The default is m68k 99.9% of the time anyway.  */
182
183 #if TARGET_CPU_DEFAULT == M68K_CPU_m68k || TARGET_CPU_DEFAULT == M68K_CPU_m68020
184 #if TARGET_DEFAULT & MASK_68881
185 #define MULTILIB_DEFAULTS { "m68020", "m68881" }
186 #else
187 #define MULTILIB_DEFAULTS { "m68020", "msoft-float" }
188 #endif
189 #endif
190
191 #if TARGET_CPU_DEFAULT == M68K_CPU_m68000 || TARGET_CPU_DEFAULT == M68K_CPU_m68302
192 #if TARGET_DEFAULT & MASK_68881
193 #define MULTILIB_DEFAULTS { "m68000", "m68881" }
194 #else
195 #define MULTILIB_DEFAULTS { "m68000", "msoft-float" }
196 #endif
197 #endif