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 637023857700 for ; Mon, 24 Jul 2023 05:39:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 637023857700 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 98EF2300089; Mon, 24 Jul 2023 05:39:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1690177167; bh=vs5LYLju0egKD52hhQ1XnJVympqb5P+tF7s8r9t16S0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=nPmrN3mz4Lo9WuHQVX3MN8z5YNkJ1nlus3xFKXLC6Lt4Pm739IbrQVbpmsLD0E+en i/jygeLcfaK5KzUHofwhrxnpbn9/C9Y+jGtIqTyUKEZm9tE8Z8Mz6i8gsBpdLqpm4U a7OiEleKcduc9Tb12NUR9ChFPauwSWYZY4baMEQM= From: Tsukasa OI To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH 1/2] RISC-V: Prohibit the 'Zcf' extension on RV64 Date: Mon, 24 Jul 2023 05:38:51 +0000 Message-ID: <14d1ae219dd8d974c93ab95fe1abb7760cdcdd52.1690177089.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_NUMSUBJECT,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 As per: , the 'Zcf' extension does not exist on RV64. This is reflected on the version 1.0.4-1 of the code size reduction specification: . This commit prohibits the combination: RV64 (or any ISA with XLEN > 32) and the 'Zcf' extension. bfd/ChangeLog: * elfxx-riscv.c (riscv_parse_check_conflicts): Prohibit combination of RV64 and 'Zcf'. gas/ChangeLog: * testsuite/gas/riscv/march-fail-rv64i_zcf.d: New test. * testsuite/gas/riscv/march-fail-rv64i_zcf.l: Likewise. --- bfd/elfxx-riscv.c | 7 +++++++ gas/testsuite/gas/riscv/march-fail-rv64i_zcf.d | 3 +++ gas/testsuite/gas/riscv/march-fail-rv64i_zcf.l | 2 ++ 3 files changed, 12 insertions(+) create mode 100644 gas/testsuite/gas/riscv/march-fail-rv64i_zcf.d create mode 100644 gas/testsuite/gas/riscv/march-fail-rv64i_zcf.l diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index ee96608358e8..eaf496649db1 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1946,6 +1946,13 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps) rps->error_handler (_("rv%d does not support the `q' extension"), xlen); no_conflict = false; } + if (riscv_lookup_subset (rps->subset_list, "zcf", &subset) + && xlen > 32) + { + rps->error_handler + (_("rv%d does not support the `zcf' extension"), xlen); + no_conflict = false; + } if (riscv_lookup_subset (rps->subset_list, "zfinx", &subset) && riscv_lookup_subset (rps->subset_list, "f", &subset)) { diff --git a/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.d b/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.d new file mode 100644 index 000000000000..1b70a9e280f0 --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.d @@ -0,0 +1,3 @@ +#as: -march=rv64i_zcf +#source: empty.s +#error_output: march-fail-rv64i_zcf.l diff --git a/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.l b/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.l new file mode 100644 index 000000000000..b9e07c64d52f --- /dev/null +++ b/gas/testsuite/gas/riscv/march-fail-rv64i_zcf.l @@ -0,0 +1,2 @@ +.*Assembler messages: +.*Error: .*rv64 does not support the `zcf' extension -- 2.41.0