]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
nvptx: For '-march=sm_52' and higher, default at least to '-mptx=7.3'
authorThomas Schwinge <tschwinge@baylibre.com>
Tue, 12 Nov 2024 15:26:15 +0000 (16:26 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Wed, 8 Jan 2025 22:30:53 +0000 (23:30 +0100)
PR target/65181
gcc/
* config/nvptx/nvptx.cc (default_ptx_version_option): For
'-march=sm_52' and higher, default at least to '-mptx=7.3'.
* doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'.
gcc/testsuite/
* gcc.target/nvptx/march-map=sm_52.c: Adjust.
* gcc.target/nvptx/march-map=sm_53.c: Likewise.
* gcc.target/nvptx/march-map=sm_60.c: Likewise.
* gcc.target/nvptx/march-map=sm_61.c: Likewise.
* gcc.target/nvptx/march-map=sm_62.c: Likewise.
* gcc.target/nvptx/march-map=sm_70.c: Likewise.
* gcc.target/nvptx/march-map=sm_72.c: Likewise.
* gcc.target/nvptx/march-map=sm_75.c: Likewise.
* gcc.target/nvptx/march-map=sm_80.c: Likewise.
* gcc.target/nvptx/march-map=sm_86.c: Likewise.
* gcc.target/nvptx/march-map=sm_87.c: Likewise.
* gcc.target/nvptx/march=sm_52.c: Likewise.
* gcc.target/nvptx/march=sm_53.c: Likewise.
* gcc.target/nvptx/march=sm_70.c: Likewise.
* gcc.target/nvptx/march=sm_75.c: Likewise.
* gcc.target/nvptx/march=sm_80.c: Likewise.
* gcc.target/nvptx/mptx=_.c: Use '-march=sm_89'.

19 files changed:
gcc/config/nvptx/nvptx.cc
gcc/doc/invoke.texi
gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_53.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_60.c
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-map=sm_70.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_72.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_75.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_80.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_86.c
gcc/testsuite/gcc.target/nvptx/march-map=sm_87.c
gcc/testsuite/gcc.target/nvptx/march=sm_52.c
gcc/testsuite/gcc.target/nvptx/march=sm_53.c
gcc/testsuite/gcc.target/nvptx/march=sm_70.c
gcc/testsuite/gcc.target/nvptx/march=sm_75.c
gcc/testsuite/gcc.target/nvptx/march=sm_80.c
gcc/testsuite/gcc.target/nvptx/mptx=_.c

index eb948d5b07e11fe9ec99c75907b31a965eaa9bf5..5860b3df6dd753d25912d2637013f5c3243097d5 100644 (file)
@@ -245,6 +245,10 @@ default_ptx_version_option (void)
      warp convergence.  */
   res = MAX (res, PTX_VERSION_6_0);
 
+  /* For sm_52+, pick at least 7.3.  */
+  if (ptx_isa_option >= PTX_ISA_SM52)
+    res = MAX (res, PTX_VERSION_7_3);
+
   /* Verify that we pick a version that supports the sm.  */
   gcc_assert (first <= res);
   return res;
index 480c48c5372aa6b3d26edc95773ce69bfa9a845c..4583181f4f53121641c45017dffec961b0602d9a 100644 (file)
@@ -30212,9 +30212,9 @@ Valid version strings are
 @samp{4.1}, @samp{4.2},
 @samp{6.0}, @samp{6.3},
 @samp{7.0}, @samp{7.3}, and @samp{7.8}.
-The default PTX ISA version is 6.0, unless a higher
-version is required for specified PTX ISA target architecture via
-option @option{-march=}.
+The default PTX ISA version is the one that added support for the
+selected PTX ISA target architecture, see @option{-march=}, but at
+least @samp{6.0}, or @samp{7.3} for @option{-march=sm_52} and higher.
 
 This option sets the values of the preprocessor macros
 @code{__PTX_ISA_VERSION_MAJOR__} and @code{__PTX_ISA_VERSION_MINOR__};
index f37d13a8b088da53a11ba088c23f150485fa3ace..027247810ecde714e599dba34359511d81ef66ec 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_52 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_52$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 3fc4e00bfd5f3dd2273ad126a980017ca300e905..b0f7f20c0d85fedc7255a4babfd2eea938ea952d 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_53 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 63e8355adf9eeaa0f433f8005f815c827ae861d8..2e83f4b5436ba77b7ddb6f7f4fcde3b127868a60 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_60 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 6e047e63f469d526ca6f924c965607ad4ce58013..742e25d5bd8e4cd72908645b6b5f57815b01333f 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_61 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 1763835bfd5a435b355e8e3baf459b29ac6b8d96..02ced4c0db7afaaf5ea249c1e556d05681a98781 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_62 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 7223bba664add3bc252dc5c09258fff08b8703bc..f5312e396d09abd83f6d725b61866d69067b7e43 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_70 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_70$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index c5e2afd600d34eb60f0cb9feea7b4d52f272de89..21d78ba10becaf976f03985aff6439b0accbe5a5 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_72 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_70$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 3c036ab11f53c70f2208045383765f831b1f4dad..dede15998e2be209d121cf9eba37995e14eec440 100644 (file)
@@ -1,10 +1,10 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_75 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.3$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_75$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
index caa06796925e11916de8dcdcb141b536862bf8bc..fc33378d489030d117a3ffd073350a887b5a42bd 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_80 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_80$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 3636c899eefd14b8e745c16a6f4ebd9af8b79063..bcdab8c445fbc7952af006f7933ee4b5cd3bfeaa 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_86 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_80$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index c298e619c678cdaebd6ec9ac1b83675cb5f2abcd..231bdbf5219b19c6fecdf118d935117b4759b34a 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march-map=sm_87 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_80$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 515f950af475fbb3169231b21a4f1d72d2c4d046..bd21b7339779fe22d5e8153809b0e4173ed9670f 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march=sm_52 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_52$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 3155c714bc5b4b587810dd74046dba4681655695..befb7b3139ec6b391e9215d3f2666169b2922f8a 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march=sm_53 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_53$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 6bde63938056145c13946eb7120303953c37292e..5218d1eeefcf42f855a222ca7cc9b6d912167f3a 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march=sm_70 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_70$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index 2ec77ac70d3ebad637e2a12d84b77b4b7672d2c5..abffc422257fa84d2171d7a0e9b6899975e2177f 100644 (file)
@@ -1,10 +1,10 @@
 /* { dg-do assemble } */
 /* { dg-options {-march=sm_75 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       6\.3$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_75$} 1 } } */
 
-#if __PTX_ISA_VERSION_MAJOR__ != 6
+#if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
index 024d75ece4c9a7b51188c822cd926d6fa4177276..fbbb8573c54d72abb7cd669d054bde50e8bfcf1a 100644 (file)
@@ -1,14 +1,14 @@
 /* { dg-do assemble } */
 /* { dg-options {-march=sm_80 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.0$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.3$} 1 } } */
 /* { dg-final { scan-assembler-times {(?n)^    \.target        sm_80$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 3
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
index dcff462ba0cb7a1f00688bf38c02de6d605047a8..80823a03aa222e5544cc6fba709013e5601d7deb 100644 (file)
@@ -1,18 +1,18 @@
 /* { dg-do assemble } */
-/* { dg-options {-mptx=3.1 -march=sm_80 -mptx=_} } */
+/* { dg-options {-mptx=3.1 -march=sm_89 -mptx=_} } */
 /* { dg-additional-options -save-temps } */
-/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.0$} 1 } } */
-/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_80$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.version       7\.8$} 1 } } */
+/* { dg-final { scan-assembler-times {(?n)^    \.target        sm_89$} 1 } } */
 
 #if __PTX_ISA_VERSION_MAJOR__ != 7
 #error wrong value for __PTX_ISA_VERSION_MAJOR__
 #endif
 
-#if __PTX_ISA_VERSION_MINOR__ != 0
+#if __PTX_ISA_VERSION_MINOR__ != 8
 #error wrong value for __PTX_ISA_VERSION_MINOR__
 #endif
 
-#if __PTX_SM__ != 800
+#if __PTX_SM__ != 890
 #error wrong value for __PTX_SM__
 #endif