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'.
This commit is contained in:
Thomas Schwinge 2024-11-12 16:26:15 +01:00
parent ecb99f6978
commit b7f1686449
19 changed files with 54 additions and 50 deletions

View 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;

View 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__};

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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