* aix386-core.c: Remove use of PTR and PARAMS macros.
[deliverable/binutils-gdb.git] / bfd / cpu-powerpc.c
CommitLineData
252b5132 1/* BFD PowerPC CPU definition
aea77599
AM
2 Copyright 1994, 1995, 1996, 2000, 2001, 2002, 2003, 2005, 2007, 2008,
3 2010, 2012 Free Software Foundation, Inc.
252b5132
RH
4 Contributed by Ian Lance Taylor, Cygnus Support.
5
cd123cb7
NC
6 This file is part of BFD, the Binary File Descriptor library.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
252b5132 22
252b5132 23#include "sysdep.h"
3db64b00 24#include "bfd.h"
252b5132
RH
25#include "libbfd.h"
26
27/* The common PowerPC architecture is compatible with the RS/6000. */
28
252b5132 29static const bfd_arch_info_type *
2c3fc389
NC
30powerpc_compatible (const bfd_arch_info_type *a,
31 const bfd_arch_info_type *b)
252b5132
RH
32{
33 BFD_ASSERT (a->arch == bfd_arch_powerpc);
34 switch (b->arch)
35 {
36 default:
37 return NULL;
38 case bfd_arch_powerpc:
39 return bfd_default_compatible (a, b);
40 case bfd_arch_rs6000:
43dd9340 41 if (b->mach == bfd_mach_rs6k)
252b5132
RH
42 return a;
43 return NULL;
44 }
45 /*NOTREACHED*/
46}
47
899f54f5 48const bfd_arch_info_type bfd_powerpc_archs[] =
252b5132 49{
feee612b
AM
50#if BFD_DEFAULT_TARGET_SIZE == 64
51 /* Default arch must come first. */
99dc0092
AM
52 {
53 64, /* 64 bits in a word */
54 64, /* 64 bits in an address */
55 8, /* 8 bits in a byte */
56 bfd_arch_powerpc,
57 bfd_mach_ppc64,
58 "powerpc",
59 "powerpc:common64",
60 3,
b34976b6 61 TRUE, /* default for 64 bit target */
99dc0092
AM
62 powerpc_compatible,
63 bfd_default_scan,
b7761f11 64 bfd_arch_default_fill,
99dc0092
AM
65 &bfd_powerpc_archs[1]
66 },
feee612b
AM
67 /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
68 being immediately after the 64 bit default. */
99dc0092
AM
69 {
70 32, /* 32 bits in a word */
71 32, /* 32 bits in an address */
72 8, /* 8 bits in a byte */
73 bfd_arch_powerpc,
74 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
75 "powerpc",
76 "powerpc:common",
77 3,
b34976b6 78 FALSE,
99dc0092
AM
79 powerpc_compatible,
80 bfd_default_scan,
b7761f11 81 bfd_arch_default_fill,
99dc0092
AM
82 &bfd_powerpc_archs[2],
83 },
84#else
feee612b 85 /* Default arch must come first. */
99dc0092
AM
86 {
87 32, /* 32 bits in a word */
88 32, /* 32 bits in an address */
89 8, /* 8 bits in a byte */
90 bfd_arch_powerpc,
91 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
92 "powerpc",
93 "powerpc:common",
94 3,
b34976b6 95 TRUE, /* default for 32 bit target */
99dc0092
AM
96 powerpc_compatible,
97 bfd_default_scan,
b7761f11 98 bfd_arch_default_fill,
99dc0092
AM
99 &bfd_powerpc_archs[1],
100 },
feee612b
AM
101 /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
102 being immediately after the 32 bit default. */
99dc0092
AM
103 {
104 64, /* 64 bits in a word */
105 64, /* 64 bits in an address */
106 8, /* 8 bits in a byte */
107 bfd_arch_powerpc,
108 bfd_mach_ppc64,
109 "powerpc",
110 "powerpc:common64",
111 3,
b34976b6 112 FALSE,
99dc0092
AM
113 powerpc_compatible,
114 bfd_default_scan,
b7761f11 115 bfd_arch_default_fill,
99dc0092
AM
116 &bfd_powerpc_archs[2]
117 },
118#endif
252b5132
RH
119 {
120 32, /* 32 bits in a word */
121 32, /* 32 bits in an address */
122 8, /* 8 bits in a byte */
123 bfd_arch_powerpc,
87f33987 124 bfd_mach_ppc_603,
252b5132
RH
125 "powerpc",
126 "powerpc:603",
127 3,
b34976b6 128 FALSE, /* not the default */
71f6b586 129 powerpc_compatible,
252b5132 130 bfd_default_scan,
b7761f11 131 bfd_arch_default_fill,
99dc0092 132 &bfd_powerpc_archs[3]
252b5132
RH
133 },
134 {
135 32, /* 32 bits in a word */
136 32, /* 32 bits in an address */
137 8, /* 8 bits in a byte */
138 bfd_arch_powerpc,
87f33987 139 bfd_mach_ppc_ec603e,
252b5132 140 "powerpc",
87f33987 141 "powerpc:EC603e",
252b5132 142 3,
b34976b6 143 FALSE, /* not the default */
71f6b586 144 powerpc_compatible,
252b5132 145 bfd_default_scan,
b7761f11 146 bfd_arch_default_fill,
99dc0092 147 &bfd_powerpc_archs[4]
252b5132
RH
148 },
149 {
150 32, /* 32 bits in a word */
151 32, /* 32 bits in an address */
152 8, /* 8 bits in a byte */
153 bfd_arch_powerpc,
87f33987 154 bfd_mach_ppc_604,
252b5132 155 "powerpc",
87f33987 156 "powerpc:604",
252b5132 157 3,
b34976b6 158 FALSE, /* not the default */
71f6b586 159 powerpc_compatible,
252b5132 160 bfd_default_scan,
b7761f11 161 bfd_arch_default_fill,
99dc0092 162 &bfd_powerpc_archs[5]
252b5132
RH
163 },
164 {
165 32, /* 32 bits in a word */
166 32, /* 32 bits in an address */
167 8, /* 8 bits in a byte */
168 bfd_arch_powerpc,
87f33987 169 bfd_mach_ppc_403,
252b5132 170 "powerpc",
87f33987 171 "powerpc:403",
252b5132 172 3,
b34976b6 173 FALSE, /* not the default */
71f6b586 174 powerpc_compatible,
252b5132 175 bfd_default_scan,
b7761f11 176 bfd_arch_default_fill,
99dc0092 177 &bfd_powerpc_archs[6]
7f6d05e8 178 },
87f33987 179 {
7f6d05e8 180 32, /* 32 bits in a word */
87f33987
ND
181 32, /* 32 bits in an address */
182 8, /* 8 bits in a byte */
183 bfd_arch_powerpc,
184 bfd_mach_ppc_601,
185 "powerpc",
186 "powerpc:601",
187 3,
b34976b6 188 FALSE, /* not the default */
71f6b586 189 powerpc_compatible,
87f33987 190 bfd_default_scan,
b7761f11 191 bfd_arch_default_fill,
99dc0092 192 &bfd_powerpc_archs[7]
87f33987 193 },
71f6b586 194 {
87f33987 195 64, /* 64 bits in a word */
7f6d05e8
CP
196 64, /* 64 bits in an address */
197 8, /* 8 bits in a byte */
198 bfd_arch_powerpc,
87f33987 199 bfd_mach_ppc_620,
7f6d05e8
CP
200 "powerpc",
201 "powerpc:620",
202 3,
b34976b6 203 FALSE, /* not the default */
71f6b586 204 powerpc_compatible,
7f6d05e8 205 bfd_default_scan,
b7761f11 206 bfd_arch_default_fill,
99dc0092 207 &bfd_powerpc_archs[8]
87f33987
ND
208 },
209 {
210 64, /* 64 bits in a word */
211 64, /* 64 bits in an address */
212 8, /* 8 bits in a byte */
213 bfd_arch_powerpc,
214 bfd_mach_ppc_630,
215 "powerpc",
216 "powerpc:630",
217 3,
b34976b6 218 FALSE, /* not the default */
87f33987
ND
219 powerpc_compatible,
220 bfd_default_scan,
b7761f11 221 bfd_arch_default_fill,
99dc0092 222 &bfd_powerpc_archs[9]
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_a35,
230 "powerpc",
231 "powerpc:a35",
232 3,
b34976b6 233 FALSE, /* not the default */
87f33987
ND
234 powerpc_compatible,
235 bfd_default_scan,
b7761f11 236 bfd_arch_default_fill,
99dc0092 237 &bfd_powerpc_archs[10]
87f33987
ND
238 },
239 {
240 64, /* 64 bits in a word */
241 64, /* 64 bits in an address */
242 8, /* 8 bits in a byte */
243 bfd_arch_powerpc,
244 bfd_mach_ppc_rs64ii,
245 "powerpc",
246 "powerpc:rs64ii",
247 3,
b34976b6 248 FALSE, /* not the default */
87f33987
ND
249 powerpc_compatible,
250 bfd_default_scan,
b7761f11 251 bfd_arch_default_fill,
99dc0092 252 &bfd_powerpc_archs[11]
87f33987
ND
253 },
254 {
255 64, /* 64 bits in a word */
256 64, /* 64 bits in an address */
257 8, /* 8 bits in a byte */
258 bfd_arch_powerpc,
259 bfd_mach_ppc_rs64iii,
260 "powerpc",
261 "powerpc:rs64iii",
262 3,
b34976b6 263 FALSE, /* not the default */
87f33987
ND
264 powerpc_compatible,
265 bfd_default_scan,
b7761f11 266 bfd_arch_default_fill,
99dc0092 267 &bfd_powerpc_archs[12]
87f33987
ND
268 },
269 {
270 32, /* 32 bits in a word */
271 32, /* 32 bits in an address */
272 8, /* 8 bits in a byte */
273 bfd_arch_powerpc,
274 bfd_mach_ppc_7400,
275 "powerpc",
276 "powerpc:7400",
277 3,
b34976b6 278 FALSE, /* not the default */
87f33987
ND
279 powerpc_compatible,
280 bfd_default_scan,
b7761f11 281 bfd_arch_default_fill,
99dc0092 282 &bfd_powerpc_archs[13]
188ac662 283 },
d62b1198
EZ
284 {
285 32, /* 32 bits in a word */
286 32, /* 32 bits in an address */
287 8, /* 8 bits in a byte */
288 bfd_arch_powerpc,
289 bfd_mach_ppc_e500,
290 "powerpc",
291 "powerpc:e500",
292 3,
b34976b6 293 FALSE,
d62b1198
EZ
294 powerpc_compatible,
295 bfd_default_scan,
b7761f11 296 bfd_arch_default_fill,
d62b1198
EZ
297 &bfd_powerpc_archs[14]
298 },
9239aded
AM
299 {
300 32, /* 32 bits in a word */
301 32, /* 32 bits in an address */
302 8, /* 8 bits in a byte */
303 bfd_arch_powerpc,
304 bfd_mach_ppc_e500mc,
305 "powerpc",
306 "powerpc:e500mc",
307 3,
308 FALSE, /* not the default */
309 powerpc_compatible,
310 bfd_default_scan,
b7761f11 311 bfd_arch_default_fill,
9239aded
AM
312 &bfd_powerpc_archs[15]
313 },
0dc93057
AM
314 {
315 64, /* 64 bits in a word */
316 64, /* 64 bits in an address */
317 8, /* 8 bits in a byte */
318 bfd_arch_powerpc,
319 bfd_mach_ppc_e500mc64,
320 "powerpc",
321 "powerpc:e500mc64",
322 3,
323 FALSE, /* not the default */
324 powerpc_compatible,
325 bfd_default_scan,
b7761f11 326 bfd_arch_default_fill,
0dc93057
AM
327 &bfd_powerpc_archs[16]
328 },
188ac662
GK
329 {
330 32, /* 32 bits in a word */
331 32, /* 32 bits in an address */
332 8, /* 8 bits in a byte */
333 bfd_arch_powerpc,
334 bfd_mach_ppc_860,
335 "powerpc",
336 "powerpc:MPC8XX",
337 3,
b34976b6 338 FALSE, /* not the default */
188ac662
GK
339 powerpc_compatible,
340 bfd_default_scan,
b7761f11 341 bfd_arch_default_fill,
0dc93057 342 &bfd_powerpc_archs[17]
1ca81d72
AM
343 },
344 {
345 32, /* 32 bits in a word */
346 32, /* 32 bits in an address */
347 8, /* 8 bits in a byte */
348 bfd_arch_powerpc,
349 bfd_mach_ppc_750,
350 "powerpc",
351 "powerpc:750",
352 3,
353 FALSE, /* not the default */
354 powerpc_compatible,
355 bfd_default_scan,
b7761f11 356 bfd_arch_default_fill,
ce3d2015
AM
357 &bfd_powerpc_archs[18]
358 },
359 {
360 32, /* 32 bits in a word */
361 32, /* 32 bits in an address */
362 8, /* 8 bits in a byte */
363 bfd_arch_powerpc,
364 bfd_mach_ppc_titan,
365 "powerpc",
366 "powerpc:titan",
367 3,
368 FALSE, /* not the default */
369 powerpc_compatible,
370 bfd_default_scan,
b7761f11 371 bfd_arch_default_fill,
aea77599
AM
372 &bfd_powerpc_archs[19]
373 },
b9c361e0
JL
374 {
375 16, /* 16 or 32 bits in a word */
376 32, /* 32 bits in an address */
377 8, /* 8 bits in a byte */
378 bfd_arch_powerpc,
379 bfd_mach_ppc_vle,
380 "powerpc",
381 "powerpc:vle",
382 3,
383 FALSE, /* not the default */
384 powerpc_compatible,
385 bfd_default_scan,
386 bfd_arch_default_fill,
387 &bfd_powerpc_archs[20]
388 },
aea77599
AM
389 {
390 64, /* 64 bits in a word */
391 64, /* 64 bits in an address */
392 8, /* 8 bits in a byte */
393 bfd_arch_powerpc,
394 bfd_mach_ppc_e5500,
395 "powerpc",
396 "powerpc:e5500",
397 3,
398 FALSE, /* not the default */
399 powerpc_compatible,
400 bfd_default_scan,
401 bfd_arch_default_fill,
b9c361e0 402 &bfd_powerpc_archs[21]
aea77599
AM
403 },
404 {
405 64, /* 64 bits in a word */
406 64, /* 64 bits in an address */
407 8, /* 8 bits in a byte */
408 bfd_arch_powerpc,
409 bfd_mach_ppc_e6500,
410 "powerpc",
411 "powerpc:e6500",
412 3,
413 FALSE, /* not the default */
414 powerpc_compatible,
415 bfd_default_scan,
416 bfd_arch_default_fill,
899f54f5
AM
417 0
418 }
419};
This page took 0.575133 seconds and 4 git commands to generate.