From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1461) id 502B03858C52; Thu, 19 Oct 2023 08:47:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 502B03858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697705279; bh=gkZcH1UIhvPuXvFexgbEZgtC3EhsqgvQKKfWvDcOx1E=; h=From:To:Subject:Date:From; b=cigzlfaKESjmjC9kQhXMluM4jCU75TlWRs+wXnHH8nFRVIboeliTYCwe41fOvaj8i /S2OKts3KIINiynsJr01L/CVF2FHX11mW+EtJUerlIR0DOBj4iAx47RTtSIjvcW0N2 JjnTZogt3CQCBQJkjbTsP1pSSQdwCuxHXBq89IBA= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Andrew Stubbs To: gcc-cvs@gcc.gnu.org Subject: [gcc r14-4734] amdgcn: deprecate Fiji device and multilib X-Act-Checkin: gcc X-Git-Author: Andrew Stubbs X-Git-Refname: refs/heads/master X-Git-Oldrev: 8f4bbdc28df6e87a7ad5ec5ca191a7a836a4f016 X-Git-Newrev: 56ed1055b2f40ac162ae8d382280ac07a33f789f Message-Id: <20231019084759.502B03858C52@sourceware.org> Date: Thu, 19 Oct 2023 08:47:59 +0000 (GMT) List-Id: https://gcc.gnu.org/g:56ed1055b2f40ac162ae8d382280ac07a33f789f commit r14-4734-g56ed1055b2f40ac162ae8d382280ac07a33f789f Author: Andrew Stubbs Date: Wed Oct 18 16:59:42 2023 +0100 amdgcn: deprecate Fiji device and multilib LLVM wants to remove it, which breaks our build. This patch means that most users won't notice that change, when it comes, and those that do will have chosen to enable Fiji explicitly. I'm selecting gfx900 as the new default as that's the least likely for users to want, which means most users will specify -march explicitly, which means we'll be free to change the default again, when we need to, without breaking anybody's makefiles. gcc/ChangeLog: * config.gcc (amdgcn): Switch default to --with-arch=gfx900. Implement support for --with-multilib-list. * config/gcn/t-gcn-hsa: Likewise. * doc/install.texi: Likewise. * doc/invoke.texi: Mark Fiji deprecated. Diff: --- gcc/config.gcc | 14 +++++++++++++- gcc/config/gcn/t-gcn-hsa | 8 ++++++-- gcc/doc/install.texi | 19 +++++++++++++++++-- gcc/doc/invoke.texi | 4 +++- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/gcc/config.gcc b/gcc/config.gcc index 37311fcd0750..9c397156868a 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -4538,7 +4538,19 @@ case "${target}" in ;; esac done - [ "x$with_arch" = x ] && with_arch=fiji + [ "x$with_arch" = x ] && with_arch=gfx900 + + case "x${with_multilib_list}" in + x | xno) + TM_MULTILIB_CONFIG= + ;; + xdefault | xyes) + TM_MULTILIB_CONFIG=`echo "gfx900,gfx906,gfx908,gfx90a" | sed "s/${with_arch},\?//;s/,$//"` + ;; + *) + TM_MULTILIB_CONFIG="${with_multilib_list}" + ;; + esac ;; hppa*-*-*) diff --git a/gcc/config/gcn/t-gcn-hsa b/gcc/config/gcn/t-gcn-hsa index ea27122e4846..18db70753568 100644 --- a/gcc/config/gcn/t-gcn-hsa +++ b/gcc/config/gcn/t-gcn-hsa @@ -42,8 +42,12 @@ ALL_HOST_OBJS += gcn-run.o gcn-run$(exeext): gcn-run.o +$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $< -ldl -MULTILIB_OPTIONS = march=gfx900/march=gfx906/march=gfx908/march=gfx90a -MULTILIB_DIRNAMES = gfx900 gfx906 gfx908 gfx90a +empty := +space := $(empty) $(empty) +comma := , +multilib_list := $(subst $(comma),$(space),$(TM_MULTILIB_CONFIG)) +MULTILIB_OPTIONS = $(subst $(space),/,$(addprefix march=,$(multilib_list))) +MULTILIB_DIRNAMES = $(multilib_list) gcn-tree.o: $(srcdir)/config/gcn/gcn-tree.cc $(COMPILE) $< diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 31f2234640f8..4035e8020b2e 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -1236,8 +1236,8 @@ sysv, aix. @itemx --without-multilib-list Specify what multilibs to build. @var{list} is a comma separated list of values, possibly consisting of a single value. Currently only implemented -for aarch64*-*-*, arm*-*-*, loongarch*-*-*, riscv*-*-*, sh*-*-* and -x86-64-*-linux*. The accepted values and meaning for each target is given +for aarch64*-*-*, amdgcn*-*-*, arm*-*-*, loongarch*-*-*, riscv*-*-*, sh*-*-* +and x86-64-*-linux*. The accepted values and meaning for each target is given below. @table @code @@ -1250,6 +1250,15 @@ default run-time library will be built. If @var{list} is 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}, +@code{gfx900}, @code{gfx906}, @code{gfx908}, @code{gfx90a}). 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 specified, then the default set of +libraries is selected. + @item arm*-*-* @var{list} is a comma separated list of @code{aprofile} and @code{rmprofile} to build multilibs for A or R and M architecture @@ -3922,6 +3931,12 @@ 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 is deprecated and will +be removed in the future. + @html
@end html diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 9b5ff4570277..8bbe1139c947 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -21097,7 +21097,9 @@ are @table @samp @item fiji -Compile for GCN3 Fiji devices (gfx803). +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).