]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: Support '-march=sm_61'
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 7 May 2025 14:02:16 +0000 (16:02 +0200)
committerThomas Schwinge <tschwinge@baylibre.com>
Tue, 22 Jul 2025 09:11:49 +0000 (11:11 +0200)
gcc/
* config/nvptx/nvptx-sm.def: Add '61'.
* config/nvptx/nvptx-gen.h: Regenerate.
* config/nvptx/nvptx-gen.opt: Likewise.
* config/nvptx/nvptx.cc (first_ptx_version_supporting_sm): Adjust.
* config/nvptx/nvptx.opt (-march-map=sm_61, -march-map=sm_62):
Likewise.
* config.gcc: Likewise.
* doc/invoke.texi (Nvidia PTX Options): Document '-march=sm_61'.
* config/nvptx/gen-multilib-matches-tests: Extend.
gcc/testsuite/
* gcc.target/nvptx/march-map=sm_61.c: Adjust.
* gcc.target/nvptx/march-map=sm_62.c: Likewise.
* gcc.target/nvptx/march=sm_61.c: New.
libgomp/
* testsuite/libgomp.c/declare-variant-3-sm61.c: New.
* testsuite/libgomp.c/declare-variant-3.h: Adjust.

(cherry picked from commit 7b53b88381179c5c8152bcb890460f66d9c88fac)

13 files changed:
gcc/config.gcc
gcc/config/nvptx/gen-multilib-matches-tests
gcc/config/nvptx/nvptx-gen.h
gcc/config/nvptx/nvptx-gen.opt
gcc/config/nvptx/nvptx-sm.def
gcc/config/nvptx/nvptx.cc
gcc/config/nvptx/nvptx.opt
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c
gcc/testsuite/gcc.target/nvptx/march=sm_61.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/declare-variant-3-sm61.c [new file with mode: 0644]
libgomp/testsuite/libgomp.c/declare-variant-3.h

index 5725704e06be1b3e13eefd0652215b84885d65d0..087aaa7be3719bab81343fffa68a6d41aac861ba 100644 (file)
@@ -5641,6 +5641,7 @@ case "${target}" in
                        #TODO 'sm_[...]' list per 'nvptx-sm.def'.
                        sm_30 | sm_35 | sm_37 \
                        | sm_52 | sm_53 \
+                       | sm_61 \
                        | sm_70 | sm_75 \
                        | sm_80 | sm_89 )
                                TM_MULTILIB_CONFIG="$TM_MULTILIB_CONFIG $nvptx_multilib"
index a07f19adbdb16b0c507704557dd0b9cb80a4479a..fbfae880a2deafe28062a530772bd35f1b43fe69 100644 (file)
@@ -18,6 +18,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -32,14 +33,15 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
 CMMC
 
-BEGIN '--with-arch=sm_30', '--with-multilib-list=sm_30,sm_35,sm_37,sm_52,sm_53,sm_70,sm_75,sm_80,sm_89'
+BEGIN '--with-arch=sm_30', '--with-multilib-list=sm_30,sm_35,sm_37,sm_52,sm_53,sm_61,sm_70,sm_75,sm_80,sm_89'
 SMOID sm_30
-SMOIL sm_30 sm_35 sm_37 sm_52 sm_53 sm_70 sm_75 sm_80 sm_89
+SMOIL sm_30 sm_35 sm_37 sm_52 sm_53 sm_61 sm_70 sm_75 sm_80 sm_89
 AEMM .=misa?sm_30
 CMMC
 
@@ -52,6 +54,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -65,6 +68,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -79,6 +83,7 @@ AEMM misa?sm_30=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -93,6 +98,7 @@ AEMM misa?sm_35=misa?sm_30
 AEMM misa?sm_35=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM misa?sm_75=misa?sm_80
 AEMM misa?sm_75=misa?sm_89
@@ -106,6 +112,7 @@ AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -119,19 +126,55 @@ AEMM misa?sm_37=misa?sm_30
 AEMM misa?sm_37=misa?sm_35
 AEMM misa?sm_37=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
 AEMM .=misa?sm_89
 CMMC
 
-BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_53=sm_30,sm_35,sm_37,sm_52,sm_70,sm_75,sm_80,sm_89'
+BEGIN '--with-arch=sm_53', '--with-multilib-list=sm_30,sm_35,sm_37,sm_52,sm_61,sm_70,sm_75,sm_80,sm_89'
 SMOID sm_53
