cpu-amdgcn.c 2.6 KB

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