From patchwork Thu Jul 27 00:30:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsukasa OI X-Patchwork-Id: 126577 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp753355vqo; Wed, 26 Jul 2023 17:34:02 -0700 (PDT) X-Google-Smtp-Source: APBJJlHI/bnRvvvRpdimyuydDmfstZ4H4arhYBbdMCg0Sv/Z2vi4f1vHoBTHlMxhSL8q9nsUfdDF X-Received: by 2002:a17:906:29a:b0:99b:bd1e:b00 with SMTP id 26-20020a170906029a00b0099bbd1e0b00mr560152ejf.25.1690418042186; Wed, 26 Jul 2023 17:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690418042; cv=none; d=google.com; s=arc-20160816; b=vQPMoEA5qcPvXoKxZW8wfXB31M0y22b4g0TdNTC8TdiK2tyEOlPAseucs+eF6Imzjk QkY5aiKUIN7mIxuPw1hzJYwlLwrcUZ6Dqax1yyStwpEIlNhTyR39edzXFIoCS4DkeH6I dxME1lNtIZa4Z8cmYud5/1PBDTZvlwGOsmn9oc4tYQ+q+x8ETQN+ghg163AmBzvCJ0z1 +xakly5QwEIk4tNcHWetNSiTKXl1Ycuosqdbqgy1UsInmJVNEsmSTmvPtZHAHlQiNAQi ihSw09Pw+ItQxF/jU1fGbwUPSB6L5rvef3StMsPGrsCd+gZYreHFoXbVehGjd0gOu+8G Srmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=e57meKz1/Tev1THRh4Jfdn02kgU0ksjkutq7cujl0OA=; fh=oLBbkpKGrMjsAiDUocfN7mW0LEnMJsqDdFE8uCs7/vo=; b=r/aiOldPDjMdiH8A/YpSMmhtugr2KBBwi2K2M0PbroDKDdFO/IXCWsPgL6osEu4KBB G5vvofgPrAj53CgvSMS1T2ju9H3pwC5tjYqZcopWHZyWz9CEORLI725Ac11+AxQ4x+mO 6fvFzAe6/Mu1qtXdODf211lzsqEjAUKNjvbuCA8vVc4LO/qUfPsBA6XCDUUdCAQOxqTJ VuKgHd9MOh5OBR4JHAp7g1OcblF6HS3N9n2eP97ucpsAK5QigVdUHwiJiTVtrpYr9vj/ xt+76cnJm56xm88mshcZHby8UQenK6MiyapiqzEgr3T18Wkgf1h2CcWREZU3V0WvvRY0 OGXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bWWBnORN; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id l12-20020a1709065a8c00b00992ae4dfc05si91566ejq.1021.2023.07.26.17.34.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jul 2023 17:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=bWWBnORN; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AC32D3870C3F for ; Thu, 27 Jul 2023 00:32:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AC32D3870C3F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1690417931; bh=e57meKz1/Tev1THRh4Jfdn02kgU0ksjkutq7cujl0OA=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=bWWBnORNaovIr7Plmzv6+Atv3Zo/LRPIyWPS9hehUW24dVM/LrHA9O30tvjrqmVNO Z6OS7uq2HFVRyPVpxSXMMNvsXc+kkQUaWWvQjXboyzeOz1fVxXt0O2aHtd60YwUfL+ 3/m+sptcHB1m7MqoCybqFKdyHjLYIl9dcWbTyFLE= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 639AF385C6D9 for ; Thu, 27 Jul 2023 00:31:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 639AF385C6D9 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 1245B300089; Thu, 27 Jul 2023 00:31:02 +0000 (UTC) To: Tsukasa OI , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng Cc: binutils@sourceware.org Subject: [RFC PATCH 3/3] RISC-V: ".option norvc" to disable 'C' and subsets Date: Thu, 27 Jul 2023 00:30:21 +0000 Message-ID: <8aaf145c772b2d3752b0ae08ce93de34494b7020.1690417818.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_MANYTO, SPF_HELO_NONE, 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: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tsukasa OI via Binutils From: Tsukasa OI Reply-To: Tsukasa OI Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772531789003450355 X-GMAIL-MSGID: 1772531789003450355 From: Tsukasa OI Despite its deprecation, ".option norvc" may used to turn off the 'C' extension. This commit also disables its subsets, 'Zca', 'Zcf' and 'Zcd' and clarifies that it won't completely do the job if other enabled extensions depend on 'C' or 'Zc*'. Note that, even if it does not "completely" work, we cannot emit any compressed instructions after the ".option norvc" directive since it disables RVC and prevents any 2-byte instructions from assembling. gas/ChangeLog: * config/tc-riscv.c (s_riscv_option): Also turn off 'Zca', 'Zcf' and 'Zcd'. Clarify the limitation of this directive. --- gas/config/tc-riscv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index aaf8b9be64fd..4c582e7813b0 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -4351,7 +4351,11 @@ s_riscv_option (int x ATTRIBUTE_UNUSED) } else if (strcmp (name, "norvc") == 0) { - riscv_update_subset (&riscv_rps_as, "-c"); + /* Compatibility: + Disable classic 'C' extension and its subsets. + It won't completely disable them if other enabled extensions + depend on 'C' or 'Zc*'. */ + riscv_update_subset (&riscv_rps_as, "-c,-zca,-zcf,-zcd"); riscv_reset_subsets_list_arch_str (); riscv_set_rvc (false); }