diff options
author | Thomas Schwinge <tschwinge@baylibre.com> | 2024-11-10 13:07:32 +0100 |
---|---|---|
committer | Thomas Schwinge <tschwinge@baylibre.com> | 2025-01-08 23:22:21 +0100 |
commit | ecb99f6978bb8e97de046952d3beb7a0d030fb25 (patch) | |
tree | 1fc37b06f5cf64c12dd8830a78d70aec4e59bebe | |
parent | 975638b2d76ce6f26965ac3160c5af8029e16c29 (diff) | |
download | gcc-ecb99f6978bb8e97de046952d3beb7a0d030fb25.zip gcc-ecb99f6978bb8e97de046952d3beb7a0d030fb25.tar.gz gcc-ecb99f6978bb8e97de046952d3beb7a0d030fb25.tar.bz2 |
nvptx: Support '-mptx=7.3'
gcc/
* config/nvptx/nvptx-opts.h (enum ptx_version): Add
'PTX_VERSION_7_3'.
* config/nvptx/nvptx.cc (ptx_version_to_string)
(ptx_version_to_number): Adjust.
* config/nvptx/nvptx.h (TARGET_PTX_7_3): New.
* config/nvptx/nvptx.opt (Enum(ptx_version)): Add 'EnumValue'
'7.3' for 'PTX_VERSION_7_3'.
* doc/invoke.texi (Nvidia PTX Options): Document '-mptx=7.3'.
gcc/testsuite/
* gcc.target/nvptx/mptx=7.3.c: New.
-rw-r--r-- | gcc/config/nvptx/nvptx-opts.h | 1 | ||||
-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.3.c | 19 |
6 files changed, 29 insertions, 1 deletions
diff --git a/gcc/config/nvptx/nvptx-opts.h b/gcc/config/nvptx/nvptx-opts.h index 86947d6..d886701 100644 --- a/gcc/config/nvptx/nvptx-opts.h +++ b/gcc/config/nvptx/nvptx-opts.h @@ -43,6 +43,7 @@ enum ptx_version PTX_VERSION_6_0, PTX_VERSION_6_3, PTX_VERSION_7_0, + PTX_VERSION_7_3, PTX_VERSION_7_8 }; diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 8e79ece..eb948d5 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -267,6 +267,8 @@ ptx_version_to_string (enum ptx_version v) return "6.3"; case PTX_VERSION_7_0: return "7.0"; + case PTX_VERSION_7_3: + return "7.3"; case PTX_VERSION_7_8: return "7.8"; default: @@ -291,6 +293,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_3: + return major_p ? 7 : 3; case PTX_VERSION_7_8: return major_p ? 7 : 8; default: diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h index 985f9bc..4b51d17 100644 --- a/gcc/config/nvptx/nvptx.h +++ b/gcc/config/nvptx/nvptx.h @@ -102,6 +102,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_3 (ptx_version_option >= PTX_VERSION_7_3) #define TARGET_PTX_7_8 (ptx_version_option >= PTX_VERSION_7_8) /* Registers. Since ptx is a virtual target, we just define a few diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt index f298773..273d366 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.3) Value(PTX_VERSION_7_3) + +EnumValue Enum(ptx_version) String(7.8) Value(PTX_VERSION_7_8) EnumValue diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index c9733d6..480c48c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -30211,7 +30211,7 @@ Valid version strings are @samp{3.1}, @samp{4.1}, @samp{4.2}, @samp{6.0}, @samp{6.3}, -@samp{7.0}, and @samp{7.8}. +@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=}. diff --git a/gcc/testsuite/gcc.target/nvptx/mptx=7.3.c b/gcc/testsuite/gcc.target/nvptx/mptx=7.3.c new file mode 100644 index 0000000..def7e71 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/mptx=7.3.c @@ -0,0 +1,19 @@ +/* { dg-do assemble } */ +/* { dg-options {-march=sm_30 -mptx=7.3} } */ +/* { dg-additional-options -save-temps } */ +/* { dg-final { scan-assembler-times {(?n)^ \.version 7\.3$} 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__ != 3 +#error wrong value for __PTX_ISA_VERSION_MINOR__ +#endif + +#if __PTX_SM__ != 300 +#error wrong value for __PTX_SM__ +#endif + +int dummy; |