-
- Downloads
amdgcn: Refactor device settings into a def file
Almost all device-specific settings are now centralised into gcn-devices.def
for the compiler, mkoffload, and libgomp. No longer will we have to touch 10
files in multiple places just to add another device without any exotic
features. (New ISAs and devices with incompatible metadata will continue to
need a bit more.)
In order to remove the device-specific conditionals in the code a new value
HSACO_ATTR_UNSUPPORTED has been added, indicating that the assembler will
reject any setting of that option.
This incorporates some of Tobias's patch from March 2024.
Co-Authored-By:
Tobias Burnus <tburnus@baylibre.com>
gcc/ChangeLog:
* config.gcc (amdgcn): Add gcn-device-macros.h to tm_file.
Add gcn-tables.opt to extra_options.
* config/gcn/gcn-hsa.h (NO_XNACK): Delete.
(NO_SRAM_ECC): Delete.
(SRAMOPT): Move definition to generated file gcn-device-macros.h.
(XNACKOPT): Likewise.
(ASM_SPEC): Redefine using generated values from gcn-device-macros.h.
* config/gcn/gcn-opts.h
(enum processor_type): Generate from gcn-devices.def.
(TARGET_VEGA10): Delete.
(TARGET_VEGA20): Delete.
(TARGET_GFX908): Delete.
(TARGET_GFX90a): Delete.
(TARGET_GFX90c): Delete.
(TARGET_GFX1030): Delete.
(TARGET_GFX1036): Delete.
(TARGET_GFX1100): Delete.
(TARGET_GFX1103): Delete.
(TARGET_XNACK): Redefine to allow for HSACO_ATTR_UNSUPPORTED.
(enum hsaco_attr_type): Add HSACO_ATTR_UNSUPPORTED.
(TARGET_TGSPLIT): New define.
* config/gcn/gcn.cc (gcn_devices): New constant table.
(gcn_option_override): Rework to use gcn_devices table.
(gcn_omp_device_kind_arch_isa): Likewise.
(output_file_start): Likewise.
(gcn_hsa_declare_function_name): Rework using TARGET_* macros.
* config/gcn/gcn.h (gcn_devices): Declare struct and table.
(TARGET_CPU_CPP_BUILTINS): Rework using gcn_devices.
* config/gcn/gcn.opt: Move enum data to generated file gcn-tables.opt.
Use new names for the default values.
* config/gcn/mkoffload.cc (EF_AMDGPU_MACH_AMDGCN_GFX900): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX906): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX908): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX90a): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX90c): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX1030): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX1036): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX1100): Delete.
(EF_AMDGPU_MACH_AMDGCN_GFX1103): Delete.
(enum elf_arch_code): Define using gcn-devices.def.
(get_arch): Rework using gcn-devices.def.
(main): Rework using gcn-devices.def
* config/gcn/t-gcn-hsa (gcn-tables.opt): Generate file.
(gcn-device-macros.h): Generate file.
* config/gcn/t-omp-device: Generate isa list from gcn-devices.def.
* config/gcn/gcn-devices.def: New file.
* config/gcn/gcn-tables.opt: New file.
* config/gcn/gcn-tables.opt.urls: New file.
* config/gcn/gen-gcn-device-macros.awk: New file.
* config/gcn/gen-opt-tables.awk: New file.
libgomp/ChangeLog:
* plugin/plugin-gcn.c (EF_AMDGPU_MACH): Generate from gcn-devices.def.
(gcn_gfx803_s): Delete.
(gcn_gfx900_s): Delete.
(gcn_gfx906_s): Delete.
(gcn_gfx908_s): Delete.
(gcn_gfx90a_s): Delete.
(gcn_gfx90c_s): Delete.
(gcn_gfx1030_s): Delete.
(gcn_gfx1036_s): Delete.
(gcn_gfx1100_s): Delete.
(gcn_gfx1103_s): Delete.
(gcn_isa_name_len): Delete.
(isa_hsa_name): Rename ...
(isa_name): ... to this, and rework using gcn-devices.def.
(isa_gcc_name): Delete.
(isa_code): Rework using gcn-devices.def.
(max_isa_vgprs): Rework using gcn-devices.def.
(isa_matches_agent): Update isa_name usage.
(GOMP_OFFLOAD_init_device): Improve diagnostic using the name.
Showing
- gcc/config.gcc 2 additions, 1 deletiongcc/config.gcc
- gcc/config/gcn/gcn-devices.def 143 additions, 0 deletionsgcc/config/gcn/gcn-devices.def
- gcc/config/gcn/gcn-hsa.h 5 additions, 18 deletionsgcc/config/gcn/gcn-hsa.h
- gcc/config/gcn/gcn-opts.h 10 additions, 21 deletionsgcc/config/gcn/gcn-opts.h
- gcc/config/gcn/gcn-tables.opt 52 additions, 0 deletionsgcc/config/gcn/gcn-tables.opt
- gcc/config/gcn/gcn-tables.opt.urls 2 additions, 0 deletionsgcc/config/gcn/gcn-tables.opt.urls
- gcc/config/gcn/gcn.cc 26 additions, 106 deletionsgcc/config/gcn/gcn.cc
- gcc/config/gcn/gcn.h 17 additions, 20 deletionsgcc/config/gcn/gcn.h
- gcc/config/gcn/gcn.opt 3 additions, 34 deletionsgcc/config/gcn/gcn.opt
- gcc/config/gcn/gen-gcn-device-macros.awk 110 additions, 0 deletionsgcc/config/gcn/gen-gcn-device-macros.awk
- gcc/config/gcn/gen-opt-tables.awk 55 additions, 0 deletionsgcc/config/gcn/gen-opt-tables.awk
- gcc/config/gcn/mkoffload.cc 44 additions, 70 deletionsgcc/config/gcn/mkoffload.cc
- gcc/config/gcn/t-gcn-hsa 7 additions, 0 deletionsgcc/config/gcn/t-gcn-hsa
- gcc/config/gcn/t-omp-device 2 additions, 2 deletionsgcc/config/gcn/t-omp-device
- libgomp/plugin/plugin-gcn.c 29 additions, 113 deletionslibgomp/plugin/plugin-gcn.c
Loading
Please register or sign in to comment