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