nvptx: Default at least to '-mptx=6.3'

gcc/
	* config/nvptx/nvptx.cc (default_ptx_version_option): Default at
	least to '-mptx=6.3'.
	* doc/invoke.texi (Nvidia PTX Options): Update '-mptx=[...]'.
	gcc/testsuite/
	* gcc.target/nvptx/march-map=sm_30.c: Adjust.
	* gcc.target/nvptx/march-map=sm_32.c: Likewise.
	* gcc.target/nvptx/march-map=sm_35.c: Likewise.
	* gcc.target/nvptx/march-map=sm_37.c: Likewise.
	* gcc.target/nvptx/march-map=sm_50.c: Likewise.
	* gcc.target/nvptx/march=sm_30.c: Likewise.
	* gcc.target/nvptx/march=sm_35.c: Likewise.
	* gcc.target/nvptx/march=sm_37.c: Likewise.
This commit is contained in:
Thomas Schwinge 2025-03-20 14:21:26 +01:00
parent f775bb892c
commit 5450afcfb7
10 changed files with 20 additions and 17 deletions

View file

@ -245,6 +245,9 @@ default_ptx_version_option (void)
warp convergence. */
res = MAX (res, PTX_VERSION_6_0);
/* Pick at least 6.3. */
res = MAX (res, PTX_VERSION_6_3);
/* For sm_52+, pick at least 7.3, to enable PTX 'alloca'. */
if (ptx_isa_option >= PTX_ISA_SM52)
res = MAX (res, PTX_VERSION_7_3);

View file

@ -30410,7 +30410,7 @@ Valid version strings are
@samp{7.0}, @samp{7.3}, and @samp{7.8}.
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.
least @samp{6.3}, 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_30 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_32 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_35 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_37 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_37$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_50 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_37$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_30 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_35 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_35$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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_37 -mptx=_} } */
/* { dg-additional-options -save-temps } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.0$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.version 6\.3$} 1 } } */
/* { dg-final { scan-assembler-times {(?n)^ \.target sm_37$} 1 } } */
#if __PTX_ISA_VERSION_MAJOR__ != 6
#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