daily update
[deliverable/binutils-gdb.git] / bfd / cpu-powerpc.c
CommitLineData
252b5132 1/* BFD PowerPC CPU definition
899f54f5
AM
2 Copyright 1994, 1995, 1996, 2000, 2001, 2002
3 Free Software Foundation, Inc.
252b5132
RH
4 Contributed by Ian Lance Taylor, Cygnus Support.
5
6This file is part of BFD, the Binary File Descriptor library.
7
8This program is free software; you can redistribute it and/or modify
9it under the terms of the GNU General Public License as published by
10the Free Software Foundation; either version 2 of the License, or
11(at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16GNU General Public License for more details.
17
18You should have received a copy of the GNU General Public License
19along with this program; if not, write to the Free Software
20Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21
22#include "bfd.h"
23#include "sysdep.h"
24#include "libbfd.h"
25
26/* The common PowerPC architecture is compatible with the RS/6000. */
27
28static const bfd_arch_info_type *powerpc_compatible
29 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
30
31static const bfd_arch_info_type *
32powerpc_compatible (a,b)
33 const bfd_arch_info_type *a;
34 const bfd_arch_info_type *b;
35{
36 BFD_ASSERT (a->arch == bfd_arch_powerpc);
37 switch (b->arch)
38 {
39 default:
40 return NULL;
41 case bfd_arch_powerpc:
42 return bfd_default_compatible (a, b);
43 case bfd_arch_rs6000:
44 if (a->mach == 0)
45 return a;
46 return NULL;
47 }
48 /*NOTREACHED*/
49}
50
899f54f5 51const bfd_arch_info_type bfd_powerpc_archs[] =
252b5132 52{
99dc0092
AM
53#if BFD_DEFAULT_TARGET_SIZE == 64 /* default arch must come first. */
54 {
55 64, /* 64 bits in a word */
56 64, /* 64 bits in an address */
57 8, /* 8 bits in a byte */
58 bfd_arch_powerpc,
59 bfd_mach_ppc64,
60 "powerpc",
61 "powerpc:common64",
62 3,
63 true, /* default for 64 bit target */
64 powerpc_compatible,
65 bfd_default_scan,
66 &bfd_powerpc_archs[1]
67 },
68 {
69 32, /* 32 bits in a word */
70 32, /* 32 bits in an address */
71 8, /* 8 bits in a byte */
72 bfd_arch_powerpc,
73 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
74 "powerpc",
75 "powerpc:common",
76 3,
77 false,
78 powerpc_compatible,
79 bfd_default_scan,
80 &bfd_powerpc_archs[2],
81 },
82#else
83 {
84 32, /* 32 bits in a word */
85 32, /* 32 bits in an address */
86 8, /* 8 bits in a byte */
87 bfd_arch_powerpc,
88 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
89 "powerpc",
90 "powerpc:common",
91 3,
92 true, /* default for 32 bit target */
93 powerpc_compatible,
94 bfd_default_scan,
95 &bfd_powerpc_archs[1],
96 },
97 {
98 64, /* 64 bits in a word */
99 64, /* 64 bits in an address */
100 8, /* 8 bits in a byte */
101 bfd_arch_powerpc,
102 bfd_mach_ppc64,
103 "powerpc",
104 "powerpc:common64",
105 3,
106 false,
107 powerpc_compatible,
108 bfd_default_scan,
109 &bfd_powerpc_archs[2]
110 },
111#endif
252b5132
RH
112 {
113 32, /* 32 bits in a word */
114 32, /* 32 bits in an address */
115 8, /* 8 bits in a byte */
116 bfd_arch_powerpc,
87f33987 117 bfd_mach_ppc_603,
252b5132
RH
118 "powerpc",
119 "powerpc:603",
120 3,
121 false, /* not the default */
71f6b586 122 powerpc_compatible,
252b5132 123 bfd_default_scan,
99dc0092 124 &bfd_powerpc_archs[3]
252b5132
RH
125 },
126 {
127 32, /* 32 bits in a word */
128 32, /* 32 bits in an address */
129 8, /* 8 bits in a byte */
130 bfd_arch_powerpc,
87f33987 131 bfd_mach_ppc_ec603e,
252b5132 132 "powerpc",
87f33987 133 "powerpc:EC603e",
252b5132
RH
134 3,
135 false, /* not the default */
71f6b586 136 powerpc_compatible,
252b5132 137 bfd_default_scan,
99dc0092 138 &bfd_powerpc_archs[4]
252b5132
RH
139 },
140 {
141 32, /* 32 bits in a word */
142 32, /* 32 bits in an address */
143 8, /* 8 bits in a byte */
144 bfd_arch_powerpc,
87f33987 145 bfd_mach_ppc_604,
252b5132 146 "powerpc",
87f33987 147 "powerpc:604",
252b5132
RH
148 3,
149 false, /* not the default */
71f6b586 150 powerpc_compatible,
252b5132 151 bfd_default_scan,
99dc0092 152 &bfd_powerpc_archs[5]
252b5132
RH
153 },
154 {
155 32, /* 32 bits in a word */
156 32, /* 32 bits in an address */
157 8, /* 8 bits in a byte */
158 bfd_arch_powerpc,
87f33987 159 bfd_mach_ppc_403,
252b5132 160 "powerpc",
87f33987 161 "powerpc:403",
252b5132
RH
162 3,
163 false, /* not the default */
71f6b586 164 powerpc_compatible,
252b5132 165 bfd_default_scan,
99dc0092 166 &bfd_powerpc_archs[6]
7f6d05e8 167 },
87f33987 168 {
7f6d05e8 169 32, /* 32 bits in a word */
87f33987
ND
170 32, /* 32 bits in an address */
171 8, /* 8 bits in a byte */
172 bfd_arch_powerpc,
173 bfd_mach_ppc_601,
174 "powerpc",
175 "powerpc:601",
176 3,
177 false, /* not the default */
71f6b586 178 powerpc_compatible,
87f33987 179 bfd_default_scan,
99dc0092 180 &bfd_powerpc_archs[7]
87f33987 181 },
71f6b586 182 {
87f33987 183 64, /* 64 bits in a word */
7f6d05e8
CP
184 64, /* 64 bits in an address */
185 8, /* 8 bits in a byte */
186 bfd_arch_powerpc,
87f33987 187 bfd_mach_ppc_620,
7f6d05e8
CP
188 "powerpc",
189 "powerpc:620",
190 3,
899f54f5 191 false, /* not the default */
71f6b586 192 powerpc_compatible,
7f6d05e8 193 bfd_default_scan,
99dc0092 194 &bfd_powerpc_archs[8]
87f33987
ND
195 },
196 {
197 64, /* 64 bits in a word */
198 64, /* 64 bits in an address */
199 8, /* 8 bits in a byte */
200 bfd_arch_powerpc,
201 bfd_mach_ppc_630,
202 "powerpc",
203 "powerpc:630",
204 3,
205 false, /* not the default */
206 powerpc_compatible,
207 bfd_default_scan,
99dc0092 208 &bfd_powerpc_archs[9]
87f33987
ND
209 },
210 {
211 64, /* 64 bits in a word */
212 64, /* 64 bits in an address */
213 8, /* 8 bits in a byte */
214 bfd_arch_powerpc,
215 bfd_mach_ppc_a35,
216 "powerpc",
217 "powerpc:a35",
218 3,
219 false, /* not the default */
220 powerpc_compatible,
221 bfd_default_scan,
99dc0092 222 &bfd_powerpc_archs[10]
87f33987
ND
223 },
224 {
225 64, /* 64 bits in a word */
226 64, /* 64 bits in an address */
227 8, /* 8 bits in a byte */
228 bfd_arch_powerpc,
229 bfd_mach_ppc_rs64ii,
230 "powerpc",
231 "powerpc:rs64ii",
232 3,
233 false, /* not the default */
234 powerpc_compatible,
235 bfd_default_scan,
99dc0092 236 &bfd_powerpc_archs[11]
87f33987
ND
237 },
238 {
239 64, /* 64 bits in a word */
240 64, /* 64 bits in an address */
241 8, /* 8 bits in a byte */
242 bfd_arch_powerpc,
243 bfd_mach_ppc_rs64iii,
244 "powerpc",
245 "powerpc:rs64iii",
246 3,
247 false, /* not the default */
248 powerpc_compatible,
249 bfd_default_scan,
99dc0092 250 &bfd_powerpc_archs[12]
87f33987
ND
251 },
252 {
253 32, /* 32 bits in a word */
254 32, /* 32 bits in an address */
255 8, /* 8 bits in a byte */
256 bfd_arch_powerpc,
257 bfd_mach_ppc_7400,
258 "powerpc",
259 "powerpc:7400",
260 3,
261 false, /* not the default */
262 powerpc_compatible,
263 bfd_default_scan,
99dc0092 264 &bfd_powerpc_archs[13]
188ac662
GK
265 },
266 {
267 32, /* 32 bits in a word */
268 32, /* 32 bits in an address */
269 8, /* 8 bits in a byte */
270 bfd_arch_powerpc,
271 bfd_mach_ppc_860,
272 "powerpc",
273 "powerpc:MPC8XX",
274 3,
275 false, /* not the default */
276 powerpc_compatible,
277 bfd_default_scan,
899f54f5
AM
278 0
279 }
280};
This page took 0.13913 seconds and 4 git commands to generate.