-SMOIL sm_53 sm_30 sm_35 sm_37 sm_52 sm_70 sm_75 sm_80 sm_89
+SMOIL sm_53 sm_30 sm_35 sm_37 sm_52 sm_61 sm_70 sm_75 sm_80 sm_89
 AEMM .=misa?sm_53
 CMMC
 
 
+BEGIN '--with-arch=sm_61', '--with-multilib-list=sm_61,sm_30'
+SMOID sm_61
+SMOIL sm_61 sm_30
+AEMM misa?sm_30=misa?sm_35
+AEMM misa?sm_30=misa?sm_37
+AEMM misa?sm_30=misa?sm_52
+AEMM misa?sm_30=misa?sm_53
+AEMM .=misa?sm_61
+AEMM .=misa?sm_70
+AEMM .=misa?sm_75
+AEMM .=misa?sm_80
+AEMM .=misa?sm_89
+CMMC
+
+BEGIN '--with-arch=sm_61', '--with-multilib-list=sm_61,sm_37'
+SMOID sm_61
+SMOIL sm_61 sm_37
+AEMM misa?sm_37=misa?sm_30
+AEMM misa?sm_37=misa?sm_35
+AEMM misa?sm_37=misa?sm_52
+AEMM misa?sm_37=misa?sm_53
+AEMM .=misa?sm_61
+AEMM .=misa?sm_70
+AEMM .=misa?sm_75
+AEMM .=misa?sm_80
+AEMM .=misa?sm_89
+CMMC
+
+BEGIN '--with-arch=sm_61', '--with-multilib-list=sm_30,sm_35,sm_37,sm_52,sm_61,sm_70,sm_75,sm_80,sm_89'
+SMOID sm_61
+SMOIL sm_61 sm_30 sm_35 sm_37 sm_52 sm_53 sm_70 sm_75 sm_80 sm_89
+AEMM .=misa?sm_61
+CMMC
+
+
 BEGIN '--with-arch=sm_70', '--with-multilib-list=sm_70'
 SMOID sm_70
 SMOIL sm_70
@@ -140,6 +183,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -153,6 +197,7 @@ AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
 AEMM misa?sm_30=misa?sm_53
+AEMM misa?sm_30=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -166,6 +211,7 @@ AEMM misa?sm_53=misa?sm_30
 AEMM misa?sm_53=misa?sm_35
 AEMM misa?sm_53=misa?sm_37
 AEMM misa?sm_53=misa?sm_52
+AEMM misa?sm_53=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -178,6 +224,7 @@ SMOIL sm_70 sm_53 sm_30
 AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
+AEMM misa?sm_53=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -192,6 +239,7 @@ AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
 AEMM misa?sm_30=misa?sm_53
+AEMM misa?sm_30=misa?sm_61
 AEMM misa?sm_30=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -205,6 +253,7 @@ AEMM misa?sm_53=misa?sm_30
 AEMM misa?sm_53=misa?sm_35
 AEMM misa?sm_53=misa?sm_37
 AEMM misa?sm_53=misa?sm_52
+AEMM misa?sm_53=misa?sm_61
 AEMM misa?sm_53=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -217,6 +266,7 @@ SMOIL sm_75 sm_30 sm_53
 AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
+AEMM misa?sm_53=misa?sm_61
 AEMM misa?sm_53=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -232,6 +282,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -245,6 +296,7 @@ AEMM misa?sm_30=misa?sm_35
 AEMM misa?sm_30=misa?sm_37
 AEMM misa?sm_30=misa?sm_52
 AEMM misa?sm_30=misa?sm_53
+AEMM misa?sm_30=misa?sm_61
 AEMM misa?sm_30=misa?sm_70
 AEMM misa?sm_30=misa?sm_75
 AEMM .=misa?sm_80
@@ -259,6 +311,7 @@ AEMM misa?sm_75=misa?sm_35
 AEMM misa?sm_75=misa?sm_37
 AEMM misa?sm_75=misa?sm_52
 AEMM misa?sm_75=misa?sm_53
+AEMM misa?sm_75=misa?sm_61
 AEMM misa?sm_75=misa?sm_70
 AEMM .=misa?sm_80
 AEMM .=misa?sm_89
@@ -273,6 +326,7 @@ AEMM .=misa?sm_35
 AEMM .=misa?sm_37
 AEMM .=misa?sm_52
 AEMM .=misa?sm_53
