aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2025-05-07 16:02:16 +0200
committerThomas Schwinge <tschwinge@baylibre.com>2025-07-21 16:28:47 +0200
commitaed9e682c0f8dc1df660a90a57995f9f431601fe (patch)
tree4a0442ba3b77a77c07ab2deefda8256415a1082a /gcc
parent33c7505fda084698618c88165b20bf2c5b850e9c (diff)
downloadgcc-aed9e682c0f8dc1df660a90a57995f9f431601fe.zip
gcc-aed9e682c0f8dc1df660a90a57995f9f431601fe.tar.gz
gcc-aed9e682c0f8dc1df660a90a57995f9f431601fe.tar.bz2
nvptx: Support '-march=sm_61'
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)
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config.gcc1
-rw-r--r--gcc/config/nvptx/gen-multilib-matches-tests67
-rw-r--r--gcc/config/nvptx/nvptx-gen.h1
-rw-r--r--gcc/config/nvptx/nvptx-gen.opt3
-rw-r--r--gcc/config/nvptx/nvptx-sm.def1
-rw-r--r--gcc/config/nvptx/nvptx.cc2
-rw-r--r--gcc/config/nvptx/nvptx.opt4
-rw-r--r--gcc/doc/invoke.texi1
-rw-r--r--gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c4
-rw-r--r--gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c4
-rw-r--r--gcc/testsuite/gcc.target/nvptx/march=sm_61.c19
11 files changed, 95 insertions, 12 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5725704..087aaa7 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -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"
diff --git a/gcc/config/nvptx/gen-multilib-matches-tests b/gcc/config/nvptx/gen-multilib-matches-tests
index a07f19a..fbfae88 100644
--- a/gcc/config/nvptx/gen-multilib-matches-tests
+++ b/gcc/config/nvptx/gen-multilib-matches-tests
@@ -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
diff --git a/gcc/config/nvptx/nvptx-gen.h b/gcc/config/nvptx/nvptx-gen.h
index 893df41..f5b9899 100644
--- a/gcc/config/nvptx/nvptx-gen.h
+++ b/gcc/config/nvptx/nvptx-gen.h
@@ -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)
diff --git a/gcc/config/nvptx/nvptx-gen.opt b/gcc/config/nvptx/nvptx-gen.opt
index f45e8ef..bbae32d 100644
--- a/gcc/config/nvptx/nvptx-gen.opt
+++ b/gcc/config/nvptx/nvptx-gen.opt
@@ -39,6 +39,9 @@ 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)
EnumValue
diff --git a/gcc/config/nvptx/nvptx-sm.def b/gcc/config/nvptx/nvptx-sm.def
index 1485f89..9f9e864 100644
--- a/gcc/config/nvptx/nvptx-sm.def
+++ b/gcc/config/nvptx/nvptx-sm.def
@@ -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)
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 48345e0..777168d 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -226,6 +226,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:
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index d53a727..d326ca4 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -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)
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 78a1a41..7c2fa2c 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -30685,6 +30685,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
diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c
index 742e25d..d6e8ce9 100644
--- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c
+++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c
@@ -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
diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c
index 02ced4c..ccce6f7 100644
--- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c
+++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c
@@ -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
index 0000000..d8bccb8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nvptx/march=sm_61.c
@@ -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;