include/opcode/
[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
29static const bfd_arch_info_type *powerpc_compatible
30 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *));
31
32static const bfd_arch_info_type *
33powerpc_compatible (a,b)
34 const bfd_arch_info_type *a;
35 const bfd_arch_info_type *b;
36{
37 BFD_ASSERT (a->arch == bfd_arch_powerpc);
38 switch (b->arch)
39 {
40 default:
41 return NULL;
42 case bfd_arch_powerpc:
43 return bfd_default_compatible (a, b);
44 case bfd_arch_rs6000:
43dd9340 45 if (b->mach == bfd_mach_rs6k)
252b5132
RH
46 return a;
47 return NULL;
48 }
49 /*NOTREACHED*/
50}
51
899f54f5 52const bfd_arch_info_type bfd_powerpc_archs[] =
252b5132 53{
feee612b
AM
54#if BFD_DEFAULT_TARGET_SIZE == 64
55 /* Default arch must come first. */
99dc0092
AM
56 {
57 64, /* 64 bits in a word */
58 64, /* 64 bits in an address */
59 8, /* 8 bits in a byte */
60 bfd_arch_powerpc,
61 bfd_mach_ppc64,
62 "powerpc",
63 "powerpc:common64",
64 3,
b34976b6 65 TRUE, /* default for 64 bit target */
99dc0092
AM
66 powerpc_compatible,
67 bfd_default_scan,
b7761f11 68 bfd_arch_default_fill,
99dc0092
AM
69 &bfd_powerpc_archs[1]
70 },
feee612b
AM
71 /* elf32-ppc:ppc_elf_object_p relies on the default 32 bit arch
72 being immediately after the 64 bit default. */
99dc0092
AM
73 {
74 32, /* 32 bits in a word */
75 32, /* 32 bits in an address */
76 8, /* 8 bits in a byte */
77 bfd_arch_powerpc,
78 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
79 "powerpc",
80 "powerpc:common",
81 3,
b34976b6 82 FALSE,
99dc0092
AM
83 powerpc_compatible,
84 bfd_default_scan,
b7761f11 85 bfd_arch_default_fill,
99dc0092
AM
86 &bfd_powerpc_archs[2],
87 },
88#else
feee612b 89 /* Default arch must come first. */
99dc0092
AM
90 {
91 32, /* 32 bits in a word */
92 32, /* 32 bits in an address */
93 8, /* 8 bits in a byte */
94 bfd_arch_powerpc,
95 bfd_mach_ppc, /* for the POWER/PowerPC common architecture */
96 "powerpc",
97 "powerpc:common",
98 3,
b34976b6 99 TRUE, /* default for 32 bit target */
99dc0092
AM
100 powerpc_compatible,
101 bfd_default_scan,
b7761f11 102 bfd_arch_default_fill,
99dc0092
AM
103 &bfd_powerpc_archs[1],
104 },
feee612b
AM
105 /* elf64-ppc:ppc64_elf_object_p relies on the default 64 bit arch
106 being immediately after the 32 bit default. */
99dc0092
AM
107 {
108 64, /* 64 bits in a word */
109 64, /* 64 bits in an address */
110 8, /* 8 bits in a byte */
111 bfd_arch_powerpc,
112 bfd_mach_ppc64,
113 "powerpc",
114 "powerpc:common64",
115 3,
b34976b6 116 FALSE,
99dc0092
AM
117 powerpc_compatible,
118 bfd_default_scan,
b7761f11 119 bfd_arch_default_fill,
99dc0092
AM
120 &bfd_powerpc_archs[2]
121 },
122#endif
252b5132
RH
123 {
124 32, /* 32 bits in a word */
125 32, /* 32 bits in an address */
126 8, /* 8 bits in a byte */
127 bfd_arch_powerpc,
87f33987 128 bfd_mach_ppc_603,
252b5132
RH
129 "powerpc",
130 "powerpc:603",
131 3,
b34976b6 132 FALSE, /* not the default */
71f6b586 133 powerpc_compatible,
252b5132 134 bfd_default_scan,
b7761f11 135 bfd_arch_default_fill,
99dc0092 136 &bfd_powerpc_archs[3]
252b5132
RH
137 },
138 {
139 32, /* 32 bits in a word */
140 32, /* 32 bits in an address */
141 8, /* 8 bits in a byte */
142 bfd_arch_powerpc,
87f33987 143 bfd_mach_ppc_ec603e,
252b5132 144 "powerpc",
87f33987 145 "powerpc:EC603e",
252b5132 146 3,
b34976b6 147 FALSE, /* not the default */
71f6b586 148 powerpc_compatible,
252b5132 149 bfd_default_scan,
b7761f11 150 bfd_arch_default_fill,
99dc0092 151 &bfd_powerpc_archs[4]
252b5132
RH
152 },
153 {
154 32, /* 32 bits in a word */
155 32, /* 32 bits in an address */
156 8, /* 8 bits in a byte */
157 bfd_arch_powerpc,
87f33987 158 bfd_mach_ppc_604,
252b5132 159 "powerpc",
87f33987 160 "powerpc:604",
252b5132 161 3,
b34976b6 162 FALSE, /* not the default */
71f6b586 163 powerpc_compatible,
252b5132 164 bfd_default_scan,
b7761f11 165 bfd_arch_default_fill,
99dc0092 166 &bfd_powerpc_archs[5]
252b5132
RH
167 },
168 {
169 32, /* 32 bits in a word */
170 32, /* 32 bits in an address */
171 8, /* 8 bits in a byte */
172 bfd_arch_powerpc,
87f33987 173 bfd_mach_ppc_403,
252b5132 174 "powerpc",
87f33987 175 "powerpc:403",
252b5132 176 3,
b34976b6 177 FALSE, /* not the default */
71f6b586 178 powerpc_compatible,
252b5132 179 bfd_default_scan,
b7761f11 180 bfd_arch_default_fill,
99dc0092 181 &bfd_powerpc_archs[6]
7f6d05e8 182 },
87f33987 183 {
7f6d05e8 184 32, /* 32 bits in a word */
87f33987
ND
185 32, /* 32 bits in an address */
186 8, /* 8 bits in a byte */
187 bfd_arch_powerpc,
188 bfd_mach_ppc_601,
189 "powerpc",
190 "powerpc:601",
191 3,
b34976b6 192 FALSE, /* not the default */
71f6b586 193 powerpc_compatible,
87f33987 194 bfd_default_scan,
b7761f11 195 bfd_arch_default_fill,
99dc0092 196 &bfd_powerpc_archs[7]
87f33987 197 },
71f6b586 198 {
87f33987 199 64, /* 64 bits in a word */
7f6d05e8
CP
200 64, /* 64 bits in an address */
201 8, /* 8 bits in a byte */
202 bfd_arch_powerpc,
87f33987 203 bfd_mach_ppc_620,
7f6d05e8
CP
204 "powerpc",
205 "powerpc:620",
206 3,
b34976b6 207 FALSE, /* not the default */
71f6b586 208 powerpc_compatible,
7f6d05e8 209 bfd_default_scan,
b7761f11 210 bfd_arch_default_fill,
99dc0092 211 &bfd_powerpc_archs[8]
87f33987
ND
212 },
213 {
214 64, /* 64 bits in a word */
215 64, /* 64 bits in an address */
216 8, /* 8 bits in a byte */
217 bfd_arch_powerpc,
218 bfd_mach_ppc_630,
219 "powerpc",
220 "powerpc:630",
221 3,
b34976b6 222 FALSE, /* not the default */
87f33987
ND
223 powerpc_compatible,
224 bfd_default_scan,
b7761f11 225 bfd_arch_default_fill,
99dc0092 226 &bfd_powerpc_archs[9]
87f33987
ND
227 },
228 {
229 64, /* 64 bits in a word */
230 64, /* 64 bits in an address */
231 8, /* 8 bits in a byte */
232 bfd_arch_powerpc,
233 bfd_mach_ppc_a35,
234 "powerpc",
235 "powerpc:a35",
236 3,
b34976b6 237 FALSE, /* not the default */
87f33987
ND
238 powerpc_compatible,
239 bfd_default_scan,
b7761f11 240 bfd_arch_default_fill,
99dc0092 241 &bfd_powerpc_archs[10]
87f33987
ND
242 },
243 {
244 64, /* 64 bits in a word */
245 64, /* 64 bits in an address */
246 8, /* 8 bits in a byte */
247 bfd_arch_powerpc,
248 bfd_mach_ppc_rs64ii,
249 "powerpc",
250 "powerpc:rs64ii",
251 3,
b34976b6 252 FALSE, /* not the default */
87f33987
ND
253 powerpc_compatible,
254 bfd_default_scan,
b7761f11 255 bfd_arch_default_fill,
99dc0092 256 &bfd_powerpc_archs[11]
87f33987
ND
257 },
258 {
259 64, /* 64 bits in a word */
260 64, /* 64 bits in an address */
261 8, /* 8 bits in a byte */
262 bfd_arch_powerpc,
263 bfd_mach_ppc_rs64iii,
264 "powerpc",
265 "powerpc:rs64iii",
266 3,
b34976b6 267 FALSE, /* not the default */
87f33987
ND
268 powerpc_compatible,
269 bfd_default_scan,
b7761f11 270 bfd_arch_default_fill,
99dc0092 271 &bfd_powerpc_archs[12]
87f33987
ND
272 },
273 {
274 32, /* 32 bits in a word */
275 32, /* 32 bits in an address */
276 8, /* 8 bits in a byte */
277 bfd_arch_powerpc,
278 bfd_mach_ppc_7400,
279 "powerpc",
280 "powerpc:7400",
281 3,
b34976b6 282 FALSE, /* not the default */
87f33987
ND
283 powerpc_compatible,
284 bfd_default_scan,
b7761f11 285 bfd_arch_default_fill,
99dc0092 286 &bfd_powerpc_archs[13]
188ac662 287 },
d62b1198
EZ
288 {
289 32, /* 32 bits in a word */
290 32, /* 32 bits in an address */
291 8, /* 8 bits in a byte */
292 bfd_arch_powerpc,
293 bfd_mach_ppc_e500,
294 "powerpc",
295 "powerpc:e500",
296 3,
b34976b6 297 FALSE,
d62b1198
EZ
298 powerpc_compatible,
299 bfd_default_scan,
b7761f11 300 bfd_arch_default_fill,
d62b1198
EZ
301 &bfd_powerpc_archs[14]
302 },
9239aded
AM
303 {
304 32, /* 32 bits in a word */
305 32, /* 32 bits in an address */
306 8, /* 8 bits in a byte */
307 bfd_arch_powerpc,
308 bfd_mach_ppc_e500mc,
309 "powerpc",
310 "powerpc:e500mc",
311 3,
312 FALSE, /* not the default */
313 powerpc_compatible,
314 bfd_default_scan,
b7761f11 315 bfd_arch_default_fill,
9239aded
AM
316 &bfd_powerpc_archs[15]
317 },
0dc93057
AM
318 {
319 64, /* 64 bits in a word */
320 64, /* 64 bits in an address */
321 8, /* 8 bits in a byte */
322 bfd_arch_powerpc,
323 bfd_mach_ppc_e500mc64,
324 "powerpc",
325 "powerpc:e500mc64",
326 3,
327 FALSE, /* not the default */
328 powerpc_compatible,
329 bfd_default_scan,
b7761f11 330 bfd_arch_default_fill,
0dc93057
AM
331 &bfd_powerpc_archs[16]
332 },
188ac662
GK
333 {
334 32, /* 32 bits in a word */
335 32, /* 32 bits in an address */
336 8, /* 8 bits in a byte */
337 bfd_arch_powerpc,
338 bfd_mach_ppc_860,
339 "powerpc",
340 "powerpc:MPC8XX",
341 3,
b34976b6 342 FALSE, /* not the default */
188ac662
GK
343 powerpc_compatible,
344 bfd_default_scan,
b7761f11 345 bfd_arch_default_fill,
0dc93057 346 &bfd_powerpc_archs[17]
1ca81d72
AM
347 },
348 {
349 32, /* 32 bits in a word */
350 32, /* 32 bits in an address */
351 8, /* 8 bits in a byte */
352 bfd_arch_powerpc,
353 bfd_mach_ppc_750,
354 "powerpc",
355 "powerpc:750",
356 3,
357 FALSE, /* not the default */
358 powerpc_compatible,
359 bfd_default_scan,
b7761f11 360 bfd_arch_default_fill,
ce3d2015
AM
361 &bfd_powerpc_archs[18]
362 },
363 {
364 32, /* 32 bits in a word */
365 32, /* 32 bits in an address */
366 8, /* 8 bits in a byte */
367 bfd_arch_powerpc,
368 bfd_mach_ppc_titan,
369 "powerpc",
370 "powerpc:titan",
371 3,
372 FALSE, /* not the default */
373 powerpc_compatible,
374 bfd_default_scan,
b7761f11 375 bfd_arch_default_fill,
aea77599
AM
376 &bfd_powerpc_archs[19]
377 },
378 {
379 64, /* 64 bits in a word */
380 64, /* 64 bits in an address */
381 8, /* 8 bits in a byte */
382 bfd_arch_powerpc,
383 bfd_mach_ppc_e5500,
384 "powerpc",
385 "powerpc:e5500",
386 3,
387 FALSE, /* not the default */
388 powerpc_compatible,
389 bfd_default_scan,
390 bfd_arch_default_fill,
391 &bfd_powerpc_archs[20]
392 },
393 {
394 64, /* 64 bits in a word */
395 64, /* 64 bits in an address */
396 8, /* 8 bits in a byte */
397 bfd_arch_powerpc,
398 bfd_mach_ppc_e6500,
399 "powerpc",
400 "powerpc:e6500",
401 3,
402 FALSE, /* not the default */
403 powerpc_compatible,
404 bfd_default_scan,
405 bfd_arch_default_fill,
899f54f5
AM
406 0
407 }
408};
This page took 0.565099 seconds and 4 git commands to generate.