+AEMM .=misa?sm_61
 AEMM .=misa?sm_70
 AEMM .=misa?sm_75
 AEMM .=misa?sm_80
@@ -286,6 +340,7 @@ AEMM misa?sm_52=misa?sm_30
 AEMM misa?sm_52=misa?sm_35
 AEMM misa?sm_52=misa?sm_37
 AEMM misa?sm_52=misa?sm_53
+AEMM misa?sm_52=misa?sm_61
 AEMM misa?sm_52=misa?sm_70
 AEMM misa?sm_52=misa?sm_75
 AEMM misa?sm_52=misa?sm_80
@@ -293,8 +348,8 @@ AEMM .=misa?sm_89
 CMMC
 
 
-BEGIN '--with-arch=sm_89', '--with-multilib-list=sm_89,sm_30,sm_35,sm_37,sm_52,sm_53,sm_70,sm_75,sm_80'
+BEGIN '--with-arch=sm_89', '--with-multilib-list=sm_89,sm_30,sm_35,sm_37,sm_52,sm_53,sm_61,sm_70,sm_75,sm_80'
 SMOID sm_89
-SMOIL sm_89 sm_30 sm_35 sm_37 sm_52 sm_53 sm_70 sm_75 sm_80
+SMOIL sm_89 sm_30 sm_35 sm_37 sm_52 sm_53 sm_61 sm_70 sm_75 sm_80
 AEMM .=misa?sm_89
 CMMC
index 893df41303e1ec5422cd2346d2e5cc019ff211bf..f5b989971ba9c2af9d53cefff64589e5db07c43c 100644 (file)
@@ -26,6 +26,7 @@
 #define TARGET_SM37 (ptx_isa_option >= PTX_ISA_SM37)
 #define TARGET_SM52 (ptx_isa_option >= PTX_ISA_SM52)
 #define TARGET_SM53 (ptx_isa_option >= PTX_ISA_SM53)
+#define TARGET_SM61 (ptx_isa_option >= PTX_ISA_SM61)
 #define TARGET_SM70 (ptx_isa_option >= PTX_ISA_SM70)
 #define TARGET_SM75 (ptx_isa_option >= PTX_ISA_SM75)
 #define TARGET_SM80 (ptx_isa_option >= PTX_ISA_SM80)
index f45e8efacb68fd4b18b95401158c4b0371571332..bbae32d6dd45c740f5c41e891b061344488222e8 100644 (file)
@@ -38,6 +38,9 @@ Enum(ptx_isa) String(sm_52) Value(PTX_ISA_SM52)
 EnumValue
 Enum(ptx_isa) String(sm_53) Value(PTX_ISA_SM53)
 
+EnumValue
+Enum(ptx_isa) String(sm_61) Value(PTX_ISA_SM61)
+
 EnumValue
 Enum(ptx_isa) String(sm_70) Value(PTX_ISA_SM70)
 
index 1485f89d9cc1054755277199ee19b361d889de83..9f9e86441311e7c6cc04f99c1687e9c7cb0b2c33 100644 (file)
@@ -25,6 +25,7 @@ NVPTX_SM (35, NVPTX_SM_SEP)
 NVPTX_SM (37, NVPTX_SM_SEP)
 NVPTX_SM (52, NVPTX_SM_SEP)
 NVPTX_SM (53, NVPTX_SM_SEP)
+NVPTX_SM (61, NVPTX_SM_SEP)
 NVPTX_SM (70, NVPTX_SM_SEP)
 NVPTX_SM (75, NVPTX_SM_SEP)
 NVPTX_SM (80, NVPTX_SM_SEP)
index d5827074f65abf891d643d3fdaedb3f1072132e3..b1c476e95f4fdf84707cd71bcbbd28790529f78d 100644 (file)
@@ -220,6 +220,8 @@ first_ptx_version_supporting_sm (enum ptx_isa sm)
       return PTX_VERSION_4_1;
     case PTX_ISA_SM53:
       return PTX_VERSION_4_2;
+    case PTX_ISA_SM61:
+      return PTX_VERSION_5_0;
     case PTX_ISA_SM70:
       return PTX_VERSION_6_0;
     case PTX_ISA_SM75:
