public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom de Vries <vries@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc r12-5999] [nvptx] Add -mptx=7.0
Date: Wed, 15 Dec 2021 14:00:10 +0000 (GMT)	[thread overview]
Message-ID: <20211215140010.333743858402@sourceware.org> (raw)

https://gcc.gnu.org/g:eede2498e61e00a176fb2908ca0317b55c084a84

commit r12-5999-geede2498e61e00a176fb2908ca0317b55c084a84
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Dec 15 14:37:58 2021 +0100

    [nvptx] Add -mptx=7.0
    
    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.

Diff:
---
 gcc/config/nvptx/nvptx-opts.h | 3 ++-
 gcc/config/nvptx/nvptx.c      | 4 +++-
 gcc/config/nvptx/nvptx.h      | 1 +
 gcc/config/nvptx/nvptx.opt    | 3 +++
 4 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/gcc/config/nvptx/nvptx-opts.h b/gcc/config/nvptx/nvptx-opts.h
index f7371dc274c..396fe871163 100644
--- a/gcc/config/nvptx/nvptx-opts.h
+++ b/gcc/config/nvptx/nvptx-opts.h
@@ -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
diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c
index 445d7ce8cc9..51eef2b45b2 100644
--- a/gcc/config/nvptx/nvptx.c
+++ b/gcc/config/nvptx/nvptx.c
@@ -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);
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index c3480cc1c26..92fd9d3b6d1 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -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.
diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 514f19d171e..04b45da9249 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -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.


                 reply	other threads:[~2021-12-15 14:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211215140010.333743858402@sourceware.org \
    --to=vries@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).