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 0A68D3858D28 for ; Wed, 30 Aug 2023 04:12:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A68D3858D28 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 4EDC0300089; Wed, 30 Aug 2023 04:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1693368736; bh=8BhgNmz4zxRzdq7aPiLFzDSn4gOXF2shSP89zvlp/+U=; h=Message-ID:Date:Mime-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=N0yUuauUCoeauXZkou3Xa02vsWxWDmPhxLgpVFCk9wrcdHC8j/J5wlluXLEc0irwc gGIiqjA8EE3nM9XYCfVI/K2grz58ZsvS73qeAEDX/T84Luc/HjjDVD3CLsQfdOQ0mm am/TrIA6i9NcX4rfIKNnR424x5V29tESQvK3hlDc= Message-ID: Date: Wed, 30 Aug 2023 13:12:15 +0900 Mime-Version: 1.0 Subject: [PING^1][PATCH] RISC-V: Prohibit combination of 'E' and 'H' Content-Language: en-US To: Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu , Kito Cheng Cc: binutils@sourceware.org References: From: Tsukasa OI In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP 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: Ping. On 2023/08/08 13:16, Tsukasa OI wrote: > From: Tsukasa OI > > According to the ratified privileged specification (version 20211203), > it says: > >> The hypervisor extension depends on an "I" base integer ISA with 32 x >> registers (RV32I or RV64I), not RV32E, which has only 16 x registers. > > Also in the latest draft, it also prohibits RV64E with the 'H' extension. > This commit prohibits the combination of 'E' and 'H' extensions. > > bfd/ChangeLog: > > * elfxx-riscv.c (riscv_parse_check_conflicts): Prohibit 'E' and > 'H' combinations. > > gas/ChangeLog: > > * testsuite/gas/riscv/march-fail-rv32eh.d: New failure test to > make sure that RV32E + 'H' is prohibited. > * testsuite/gas/riscv/march-fail-rv32eh.l: Likewise. > --- > bfd/elfxx-riscv.c | 7 +++++++ > gas/testsuite/gas/riscv/march-fail-rv32eh.d | 3 +++ > gas/testsuite/gas/riscv/march-fail-rv32eh.l | 2 ++ > 3 files changed, 12 insertions(+) > create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32eh.d > create mode 100644 gas/testsuite/gas/riscv/march-fail-rv32eh.l > > diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c > index ee4598729480..1655bb2df364 100644 > --- a/bfd/elfxx-riscv.c > +++ b/bfd/elfxx-riscv.c > @@ -1949,6 +1949,13 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps) > (_("rv%d does not support the `e' extension"), xlen); > no_conflict = false; > } > + if (riscv_subset_supports (rps, "e") > + && riscv_subset_supports (rps, "h")) > + { > + rps->error_handler > + (_("rv%de does not support the `h' extension"), xlen); > + no_conflict = false; > + } > if (riscv_lookup_subset (rps->subset_list, "q", &subset) > && (subset->major_version < 2 || (subset->major_version == 2 > && subset->minor_version < 2)) > diff --git a/gas/testsuite/gas/riscv/march-fail-rv32eh.d b/gas/testsuite/gas/riscv/march-fail-rv32eh.d > new file mode 100644 > index 000000000000..b57199efa0f6 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/march-fail-rv32eh.d > @@ -0,0 +1,3 @@ > +#as: -march=rv32eh > +#source: empty.s > +#error_output: march-fail-rv32eh.l > diff --git a/gas/testsuite/gas/riscv/march-fail-rv32eh.l b/gas/testsuite/gas/riscv/march-fail-rv32eh.l > new file mode 100644 > index 000000000000..c7cd1ccc2a89 > --- /dev/null > +++ b/gas/testsuite/gas/riscv/march-fail-rv32eh.l > @@ -0,0 +1,2 @@ > +.*Assembler messages: > +.*Error: .*rv32e does not support the `h' extension > > base-commit: d734d43a048b33ee12df2c06c2e782887e9715f6