From patchwork Wed Dec 15 14:01:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 1568254 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=KtpSDHTk; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JDcPg1Tfrz9sRK for ; Thu, 16 Dec 2021 01:02:14 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 293DF3858435 for ; Wed, 15 Dec 2021 14:02:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 293DF3858435 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1639576932; bh=uLdve/KjEb6r6CzVtnEueoqdXEgTsIQOy7h62UgRz0I=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KtpSDHTksWF2hlMq4ebGSonQpl/Dmk6s9BvHSFqoNVgwqU+y3jcjXdUDlUrX2itFt FhKfRRye3q/2kQqFSRUJaRX/gFoyrQCmS2LjQMGdH6zr9d7NbTxz15VvwJTuZT7Xlp Uc83Oj/ETBbGNaL4pegtYv2Jm4JzKVRmBDUn2Zwc= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 811DB3858D28 for ; Wed, 15 Dec 2021 14:01:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 811DB3858D28 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5F54D1F387 for ; Wed, 15 Dec 2021 14:01:47 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3E8BD13B45 for ; Wed, 15 Dec 2021 14:01:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 2PsMDkv1uWFyXAAAMHmgww (envelope-from ) for ; Wed, 15 Dec 2021 14:01:47 +0000 Date: Wed, 15 Dec 2021 15:01:45 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Add -mptx=7.0 Message-ID: <20211215140143.GA10043@delia> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, 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. Committed to trunk. Thanks, - Tom [nvptx] Add -mptx=7.0 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 | 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.