From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1690417862; bh=e57meKz1/Tev1THRh4Jfdn02kgU0ksjkutq7cujl0OA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=s6p9pSKjxa89fi1g8+GSTKJfvR7IbcGNWISrbHKEzjUbx5Gg6KQTMJsv94klfBs+B brfC5w8P/joIlqwkTZWXlBk2YNHEHKGGFCi9QUF/5HPhzU29f8IQsi7ywOCg3iLoZi RBxTG5dyBgImncSS6DVfvXeanVdybv14tsZNHuEU= From: Tsukasa OI 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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); } -- 2.41.0