From patchwork Fri Nov 24 14:55:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1868178 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4ScJ3549pMz1ySj for ; Sat, 25 Nov 2023 01:56:21 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EF78938582B7 for ; Fri, 24 Nov 2023 14:56:17 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id ECB183858D3C for ; Fri, 24 Nov 2023 14:56:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ECB183858D3C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org ECB183858D3C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=68.232.141.98 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700837765; cv=none; b=A6OMigL4r5I045X8W8LBTzDdXXqA9fbc0w2YsppkfLte9PEHLjkHic7UzLNzPkfoADs5kbhAjStS74mX/xGlnQRopMFn+p12xCQPxFqng7aTRpDMskX/nVlP2m2Ee6lwJfTlOj3bBv2ra0AwO/hpW8bMFfwPHdZ8nhvdl9vzrwc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700837765; c=relaxed/simple; bh=Tl9cYnilhh/jdK9tHhQJmgOOMPes6tibrgZ2BTwoiOQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=VcI25vBvAWK4t6r2Zr7adeLScA+MPcOXEG0C/Dq2viT4JF1Qf3GhBsE6Rkv9MCHpvQB66ef+LK0HhHetM7vn0gcceXmO4glz9WDS33ADTAIgRGUoQLwM1qMDLzrGHL6fObo23KaijCuxJsQyTEquyciYZrplUcA0t+bP7UY6b00= ARC-Authentication-Results: i=1; server2.sourceware.org X-CSE-ConnectionGUID: 3RI9QoIrT7qCamSJ4Wh8vA== X-CSE-MsgGUID: fAEeY49hQzuif3Gexhol9g== X-IronPort-AV: E=Sophos;i="6.04,224,1695715200"; d="scan'208,223";a="26443892" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 24 Nov 2023 06:56:01 -0800 IronPort-SDR: CoTMd6PD3zPbbQVDdqT1zGylKj2KHWjJxHMHiBmWgMPWL9/7jjkpr6/88ymtRPTq+Dk0M336sT gpGL8tsegqBztSE145K8e8TDqHvBDatoWIQS6Sf8H8bhGmL7uLQKaezWPjAYWPdoQECAOHDMYV mImplvMwYDm6236crWLkNCGre6B6DWl+YVi8Oc7X+c2/yWP+3ikxkcjQhF6frvlv9Qmj9MIrX9 ZRI+iKrdaFXc3OJrpv4L08LeUnH5FT1HkbA9ehFqEXkootYQUHWXl/+UPUmf60zM8IGgJGk9Aw ttI= From: Thomas Schwinge To: Andrew Stubbs , Julian Brown , , Joseph Myers Subject: GCN: Tag '-march=[...]', '-mtune=[...]' as 'Negative' of themselves [PR112669] (was: [gcn][patch] Add -mgpu option and plumb in assembler/linker) In-Reply-To: References: <20170529172734.f4gtlrhkg2ovtwve@virgil.suse.cz> <8189798b-48e3-7f72-5976-53ea947adc10@mentor.com> User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/28.2 (x86_64-pc-linux-gnu) Date: Fri, 24 Nov 2023 15:55:52 +0100 Message-ID: <87v89rryiv.fsf@euler.schwinge.homeip.net> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-12.mgc.mentorg.com (139.181.222.12) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LOTSOFHASH, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! On 2017-06-21T11:06:24+0100, Andrew Stubbs wrote: > --- a/gcc/config/gcn/gcn.opt > +++ b/gcc/config/gcn/gcn.opt > +march= > +Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_CARRIZO) > +Specify the name of the target GPU. > + > +mtune= > +Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_CARRIZO) > +Specify the name of the target GPU. OK to push the attached "GCN: Tag '-march=[...]', '-mtune=[...]' as 'Negative' of themselves [PR112669]"? For reference, see also: - [...] - commit 718a3eab2906217c70f27077446fa0e8ddb1bf7b "[arm] Mark -marm and -mthumb as being inverse options" - commit aebe10d48ccc217273ee8a4e2c3805ed1e173a78 "driver: Also prune joined switches with negation" ['gcc/config/i386/i386.opt'] - commit 6fdbe41963a7aecad80f27e9805c7e18cbd4ab48 "driver: Also prune joined switches with negation" ['gcc/config/aarch64/aarch64.opt', 'gcc/config/arm/arm.opt'] - commit 17f2908fcf058e145cff275966e34f8c7f57c2c5 "RISC-V: For '-march' and '-mabi' options, add 'Negative' property mentions itself" - commit 69c426b89579312af91035c26fb1e270bfbcad00 "doc/options.texi: Fix the description of 'Negative'" (..., and yes, GCC/nvptx does need similar treatment...) Grüße Thomas ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 From 0e03aa39bd5fbae8a5993bf9bf6dad34f9e85c2d Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 22 Nov 2023 17:35:23 +0100 Subject: [PATCH] GCN: Tag '-march=[...]', '-mtune=[...]' as 'Negative' of themselves [PR112669] Certain other command-line flags are mutually exclusive (random example: GCN '-march=gfx906', '-march=gfx908'). If they're not appropriately marked up, this does disturb the multilib selection machinery, for example: $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory -march=gfx906 gfx906 $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory -march=gfx908 gfx908 $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory -march=gfx906 -march=gfx908 . In the last invocation, '-march=gfx900 -march=gfx906', for example, in 'gcc/gcc.cc:set_multilib_dir' we see both flags -- which there doesn't exist a matching multilib for, therefore we "fail" to the default ('.'). Tagges as 'Negative', only the last flag survives, and we, for example, get the expected: $ build-gcc-offload-amdgcn-amdhsa/gcc/xgcc -print-multi-directory -march=gfx906 -march=gfx908 gfx908 I quickly found that the same also applies to GCN's '-mtune=[...]', but I've not otherwise reviewed the GCN options. PR target/112669 gcc/ * config/gcn/gcn.opt (march=, mtune=): Tag as 'Negative' of themselves. --- gcc/config/gcn/gcn.opt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt index 7a852c51c84..e5db6df92d7 100644 --- a/gcc/config/gcn/gcn.opt +++ b/gcc/config/gcn/gcn.opt @@ -44,11 +44,11 @@ EnumValue Enum(gpu_type) String(gfx1030) Value(PROCESSOR_GFX1030) march= -Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_FIJI) +Target RejectNegative Negative(march=) Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_FIJI) Specify the name of the target GPU. mtune= -Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_FIJI) +Target RejectNegative Negative(mtune=) Joined ToLower Enum(gpu_type) Var(gcn_tune) Init(PROCESSOR_FIJI) Specify the name of the target GPU. m32 -- 2.34.1