As a user reported, --with=arch= did not support the newer devices,
as we forgot to update the list.

While we still have lists to update, this one can be replaced by
checking directly against the .def file.

There was another list that we didn't update - in install.texi:
https://gcc.gnu.org/install/configure.html#with-multilib-list
[We had only updated:
https://gcc.gnu.org/install/specific.html#amdgcn-x-amdhsa ]

OK for mainline - and for backporting to GCC 15?

Tobias
gcn: Update --with-arch= for newer archs

Replace hard-coded list of supported devices by directly checking
config/gcn/gcn-devices.def.

gcc/ChangeLog:

        * config.gcc (--with-{arch,tune}): Use .def file to validate gcn
        processor names.
        * doc/install.texi (amdgcn*-*-*): Update list of devices supported
	by --with-arch/--with-tune.

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 1e386a469e0..8365b917068 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4611,15 +4611,13 @@ case "${target}" in
 
 		for which in arch tune; do
 			eval "val=\$with_$which"
-			case ${val} in
-			"" | gfx900 | gfx906 | gfx908 | gfx90a | gfx90c | gfx1030 | gfx1036 | gfx1100 | gfx1103)
-				# OK
-				;;
-			*)
+			if test x"$val" != x \
+			   && ! grep -q "GCN_DEVICE($val," \
+					"${srcdir}/config/gcn/gcn-devices.def";
+			then
 				echo "Unknown cpu used in --with-$which=$val." 1>&2
 				exit 1
-				;;
-			esac
+			fi
 		done
 		[ "x$with_arch" = x ] && with_arch=gfx900
 
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index ff083360be2..fb921b326f1 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1342,9 +1342,13 @@ default set of libraries is selected based on the value of
 
 @item amdgcn*-*-*
 @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
+@code{gfx900}, @code{gfx902}, @code{gfx904}, @code{gfx906}, @code{gfx908},
+@code{gfx909}, @code{gfx90a}, @code{gfx90c}, @code{gfx9-generic},
+@code{gfx1030}, @code{gfx1031}, @code{gfx1032}, @code{gfx1033},
+@code{gfx1034}, @code{gfx1035}, @code{gfx1036}, @code{gfx10-3-generic},
+@code{gfx1100}, @code{gfx1101}, @code{gfx1102}, @code{gfx1103},
+@code{gfx1150}, @code{gfx1151}, @code{gfx1152}, @code{gfx1153},
+@code{gfx11-generic}).  It ought not include the name of the default
 ISA, specified via @option{--with-arch}.  If @var{list} is empty, then there
 will be no multilibs and only the default run-time library will be built.  If
 @var{list} is @code{default} or @option{--with-multilib-list=} is not

Reply via email to