aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Stubbs <ams@baylibre.com>2024-08-05 15:14:17 +0000
committerAndrew Stubbs <ams@baylibre.com>2024-09-02 13:08:46 +0000
commit57af0022073f11bc300709b3717069f6d616c6ac (patch)
tree4feaee649b3238c1e4bcd0bb15f645b31cc7cec1 /gcc
parent78dc2e2575c602c62d50a9522ea976020a5bf7aa (diff)
downloadgcc-57af0022073f11bc300709b3717069f6d616c6ac.zip
gcc-57af0022073f11bc300709b3717069f6d616c6ac.tar.gz
gcc-57af0022073f11bc300709b3717069f6d616c6ac.tar.bz2
amdgcn: remove gfx803 "Fiji" support
The gfx803 "Fiji" device was deprecated in GCC 14, removed from LLVM 18, and hasn't worked properly with the drivers since about ROCm 4. This patch removes the device from GCC options and documentation, and removes the direct mentions from the internals. The TARGET_GCN3 support in the back-end is now unused and can be removed (in a follow-up patch). gcc/ChangeLog: * config.gcc (amdgcn-*-*): Remove "fiji" from with_arch checks. * config/gcn/gcn-hsa.h (ABI_VERSION_SPEC): Remove fiji alternative. (NO_XNACK): Likewise. (NO_SRAM_ECC): Likewise. (ASM_SPEC): Remove "%{}" around ABI_VERSION_SPEC. * config/gcn/gcn-opts.h (enum processor_type): Remove PROCESSOR_FIJI. (TARGET_FIJI): Delete. * config/gcn/gcn.cc (gcn_option_override): Remove Fiji. (gcn_omp_device_kind_arch_isa): Likewise. (output_file_start): Likewise. * config/gcn/gcn.h (TARGET_CPU_CPP_BUILTINS): Likewise. * config/gcn/gcn.opt (gpu_type): Likewise. (march, mtune): Change default to PROCESSOR_VEGA10. * config/gcn/mkoffload.cc (EF_AMDGPU_MACH_AMDGCN_GFX803): Delete. (copy_early_debug_info): Remove elf_flags_actual. Use ELFABIVERSION_AMDGPU_HSA_V4 unconditionally. (get_arch): Remove Fiji. (main): Remove gfx803. * config/gcn/t-omp-device (omp-device-properties-gcn): Remove fiji and gfx803. * doc/install.texi (amdgcn*-*-*): Remove fiji and special instructions. * doc/invoke.texi: Remove fiji. libgomp/ChangeLog: * libgomp.texi: Remove fiji and gfx803. * testsuite/libgomp.c/declare-variant-4.h: Remove fiji and gfx803. * testsuite/libgomp.c/declare-variant-4-fiji.c: Removed. * testsuite/libgomp.c/declare-variant-4-gfx803.c: Removed.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config.gcc2
-rw-r--r--gcc/config/gcn/gcn-hsa.h13
-rw-r--r--gcc/config/gcn/gcn-opts.h2
-rw-r--r--gcc/config/gcn/gcn.cc19
-rw-r--r--gcc/config/gcn/gcn.h7
-rw-r--r--gcc/config/gcn/gcn.opt7
-rw-r--r--gcc/config/gcn/mkoffload.cc17
-rw-r--r--gcc/config/gcn/t-omp-device2
-rw-r--r--gcc/doc/install.texi8
-rw-r--r--gcc/doc/invoke.texi5
10 files changed, 18 insertions, 64 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 08291f4..f09ce9f 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4618,7 +4618,7 @@ case "${target}" in
for which in arch tune; do
eval "val=\$with_$which"
case ${val} in
- "" | fiji | gfx900 | gfx906 | gfx908 | gfx90a | gfx90c | gfx1030 | gfx1036 | gfx1100 | gfx1103)
+ "" | gfx900 | gfx906 | gfx908 | gfx90a | gfx90c | gfx1030 | gfx1036 | gfx1100 | gfx1103)
# OK
;;
*)
diff --git a/gcc/config/gcn/gcn-hsa.h b/gcc/config/gcn/gcn-hsa.h
index 0322055..7a1bfad 100644
--- a/gcc/config/gcn/gcn-hsa.h
+++ b/gcc/config/gcn/gcn-hsa.h
@@ -79,21 +79,18 @@ extern unsigned int gcn_local_sym_hash (const char *name);
default; however, when debugging symbols are turned on, mkoffload.cc
writes a new AMD GPU object file and the ABI version needs to be the
same. - LLVM <= 17 defaults to 4 while LLVM >= 18 defaults to 5.
- GCC supports LLVM >= 13.0.1 and only LLVM >= 14 supports version 5.
- Note that Fiji is only supported with LLVM <= 17 as version 3 is no longer
- supported in LLVM >= 18. */
-#define ABI_VERSION_SPEC "march=fiji:--amdhsa-code-object-version=3;" \
- "!march=*|march=*:--amdhsa-code-object-version=4"
+ GCC supports LLVM >= 13.0.1 and only LLVM >= 14 supports version 5. */
+#define ABI_VERSION_SPEC "--amdhsa-code-object-version=4"
/* Note that the XNACK and SRAM-ECC settings must match those in mkoffload.cc
as the latter creates new ELF object file when debugging is enabled and
the ELF flags (e_flags) of that generated file must be identical to those
generated by the compiler. */
-#define NO_XNACK "march=fiji:;march=gfx1030:;march=gfx1036:;march=gfx1100:;march=gfx1103:;" \
+#define NO_XNACK "march=gfx1030:;march=gfx1036:;march=gfx1100:;march=gfx1103:;" \
/* These match the defaults set in gcn.cc. */ \
"!mxnack*|mxnack=default:%{march=gfx900|march=gfx906|march=gfx908:-mattr=-xnack};"
-#define NO_SRAM_ECC "!march=*:;march=fiji:;march=gfx900:;march=gfx906:;march=gfx90c:;"
+#define NO_SRAM_ECC "!march=*:;march=gfx900:;march=gfx906:;march=gfx90c:;"
/* In HSACOv4 no attribute setting means the binary supports "any" hardware
configuration. The name of the attribute also changed. */
@@ -103,7 +100,7 @@ extern unsigned int gcn_local_sym_hash (const char *name);
/* Use LLVM assembler and linker options. */
#define ASM_SPEC "-triple=amdgcn--amdhsa " \
"%{march=*:-mcpu=%*} " \
- "%{" ABI_VERSION_SPEC "} " \
+ ABI_VERSION_SPEC " " \
"%{" NO_XNACK XNACKOPT "} " \
"%{" NO_SRAM_ECC SRAMOPT "} " \
"%{march=gfx1030|march=gfx1036|march=gfx1100|march=gfx1103:-mattr=+wavefrontsize64} " \
diff --git a/gcc/config/gcn/gcn-opts.h b/gcc/config/gcn/gcn-opts.h
index 24e856b..a896a80 100644
--- a/gcc/config/gcn/gcn-opts.h
+++ b/gcc/config/gcn/gcn-opts.h
@@ -20,7 +20,6 @@
/* Which processor to generate code or schedule for. */
enum processor_type
{
- PROCESSOR_FIJI, // gfx803
PROCESSOR_VEGA10, // gfx900
PROCESSOR_VEGA20, // gfx906
PROCESSOR_GFX908,
@@ -32,7 +31,6 @@ enum processor_type
PROCESSOR_GFX1103
};
-#define TARGET_FIJI (gcn_arch == PROCESSOR_FIJI)
#define TARGET_VEGA10 (gcn_arch == PROCESSOR_VEGA10)
#define TARGET_VEGA20 (gcn_arch == PROCESSOR_VEGA20)
#define TARGET_GFX908 (gcn_arch == PROCESSOR_GFX908)
diff --git a/gcc/config/gcn/gcn.cc b/gcc/config/gcn/gcn.cc
index 17316a7..89aab6f 100644
--- a/gcc/config/gcn/gcn.cc
+++ b/gcc/config/gcn/gcn.cc
@@ -133,8 +133,7 @@ gcn_option_override (void)
if (!flag_pic)
flag_pic = flag_pie;
- gcn_isa = (gcn_arch == PROCESSOR_FIJI ? ISA_GCN3
- : gcn_arch == PROCESSOR_VEGA10 ? ISA_GCN5
+ gcn_isa = (gcn_arch == PROCESSOR_VEGA10 ? ISA_GCN5
: gcn_arch == PROCESSOR_VEGA20 ? ISA_GCN5
: gcn_arch == PROCESSOR_GFX908 ? ISA_CDNA1
: gcn_arch == PROCESSOR_GFX90a ? ISA_CDNA2
@@ -164,17 +163,15 @@ gcn_option_override (void)
acc_lds_size = 32768;
}
- /* gfx803 "Fiji", gfx1030 and gfx1100 do not support XNACK. */
- if (gcn_arch == PROCESSOR_FIJI
- || gcn_arch == PROCESSOR_GFX1030
+ /* gfx1030 and gfx1100 do not support XNACK. */
+ if (gcn_arch == PROCESSOR_GFX1030
|| gcn_arch == PROCESSOR_GFX1036
|| gcn_arch == PROCESSOR_GFX1100
|| gcn_arch == PROCESSOR_GFX1103)
{
if (flag_xnack == HSACO_ATTR_ON)
error ("%<-mxnack=on%> is incompatible with %<-march=%s%>",
- (gcn_arch == PROCESSOR_FIJI ? "fiji"
- : gcn_arch == PROCESSOR_GFX1030 ? "gfx1030"
+ (gcn_arch == PROCESSOR_GFX1030 ? "gfx1030"
: gcn_arch == PROCESSOR_GFX1036 ? "gfx1036"
: gcn_arch == PROCESSOR_GFX1100 ? "gfx1100"
: gcn_arch == PROCESSOR_GFX1103 ? "gfx1103"
@@ -190,7 +187,6 @@ gcn_option_override (void)
if (flag_xnack == HSACO_ATTR_DEFAULT)
switch (gcn_arch)
{
- case PROCESSOR_FIJI:
case PROCESSOR_VEGA10:
case PROCESSOR_VEGA20:
case PROCESSOR_GFX908:
@@ -3050,8 +3046,6 @@ gcn_omp_device_kind_arch_isa (enum omp_device_kind_arch_isa trait,
case omp_device_arch:
return strcmp (name, "amdgcn") == 0 || strcmp (name, "gcn") == 0;
case omp_device_isa:
- if (strcmp (name, "fiji") == 0 || strcmp (name, "gfx803") == 0)
- return gcn_arch == PROCESSOR_FIJI;
if (strcmp (name, "gfx900") == 0)
return gcn_arch == PROCESSOR_VEGA10;
if (strcmp (name, "gfx906") == 0)
@@ -6587,11 +6581,6 @@ output_file_start (void)
const char *cpu;
switch (gcn_arch)
{
- case PROCESSOR_FIJI:
- cpu = "gfx803";
- xnack = "";
- sram_ecc = "";
- break;
case PROCESSOR_VEGA10:
cpu = "gfx900";
sram_ecc = "";
diff --git a/gcc/config/gcn/gcn.h b/gcc/config/gcn/gcn.h
index bd2afa6..a48fdc8 100644
--- a/gcc/config/gcn/gcn.h
+++ b/gcc/config/gcn/gcn.h
@@ -34,12 +34,7 @@
builtin_define ("__RDNA3__"); \
else \
gcc_unreachable (); \
- if (TARGET_FIJI) \
- { \
- builtin_define ("__fiji__"); \
- builtin_define ("__gfx803__"); \
- } \
- else if (TARGET_VEGA10) \
+ if (TARGET_VEGA10) \
builtin_define ("__gfx900__"); \
else if (TARGET_VEGA20) \
builtin_define ("__gfx906__"); \
diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt
index 3317c49..69ecca8 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -26,9 +26,6 @@ Name(gpu_type) Type(enum processor_type)
GCN GPU type to use:
EnumValue
-Enum(gpu_type) String(fiji) Value(PROCESSOR_FIJI)
-
-EnumValue
Enum(gpu_type) String(gfx900) Value(PROCESSOR_VEGA10)
EnumValue
@@ -56,11 +53,11 @@ EnumValue
Enum(gpu_type) String(gfx1103) Value(PROCESSOR_GFX1103)
march=
-Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_FIJI)
+Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_VEGA10)
Specify the name of the target GPU.
mtune=
-Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_FIJI)
+Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_VEGA10)
Specify the name of the target GPU.
m32
diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc
index 810298a..b8d9818 100644
--- a/gcc/config/gcn/mkoffload.cc
+++ b/gcc/config/gcn/mkoffload.cc
@@ -49,8 +49,6 @@
#undef ELFABIVERSION_AMDGPU_HSA_V4
#define ELFABIVERSION_AMDGPU_HSA_V4 2
-#undef EF_AMDGPU_MACH_AMDGCN_GFX803
-#define EF_AMDGPU_MACH_AMDGCN_GFX803 0x2a
#undef EF_AMDGPU_MACH_AMDGCN_GFX900
#define EF_AMDGPU_MACH_AMDGCN_GFX900 0x2c
#undef EF_AMDGPU_MACH_AMDGCN_GFX906
@@ -352,18 +350,12 @@ copy_early_debug_info (const char *infile, const char *outfile)
/* We only support host relocations of x86_64, for now. */
gcc_assert (ehdr.e_machine == EM_X86_64);
- /* Fiji devices use HSACOv3 regardless of the assembler. */
- uint32_t elf_flags_actual = (elf_arch == EF_AMDGPU_MACH_AMDGCN_GFX803
- ? 0 : elf_flags);
-
/* Patch the correct elf architecture flag into the file. */
ehdr.e_ident[7] = ELFOSABI_AMDGPU_HSA;
- ehdr.e_ident[8] = (elf_arch == EF_AMDGPU_MACH_AMDGCN_GFX803
- ? ELFABIVERSION_AMDGPU_HSA_V3
- : ELFABIVERSION_AMDGPU_HSA_V4);
+ ehdr.e_ident[8] = ELFABIVERSION_AMDGPU_HSA_V4;
ehdr.e_type = ET_REL;
ehdr.e_machine = EM_AMDGPU;
- ehdr.e_flags = elf_arch | elf_flags_actual;
+ ehdr.e_flags = elf_arch | elf_flags;
/* Load the section headers so we can walk them later. */
Elf64_Shdr *sections = (Elf64_Shdr *)xmalloc (sizeof (Elf64_Shdr)
@@ -853,9 +845,7 @@ compile_native (const char *infile, const char *outfile, const char *compiler,
static int
get_arch (const char *str, const char *with_arch_str)
{
- if (strcmp (str, "fiji") == 0)
- return EF_AMDGPU_MACH_AMDGCN_GFX803;
- else if (strcmp (str, "gfx900") == 0)
+ if (strcmp (str, "gfx900") == 0)
return EF_AMDGPU_MACH_AMDGCN_GFX900;
else if (strcmp (str, "gfx906") == 0)
return EF_AMDGPU_MACH_AMDGCN_GFX906;
@@ -1076,7 +1066,6 @@ main (int argc, char **argv)
and ASM_SPEC. */
switch (elf_arch)
{
- case EF_AMDGPU_MACH_AMDGCN_GFX803:
case EF_AMDGPU_MACH_AMDGCN_GFX1030:
case EF_AMDGPU_MACH_AMDGCN_GFX1036:
case EF_AMDGPU_MACH_AMDGCN_GFX1100:
diff --git a/gcc/config/gcn/t-omp-device b/gcc/config/gcn/t-omp-device
index b92e19b..233da0f 100644
--- a/gcc/config/gcn/t-omp-device
+++ b/gcc/config/gcn/t-omp-device
@@ -1,4 +1,4 @@
omp-device-properties-gcn: $(srcdir)/config/gcn/gcn.cc
echo kind: gpu > $@
echo arch: amdgcn gcn >> $@
- echo isa: fiji gfx803 gfx900 gfx906 gfx908 gfx90a gfx90c gfx1030 gfx1036 gfx1100 gfx1103 >> $@
+ echo isa: gfx900 gfx906 gfx908 gfx90a gfx90c gfx1030 gfx1036 gfx1100 gfx1103 >> $@
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index f871227..d22ccdd 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1276,7 +1276,7 @@ default set of libraries is selected based on the value of
@option{--target}.
@item amdgcn*-*-*
-@var{list} is a comma separated list of ISA names (allowed values: @code{fiji},
+@var{list} is a comma separated list of ISA names (allowed values:
@code{gfx900}, @code{gfx906}, @code{gfx908}, @code{gfx90a}, @code{gfx90c},
@code{gfx1030}, @code{gfx1036}, @code{gfx1100}, @code{gfx1103}).
It ought not include the name of the default
@@ -3965,12 +3965,6 @@ To run the binaries, install the HSA Runtime from the
@file{libexec/gcc/amdhsa-amdhsa/@var{version}/gcn-run} to launch them
on the GPU.
-To enable support for GCN3 Fiji devices (gfx803), GCC has to be configured with
-@option{--with-arch=@code{fiji}} or
-@option{--with-multilib-list=@code{fiji},...}. Note that support for Fiji
-devices has been removed in ROCm 4.0 and support in LLVM was deprecated and has
-been removed in LLVM 18.
-
@html
<hr />
@end html
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 1dede82..43afb09 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -22049,11 +22049,6 @@ Set architecture type or tuning for @var{gpu}. Supported values for @var{gpu}
are
@table @samp
-@item fiji
-Compile for GCN3 Fiji devices (gfx803). Support deprecated; availablility
-depends on how GCC has been configured, see @option{--with-arch} and
-@option{--with-multilib-list}.
-
@item gfx900
Compile for GCN5 Vega 10 devices (gfx900).