[nvptx] Add -mptx=7.0
authorTom de Vries <tdevries@suse.de>
Wed, 15 Dec 2021 13:37:58 +0000 (14:37 +0100)
committerTom de Vries <tdevries@suse.de>
Wed, 15 Dec 2021 13:58:40 +0000 (14:58 +0100)
Add support for ptx isa version 7.0, required for the addition of -misa=sm_75
and -misa=sm_80.

Tested by setting the default ptx isa version to 7.0, and doing a build and
libgomp test run.

gcc/ChangeLog:

* config/nvptx/nvptx-opts.h (enum ptx_version): Add PTX_VERSION_7_0.
* config/nvptx/nvptx.c (nvptx_file_start): Handle TARGET_PTX_7_0.
* config/nvptx/nvptx.h (TARGET_PTX_7_0): New macro.
* config/nvptx/nvptx.opt (ptx_version): Add 7.0.

gcc/config/nvptx/nvptx-opts.h
gcc/config/nvptx/nvptx.c
gcc/config/nvptx/nvptx.h
gcc/config/nvptx/nvptx.opt

index f7371dc274ca69d91b2601b06d8effc3cc54bfbc..396fe8711633f679f7d54bb3f37cee87e13c7587 100644 (file)
@@ -30,7 +30,8 @@ enum ptx_isa
 enum ptx_version
 {
   PTX_VERSION_3_1,
-  PTX_VERSION_6_3
+  PTX_VERSION_6_3,
+  PTX_VERSION_7_0
 };
 
 #endif
index 445d7ce8cc97a1d6231c9c662379db1211a51351..51eef2b45b2a9a3b67d36399e5b214da743b9854 100644 (file)
@@ -5404,7 +5404,9 @@ static void
 nvptx_file_start (void)
 {
   fputs ("// BEGIN PREAMBLE\n", asm_out_file);
-  if (TARGET_PTX_6_3)
+  if (TARGET_PTX_7_0)
+    fputs ("\t.version\t7.0\n", asm_out_file);
+  else if (TARGET_PTX_6_3)
     fputs ("\t.version\t6.3\n", asm_out_file);
   else
     fputs ("\t.version\t3.1\n", asm_out_file);
index c3480cc1c26c4e795658c789c185dde968bcd408..92fd9d3b6d12c3590b507baa169a062ad8d31647 100644 (file)
@@ -90,6 +90,7 @@
 #define TARGET_SM53 (ptx_isa_option >= PTX_ISA_SM53)
 
 #define TARGET_PTX_6_3 (ptx_version_option >= PTX_VERSION_6_3)
+#define TARGET_PTX_7_0 (ptx_version_option >= PTX_VERSION_7_0)
 
 /* Registers.  Since ptx is a virtual target, we just define a few
    hard registers for special purposes and leave pseudos unallocated.
index 514f19d171e8644e1763cdfa156a88e42c3e9f46..04b45da9249f657eae2b1d63f379ee542b9b7362 100644 (file)
@@ -79,6 +79,9 @@ Enum(ptx_version) String(3.1) Value(PTX_VERSION_3_1)
 EnumValue
 Enum(ptx_version) String(6.3) Value(PTX_VERSION_6_3)
 
+EnumValue
+Enum(ptx_version) String(7.0) Value(PTX_VERSION_7_0)
+
 mptx=
 Target RejectNegative ToLower Joined Enum(ptx_version) Var(ptx_version_option) Init(PTX_VERSION_3_1)
 Specify the version of the ptx version to use.