diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-11-12 16:26:15 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2025-01-08 23:30:53 +0100 |
commit | b7f168644966d451fbe46ee9d06c9763a539c41b (patch) | |
tree | daba1603f2e3bc584961d38fc2519a479d9d88a1 /gcc | |
parent | ecb99f6978bb8e97de046952d3beb7a0d030fb25 (diff) | |
download | gcc-b7f168644966d451fbe46ee9d06c9763a539c41b.zip gcc-b7f168644966d451fbe46ee9d06c9763a539c41b.tar.gz gcc-b7f168644966d451fbe46ee9d06c9763a539c41b.tar.bz2 |
nvptx: For '-march=sm_52' and higher, default at least to '-mptx=7.3'
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'.
Diffstat (limited to 'gcc')
19 files changed, 54 insertions, 50 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index eb948d5..5860b3d 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -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; diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 480c48c..4583181 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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__}; diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c index f37d13a..02724781 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_52.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_53.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_53.c index 3fc4e00..b0f7f20 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_53.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_53.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_60.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_60.c index 63e8355..2e83f4b 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_60.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_60.c @@ -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 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 6e047e6..742e25d 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_61.c @@ -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 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 1763835..02ced4c 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_62.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_70.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_70.c index 7223bba..f5312e3 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_70.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_70.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_72.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_72.c index c5e2afd..21d78ba 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_72.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_72.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_75.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_75.c index 3c036ab..dede159 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_75.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_75.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_80.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_80.c index caa0679..fc33378 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_80.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_80.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_86.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_86.c index 3636c89..bcdab8c 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_86.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_86.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march-map=sm_87.c b/gcc/testsuite/gcc.target/nvptx/march-map=sm_87.c index c298e61..231bdbf 100644 --- a/gcc/testsuite/gcc.target/nvptx/march-map=sm_87.c +++ b/gcc/testsuite/gcc.target/nvptx/march-map=sm_87.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_52.c b/gcc/testsuite/gcc.target/nvptx/march=sm_52.c index 515f950..bd21b73 100644 --- a/gcc/testsuite/gcc.target/nvptx/march=sm_52.c +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_52.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_53.c b/gcc/testsuite/gcc.target/nvptx/march=sm_53.c index 3155c71..befb7b3 100644 --- a/gcc/testsuite/gcc.target/nvptx/march=sm_53.c +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_53.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_70.c b/gcc/testsuite/gcc.target/nvptx/march=sm_70.c index 6bde639..5218d1e 100644 --- a/gcc/testsuite/gcc.target/nvptx/march=sm_70.c +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_70.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_75.c b/gcc/testsuite/gcc.target/nvptx/march=sm_75.c index 2ec77ac..abffc42 100644 --- a/gcc/testsuite/gcc.target/nvptx/march=sm_75.c +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_75.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/march=sm_80.c b/gcc/testsuite/gcc.target/nvptx/march=sm_80.c index 024d75e..fbbb857 100644 --- a/gcc/testsuite/gcc.target/nvptx/march=sm_80.c +++ b/gcc/testsuite/gcc.target/nvptx/march=sm_80.c @@ -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 diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=_.c b/gcc/testsuite/gcc.target/nvptx/mptx=_.c index dcff462..80823a0 100644 --- a/gcc/testsuite/gcc.target/nvptx/mptx=_.c +++ b/gcc/testsuite/gcc.target/nvptx/mptx=_.c @@ -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 |