xref: /netbsd-src/external/gpl3/binutils.old/dist/bfd/cpu-amdgcn.c (revision c42dbd0ed2e61fe6eda8590caa852ccf34719964)
1*c42dbd0eSchristos /* BFD support for the AMDGCN GPU architecture.
2*c42dbd0eSchristos 
3*c42dbd0eSchristos    Copyright (C) 2019-2022 Free Software Foundation, Inc.
4*c42dbd0eSchristos 
5*c42dbd0eSchristos    This file is part of BFD, the Binary File Descriptor library.
6*c42dbd0eSchristos 
7*c42dbd0eSchristos    This program is free software; you can redistribute it and/or modify
8*c42dbd0eSchristos    it under the terms of the GNU General Public License as published by
9*c42dbd0eSchristos    the Free Software Foundation; either version 3 of the License, or
10*c42dbd0eSchristos    (at your option) any later version.
11*c42dbd0eSchristos 
12*c42dbd0eSchristos    This program is distributed in the hope that it will be useful,
13*c42dbd0eSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
14*c42dbd0eSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15*c42dbd0eSchristos    GNU General Public License for more details.
16*c42dbd0eSchristos 
17*c42dbd0eSchristos    You should have received a copy of the GNU General Public License
18*c42dbd0eSchristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19*c42dbd0eSchristos 
20*c42dbd0eSchristos #include "sysdep.h"
21*c42dbd0eSchristos #include "bfd.h"
22*c42dbd0eSchristos #include "libbfd.h"
23*c42dbd0eSchristos 
24*c42dbd0eSchristos #define N(MACHINE, PRINTABLE_NAME, DEFAULT, NEXT)       \
25*c42dbd0eSchristos   {                                                     \
26*c42dbd0eSchristos     32, /* 32 bits in a word */                         \
27*c42dbd0eSchristos     64, /* 64 bits in an address */                     \
28*c42dbd0eSchristos     8,  /* 8 bits in a byte */                          \
29*c42dbd0eSchristos     bfd_arch_amdgcn,                                    \
30*c42dbd0eSchristos     MACHINE,                                            \
31*c42dbd0eSchristos     "amdgcn",                                           \
32*c42dbd0eSchristos     PRINTABLE_NAME,                                     \
33*c42dbd0eSchristos     3, /* section align power */                        \
34*c42dbd0eSchristos     DEFAULT,                                            \
35*c42dbd0eSchristos     bfd_default_compatible,                             \
36*c42dbd0eSchristos     bfd_default_scan,                                   \
37*c42dbd0eSchristos     bfd_arch_default_fill,                              \
38*c42dbd0eSchristos     NEXT,                                               \
39*c42dbd0eSchristos     0                                                   \
40*c42dbd0eSchristos   }
41*c42dbd0eSchristos 
42*c42dbd0eSchristos #define NN(index) (&arch_info_struct[index])
43*c42dbd0eSchristos 
44*c42dbd0eSchristos static const bfd_arch_info_type arch_info_struct[] =
45*c42dbd0eSchristos {
46*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx904, "amdgcn:gfx904", false, NN (1)),
47*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx906, "amdgcn:gfx906", false, NN (2)),
48*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx908, "amdgcn:gfx908", false, NN (3)),
49*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx90a, "amdgcn:gfx90a", false, NN (4)),
50*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1010, "amdgcn:gfx1010", false, NN (5)),
51*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1011, "amdgcn:gfx1011", false, NN (6)),
52*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1012, "amdgcn:gfx1012", false, NN (7)),
53*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1030, "amdgcn:gfx1030", false, NN (8)),
54*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1031, "amdgcn:gfx1031", false, NN (9)),
55*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NULL)
56*c42dbd0eSchristos };
57*c42dbd0eSchristos 
58*c42dbd0eSchristos const bfd_arch_info_type bfd_amdgcn_arch =
59*c42dbd0eSchristos   N (bfd_mach_amdgcn_gfx900, "amdgcn:gfx900", true, NN (0));
60