gcc/libgomp
Andrew Stubbs a6b26e5ea0 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.
2024-10-22 11:07:05 +00:00
..
config OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
plugin amdgcn: Refactor device settings into a def file 2024-10-22 11:07:05 +00:00
testsuite Add libgomp.oacc-fortran/acc_on_device-1-4.f 2024-10-16 16:15:40 +02:00
.gitattributes libgomp: Fixes + cleanup for OpenACC's Fortran module + openacc_lib.h 2020-02-19 09:13:44 +01:00
acc_prof.h Update copyright years. 2024-01-03 12:19:35 +01:00
acinclude.m4 libgomp: fix typo in mold linker detection 2022-06-28 10:35:32 +02:00
aclocal.m4 libgomp: Regenerate configure files with automake 1.15.1 2020-10-02 12:08:47 +02:00
affinity-fmt.c Update copyright years. 2024-01-03 12:19:35 +01:00
affinity.c Update copyright years. 2024-01-03 12:19:35 +01:00
alloc.c Update copyright years. 2024-01-03 12:19:35 +01:00
allocator.c OpenMP: Allocate directive for static vars, clean up 2024-10-07 10:45:14 +02:00
atomic.c Update copyright years. 2024-01-03 12:19:35 +01:00
barrier.c Update copyright years. 2024-01-03 12:19:35 +01:00
basic-allocator.c Update copyright years. 2024-01-03 12:19:35 +01:00
ChangeLog Daily bump. 2024-10-19 00:19:43 +00:00
ChangeLog.graphite
config.h.in Refactor '-ldl' handling for libgomp proper and plugins 2022-05-12 15:11:30 +02:00
configure libgomp: Fix up FLOCK fallback handling [PR113192] 2024-01-10 13:32:02 +01:00
configure.ac libgomp: Fix up FLOCK fallback handling [PR113192] 2024-01-10 13:32:02 +01:00
configure.tgt libgomp: Define config_path for hppa*-*-linux* 2024-02-11 20:23:14 +00:00
critical.c Update copyright years. 2024-01-03 12:19:35 +01:00
env.c libgomp, openmp: Add ompx_gnu_pinned_mem_alloc 2024-07-01 10:59:59 +00:00
error.c Update copyright years. 2024-01-03 12:19:35 +01:00
fortran.c OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
hashtab.h Update copyright years. 2024-01-03 12:19:35 +01:00
icv-device.c Update copyright years. 2024-01-03 12:19:35 +01:00
icv.c Update copyright years. 2024-01-03 12:19:35 +01:00
iter_ull.c Update copyright years. 2024-01-03 12:19:35 +01:00
iter.c Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp_f.h.in Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp_g.h Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp-plugin.c Update copyright years. 2024-01-03 12:19:35 +01:00
libgomp-plugin.h OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
libgomp.h OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
libgomp.map OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
libgomp.spec.in
libgomp.texi Fortran: Use OpenACC's acc_on_device builtin, fix OpenMP' __builtin_is_initial_device 2024-10-13 10:18:31 +02:00
lock.c Update copyright years. 2024-01-03 12:19:35 +01:00
loop_ull.c Update copyright years. 2024-01-03 12:19:35 +01:00
loop.c Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.am build: Derive object names in make_sunver.pl 2024-05-07 13:14:05 +02:00
Makefile.in build: Derive object names in make_sunver.pl 2024-05-07 13:14:05 +02:00
oacc-async.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-cuda.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-host.c OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
oacc-init.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-int.h Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-mem.c OpenACC 2.7: Adjust acc_map_data/acc_unmap_data interaction with reference counters 2024-04-16 09:04:11 +00:00
oacc-parallel.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-plugin.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-plugin.h Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-profiling.c Update copyright years. 2024-01-03 12:19:35 +01:00
oacc-target.c
omp_lib.f90.in OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
omp_lib.h.in OpenMP: Fix omp_get_device_from_uid, minor cleanup 2024-09-23 15:58:39 +02:00
omp.h.in OpenMP: Add get_device_from_uid/omp_get_uid_from_device routines 2024-09-20 09:25:33 +02:00
openacc_lib.h OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} 2024-02-27 17:30:38 +01:00
openacc.f90 OpenACC: Add Fortran routines acc_{alloc,free,hostptr,deviceptr,memcpy_{to,from}_device*} 2024-02-27 17:30:38 +01:00
openacc.h Update copyright years. 2024-01-03 12:19:35 +01:00
ordered.c Update copyright years. 2024-01-03 12:19:35 +01:00
parallel.c Update copyright years. 2024-01-03 12:19:35 +01:00
priority_queue.c Update copyright years. 2024-01-03 12:19:35 +01:00
priority_queue.h Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
scope.c Update copyright years. 2024-01-03 12:19:35 +01:00
sections.c Update copyright years. 2024-01-03 12:19:35 +01:00
secure_getenv.h Update copyright years. 2024-01-03 12:19:35 +01:00
single.c Update copyright years. 2024-01-03 12:19:35 +01:00
splay-tree.c Update copyright years. 2024-01-03 12:19:35 +01:00
splay-tree.h Update copyright years. 2024-01-03 12:19:35 +01:00
target-indirect.c Update copyright years. 2024-01-03 12:19:35 +01:00
target.c libgomp: with USM, init 'link' variables with host address 2024-09-24 17:41:39 +02:00
task.c Update copyright years. 2024-01-03 12:19:35 +01:00
taskloop.c Update copyright years. 2024-01-03 12:19:35 +01:00
team.c Update copyright years. 2024-01-03 12:19:35 +01:00
teams.c Update copyright years. 2024-01-03 12:19:35 +01:00
work.c Update copyright years. 2024-01-03 12:19:35 +01:00