https://gcc.gnu.org/g:b03a916cebd68a8023bea164af239e0872f02024

commit r16-5695-gb03a916cebd68a8023bea164af239e0872f02024
Author: Tobias Burnus <[email protected]>
Date:   Fri Nov 28 14:56:30 2025 +0100

    GCN: Use generic instead of specific arch for default-built multilibs
    
    GCC 15 and ROCm 6.4.0 (released April/May 2025) support generic archs.
    Thus, by moving to generic archs, the number of multilibs build by GCC
    can be reduced - while the number of supported devices increases.
    
    This commit now replaces the specific gfx... by gfx{9,9-4,10-3,11}-generic,
    keeping gfx908 and gfx09a as no generic exists for those.
    
    When building for a device without a multilib but the generic one exists,
    there is a diagnostic like:
      gcn mkoffload: fatal error: GCC was built without library support for
      ‘-march=gfx1150’; consider compiling for the associated generic
      architecture ‘-march=gfx11-generic’ instead
    
    As gfx900 is no longer build by default, gfx90a was picked as new
    default device.
    
    gcc/ChangeLog:
    
            * config.gcc (amdgcn-*-*): Use gfx90a for 'with_arch'.
            For TM_MULTILIB_CONFIG, replace specific archs by
            gfx{9,9-4,10-3,11}-generic, keep gfx90{8,a}.
            * config/gcn/gcn.opt (march=, mtune=): Use gfx90a.
            * doc/install.texi (amdgcn): Update accordingly.

Diff:
---
 gcc/config.gcc         |  4 ++--
 gcc/config/gcn/gcn.opt |  4 ++--
 gcc/doc/install.texi   | 19 ++++++++++---------
 3 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 703554263969..e17354b3e654 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4640,14 +4640,14 @@ case "${target}" in
                                exit 1
                        fi
                done
-               [ "x$with_arch" = x ] && with_arch=gfx900
+               [ "x$with_arch" = x ] && with_arch=gfx90a
 
                case "x${with_multilib_list}" in
                x | xno)
                        TM_MULTILIB_CONFIG=
                        ;;
                xdefault | xyes)
-                       TM_MULTILIB_CONFIG=`echo 
"gfx900,gfx906,gfx908,gfx90a,gfx90c,gfx1030,gfx1036,gfx1100,gfx1103" | sed 
"s/${with_arch},\?//;s/,$//"`
+                       TM_MULTILIB_CONFIG=`echo 
"gfx908,gfx90a,gfx9-generic,gfx9-4-generic,gfx10-3-generic,gfx11-generic" | sed 
"s/${with_arch},\?//;s/,$//"`
                        ;;
                *)
                        TM_MULTILIB_CONFIG="${with_multilib_list}"
diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt
index 99d6aeb2b30f..1b2d5cca289e 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -22,11 +22,11 @@ HeaderInclude
 config/gcn/gcn-opts.h
 
 march=
-Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) 
Var(gcn_arch) Init(PROCESSOR_GFX900)
+Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) 
Var(gcn_arch) Init(PROCESSOR_GFX90A)
 Specify the name of the target GPU.
 
 mtune=
-Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) 
Var(gcn_tune) Init(PROCESSOR_GFX900)
+Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) 
Var(gcn_tune) Init(PROCESSOR_GFX90A)
 Specify the name of the target GPU.
 
 m32
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 7f4321c424b9..1ca0119fe76e 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -4084,16 +4084,17 @@ supported ISAs as multilib; use 
@code{--with-multilib-list=} to tailor the built
 multilibs.  Note that mixing ISAs in the same binary is not supported and gives
 a linker error.
 
-By default, multilib support is built for @code{gfx900}, @code{gfx906},
-@code{gfx908}, @code{gfx90a}, @code{gfx90c}, @code{gfx1030}, @code{gfx1036},
-@code{gfx1100} and @code{gfx1103}.  The default multilib configuration
-requires LLVM 15 or newer.  LLVM 13.0.1 or LLVM 14 can be used by specifying
-a @code{--with-multilib-list=} that does not list any GFX 11 device nor
-@code{gfx1036}.  At least LLVM 16 is required for @code{gfx1150} and
-@code{gfx1151}, LLVM 18 for @code{gfx942}, LLVM 19 for the generic
+By default, multilib support is built for @code{gfx908}, @code{gfx90a},
 @code{gfx9-generic}, @code{gfx9-4-generic}, @code{gfx10-3-generic}, and
-@code{gfx11-generic} targets and for @code{gfx1152}, while LLVM 20 is required
-for @code{gfx950} and @code{gfx1153}.
+@code{gfx11-generic}, which covers all supported archs.  The default multilib
+configuration requires LLVM 19 or newer.  LLVM 13.0.1 or LLVM 14 can be used by
+specifying a @code{--with-multilib-list=} that only lists GFX9 or GFX10-3
+devices, while LLVM 15 is required for GFX 11 device and @code{gfx1036}.
+At least LLVM 16 is required for @code{gfx1150} and @code{gfx1151},
+LLVM 18 for @code{gfx942}, LLVM 19 for the generic @code{gfx9-generic},
+@code{gfx9-4-generic}, @code{gfx10-3-generic}, and @code{gfx11-generic}
+targets and for @code{gfx1152}, while LLVM 20 is required for
+@code{gfx950} and @code{gfx1153}.
 
 The supported ISA architectures are listed in the GCC manual. The generic
 ISA targets @code{gfx9-generic}, @code{gfx10-3-generic}, and

Reply via email to