diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-11-12 17:37:44 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2024-12-06 12:30:20 +0100 |
commit | 2fdc8cc97ee716b822dfed9e4bb287b7c3832543 (patch) | |
tree | 4f1e01ae0b8b0253ae952d022caaaa23678b02d7 /gcc | |
parent | 7cff338e5ae478cf841a4394741587bdb6ca76a8 (diff) | |
download | gcc-2fdc8cc97ee716b822dfed9e4bb287b7c3832543.zip gcc-2fdc8cc97ee716b822dfed9e4bb287b7c3832543.tar.gz gcc-2fdc8cc97ee716b822dfed9e4bb287b7c3832543.tar.bz2 |
nvptx: Support '-mptx=7.8'
gcc/
* config/nvptx/nvptx-opts.h (enum ptx_version): Add
'PTX_VERSION_7_8'.
* config/nvptx/nvptx.cc (ptx_version_to_string)
(ptx_version_to_number): Adjust.
* config/nvptx/nvptx.h (TARGET_PTX_7_8): New.
* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
'7.8' for 'PTX_VERSION_7_8'.
* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.8'.
gcc/testsuite/
* gcc.target/nvptx/mptx=7.8.c: New.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/nvptx/nvptx-opts.h | 3 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.cc | 4 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.h | 1 | ||||
-rw-r--r-- | gcc/config/nvptx/nvptx.opt | 3 | ||||
-rw-r--r-- | gcc/doc/invoke.texi | 2 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/nvptx/mptx=7.8.c | 19 |
6 files changed, 30 insertions, 2 deletions
diff --git a/gcc/config/nvptx/nvptx-opts.h b/gcc/config/nvptx/nvptx-opts.h index 1277f21..7b55086 100644 --- a/gcc/config/nvptx/nvptx-opts.h +++ b/gcc/config/nvptx/nvptx-opts.h @@ -42,7 +42,8 @@ enum ptx_version PTX_VERSION_4_2, PTX_VERSION_6_0, PTX_VERSION_6_3, - PTX_VERSION_7_0 + PTX_VERSION_7_0, + PTX_VERSION_7_8 }; #endif diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 93402bf..65d339b 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -265,6 +265,8 @@ ptx_version_to_string (enum ptx_version v) return "6.3"; case PTX_VERSION_7_0: return "7.0"; + case PTX_VERSION_7_8: + return "7.8"; default: gcc_unreachable (); } @@ -287,6 +289,8 @@ ptx_version_to_number (enum ptx_version v, bool major_p) return major_p ? 6 : 3; case PTX_VERSION_7_0: return major_p ? 7 : 0; + case PTX_VERSION_7_8: + return major_p ? 7 : 8; default: gcc_unreachable (); } diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index 7b7e172..5d914c4 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -95,6 +95,7 @@ #define TARGET_PTX_6_0 (ptx_version_option >= PTX_VERSION_6_0) #define TARGET_PTX_6_3 (ptx_version_option >= PTX_VERSION_6_3) #define TARGET_PTX_7_0 (ptx_version_option >= PTX_VERSION_7_0) +#define TARGET_PTX_7_8 (ptx_version_option >= PTX_VERSION_7_8) /* Registers. Since ptx is a virtual target, we just define a few hard registers for special purposes and leave pseudos unallocated. diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt index 4d14eda..842cbbbe 100644 --- a/gcc/config/nvptx/nvptx.opt +++ b/gcc/config/nvptx/nvptx.opt @@ -143,6 +143,9 @@ EnumValue Enum(ptx_version) String(7.0) Value(PTX_VERSION_7_0) EnumValue +Enum(ptx_version) String(7.8) Value(PTX_VERSION_7_8) + +EnumValue Enum(ptx_version) String(_) Value(PTX_VERSION_default) mptx= diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 92728a7..8271e64 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -30075,7 +30075,7 @@ Valid version strings are @samp{3.1}, @samp{4.1}, @samp{4.2}, @samp{6.0}, @samp{6.3}, -and @samp{7.0}. +@samp{7.0}, 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=}. diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=7.8.c b/gcc/testsuite/gcc.target/nvptx/mptx=7.8.c new file mode 100644 index 0000000..d80bdba --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/mptx=7.8.c @@ -0,0 +1,19 @@ +/* { dg-do assemble } */ +/* { dg-options {-march=sm_30 -mptx=7.8} } */ +/* { dg-additional-options -save-temps } */ +/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.8$} 1 } } */ +/* { dg-final { scan-assembler-times {(?n)^ \.target sm_30$} 1 } } */ + +#if __PTX_ISA_VERSION_MAJOR__ != 7 +#error wrong value for __PTX_ISA_VERSION_MAJOR__ +#endif + +#if __PTX_ISA_VERSION_MINOR__ != 8 +#error wrong value for __PTX_ISA_VERSION_MINOR__ +#endif + +#if __PTX_SM__ != 300 +#error wrong value for __PTX_SM__ +#endif + +int dummy; |