aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2023-08-08 04:06:32 +0000
committerTsukasa OI <research_trasio@irq.a4lg.com>2023-09-05 03:05:11 +0000
commit9294a13008b0c048c83a880bce9469bccec14d36 (patch)
tree0fe3e08eb840de5f34c19be2b499fe9841933851
parent292273af3700fef7d03d716f9bc67cb07089f110 (diff)
downloadgdb-9294a13008b0c048c83a880bce9469bccec14d36.zip
gdb-9294a13008b0c048c83a880bce9469bccec14d36.tar.gz
gdb-9294a13008b0c048c83a880bce9469bccec14d36.tar.bz2
RISC-V: Prohibit combination of 'E' and 'H'
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.
-rw-r--r--bfd/elfxx-riscv.c7
-rw-r--r--gas/testsuite/gas/riscv/march-fail-rv32eh.d3
-rw-r--r--gas/testsuite/gas/riscv/march-fail-rv32eh.l2
3 files changed, 12 insertions, 0 deletions
diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index cb65024..c5972b4 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 0000000..b57199e
--- /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 0000000..c7cd1cc
--- /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