]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
GCN: Use generic instead of specific arch for default-built multilibs
authorTobias Burnus <tburnus@baylibre.com>
Fri, 28 Nov 2025 13:56:30 +0000 (14:56 +0100)
committerTobias Burnus <tburnus@baylibre.com>
Fri, 28 Nov 2025 13:56:30 +0000 (14:56 +0100)
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.

gcc/config.gcc
gcc/config/gcn/gcn.opt
gcc/doc/install.texi

index 7035542639696ec6908914eab5520b5f824abbe0..e17354b3e6548dffb84f053d218df5691b7ffda5 100644 (file)
@@ -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}"
index 99d6aeb2b30f17cdebe8d1fb58749be065ddef5e..1b2d5cca289e3342ec65b978b7c9841883c70ad9 100644 (file)
@@ -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
index 7f4321c424b9cf14dfe907725e9478e0a0685a28..1ca0119fe76e58602190697d420ba2d86cdb8f77 100644 (file)
@@ -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