]> git.ipfire.org Git - thirdparty/gcc.git/commit
gcn: Add experimental MI300 (gfx942) support
authorTobias Burnus <tburnus@baylibre.com>
Tue, 10 Jun 2025 13:12:47 +0000 (15:12 +0200)
committerTobias Burnus <tburnus@baylibre.com>
Tue, 10 Jun 2025 19:57:46 +0000 (21:57 +0200)
commit5e75ec7168fd3ea5b7791ed67f25a29b44967fc3
tree132e10e3c703441086932549d645df57dc8afa3a
parent7704131525574cd28bf3f779da1e1057c46a1f25
gcn: Add experimental MI300 (gfx942) support

As gfx942 and gfx950 belong to gfx9-4-generic, the latter two are also added.
Note that there are no specific optimizations for MI300, yet.

For none of the mentioned devices, any multilib is build by default; use
'--with-multilib-list=' when configuring GCC to build them alongside.
gfx942 was added in LLVM (and its mc assembler, used by GCC) in version 18,
generic support in LLVM 19 and gfx950 in LLVM 20.

gcc/ChangeLog:

* config/gcn/gcn-devices.def: Add gfx942, gfx950 and gfx9-4-generic.
* config/gcn/gcn-opts.h (TARGET_CDNA3, TARGET_CDNA3_PLUS,
TARGET_GLC_NAME, TARGET_TARGET_SC_CACHE): Define.
(TARGET_ARCHITECTED_FLAT_SCRATCH): Use also for CDNA3.
* config/gcn/gcn.h (gcn_isa): Add ISA_CDNA3 to the enum.
* config/gcn/gcn.cc (print_operand): Update 'g' to use
TARGET_GLC_NAME; add 'G' to print TARGET_GLC_NAME unconditionally.
* config/gcn/gcn-valu.md (scatter, gather): Use TARGET_GLC_NAME.
* config/gcn/gcn.md: Use %G<num> instead of glc; use 'buffer_inv sc1'
for TARGET_TARGET_SC_CACHE.
* doc/invoke.texi (march): Add gfx942, gfx950 and gfx9-4-generic.
* doc/install.texi (amdgcn*-*-*): Add gfx942, gfx950 and gfx9-4-generic.
* config/gcn/gcn-tables.opt: Regenerate.

libgomp/ChangeLog:

* testsuite/libgomp.c/declare-variant-4.h (gfx942): New variant function.
* testsuite/libgomp.c/declare-variant-4-gfx942.c: New test.

(cherry picked from commit 37b454b7e171bd8a792cbe4c57ea0f9702afa22d)
gcc/config/gcn/gcn-devices.def
gcc/config/gcn/gcn-opts.h
gcc/config/gcn/gcn-tables.opt
gcc/config/gcn/gcn-valu.md
gcc/config/gcn/gcn.cc
gcc/config/gcn/gcn.h
gcc/config/gcn/gcn.md
gcc/doc/install.texi
gcc/doc/invoke.texi
libgomp/testsuite/libgomp.c/declare-variant-4-gfx942.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/declare-variant-4.h