index d53a7271873c3697f4026428ccca01cf36954d8f..d326ca4ad263c54e1d85683fada5a458c2a4a7f7 100644 (file)
@@ -88,10 +88,10 @@ march-map=sm_60
 Target RejectNegative Alias(misa=,sm_53)
 
 march-map=sm_61
-Target RejectNegative Alias(misa=,sm_53)
+Target RejectNegative Alias(misa=,sm_61)
 
 march-map=sm_62
-Target RejectNegative Alias(misa=,sm_53)
+Target RejectNegative Alias(misa=,sm_61)
 
 march-map=sm_70
 Target RejectNegative Alias(misa=,sm_70)
index 33adf6fd64cefc8745357cc345e2843276675651..72009c33cd0f74e04939d620820f2c6581e59ec4 100644 (file)
@@ -30659,6 +30659,7 @@ Generate code for the specified PTX ISA target architecture.
 Valid architecture strings are
 @samp{sm_30}, @samp{sm_35}, @samp{sm_37},
 @samp{sm_52}, @samp{sm_53},
+@samp{sm_61},
 @samp{sm_70}, @samp{sm_75},
 @samp{sm_80}, and @samp{sm_89}.
 The default depends on how the compiler has been configured, see
index 742e25d5bd8e4cd72908645b6b5f57815b01333f..d6e8ce967a34adce21eb05675f9411912f6aaaec 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options {-march-map=sm_61 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
 /* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_61$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
@@ -12,7 +12,7 @@
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 530
+#if __PTX_SM__ != 610
 #error wrong value for __PTX_SM__
 #endif
 
index 02ced4c0db7afaaf5ea249c1e556d05681a98781..ccce6f7f8594b6cc1f46bce9a0c85efd653b6c2e 100644 (file)
@@ -2,7 +2,7 @@
 /* { dg-options {-march-map=sm_62 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
 /* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_61$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
@@ -12,7 +12,7 @@
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 530
+#if __PTX_SM__ != 610
 #error wrong value for __PTX_SM__
 #endif
 
diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_61.c b/gcc/testsuite/gcc.target/nvptx/march=sm_61.c
new file mode 100644 (file)
index 0000000..d8bccb8
--- /dev/null
@@ -0,0 +1,19 @@
+/* { dg-do assemble } */
+/* { dg-options {-march=sm_61 -mptx=_} } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_61$} 1 } } */
+
+#if __PTX_ISA_VERSION_MAJOR__ != 7
+#error wrong value for __PTX_ISA_VERSION_MAJOR__
+#endif
+
+#if __PTX_ISA_VERSION_MINOR__ != 3
+#error wrong value for __PTX_ISA_VERSION_MINOR__
+#endif
+
+#if __PTX_SM__ != 610
+#error wrong value for __PTX_SM__
+#endif
+
+int dummy;
diff --git a/libgomp/testsuite/libgomp.c/declare-variant-3-sm61.c b/libgomp/testsuite/libgomp.c/declare-variant-3-sm61.c
new file mode 100644 (file)
index 0000000..e6941d3
--- /dev/null
@@ -0,0 +1,8 @@
+/* { dg-do link { target { offload_target_nvptx } } } */
+/* { dg-additional-options -foffload=nvptx-none } */
+/* { dg-additional-options "-foffload=-misa=sm_61 -foffload=-mptx=_" } */
+/* { dg-additional-options "-foffload=-fdump-tree-optimized" } */
+
+#include "declare-variant-3.h"
+
+/* { dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump "= f61 \\(\\);" "optimized" } } */
index c9c8f4a385fba6f61b76bc4081b2fe6d7c806a83..f5695a24b8115e216ebd1802df7e317f729a672e 100644 (file)
@@ -35,6 +35,13 @@ f53 (void)
   return 53;
 }
 
+__attribute__ ((noipa))
+int
+f61 (void)
+{
+  return 61;
+}
+
 __attribute__ ((noipa))
 int
 f70 (void)
@@ -68,6 +75,7 @@ f89 (void)
 #pragma omp declare variant (f37) match (device={isa("sm_37")})
 #pragma omp declare variant (f52) match (device={isa("sm_52")})
 #pragma omp declare variant (f53) match (device={isa("sm_53")})
+#pragma omp declare variant (f61) match (device={isa("sm_61")})
 #pragma omp declare variant (f70) match (device={isa("sm_70")})
 #pragma omp declare variant (f75) match (device={isa("sm_75")})
 #pragma omp declare variant (f80) match (device={isa("sm_80")})