RISC-V: Fix RV32Q conflict
authorTsukasa OI <research_trasio@irq.a4lg.com>
Sun, 27 Feb 2022 08:51:04 +0000 (17:51 +0900)
committerNelson Chu <nelson.chu@sifive.com>
Wed, 25 May 2022 03:19:59 +0000 (11:19 +0800)
This commit makes RV32 + 'Q' extension (version 2.2 or later) not
conflicting since this combination is no longer prohibited by the
specification.

bfd/ChangeLog:

* elfxx-riscv.c (riscv_parse_check_conflicts): Remove conflict
detection that prohibits RV32Q on 'Q' version 2.2 or later.

gas/ChangeLog:

* testsuite/gas/riscv/march-fail-rv32iq.d: Removed.
* testsuite/gas/riscv/march-fail-rv32iq.l: Likewise.
* testsuite/gas/riscv/march-fail-rv32iq2p0.d: New test
showing RV32IQ fails on 'Q' extension version 2.0.
* testsuite/gas/riscv/march-fail-rv32iq2p0.l: Likewise.
* testsuite/gas/riscv/march-fail-rv32iq2.d: Likewise.
* testsuite/gas/riscv/march-fail-rv32iq-isa-2p2.d: New test
showing RV32IQ fails on ISA specification version 2.2.
* testsuite/gas/riscv/march-ok-rv32iq2p2.d: New test
showing RV32IQ succesds on 'Q' extension version 2.2.
* testsuite/gas/riscv/march-ok-rv32iq-isa-20190608.d: New test
showing RV32IQ succesds on ISA specification 20190608.

bfd/elfxx-riscv.c
gas/testsuite/gas/riscv/march-fail-rv32iq-isa-2p2.d [new file with mode: 0644]
gas/testsuite/gas/riscv/march-fail-rv32iq.d [deleted file]
gas/testsuite/gas/riscv/march-fail-rv32iq.l [deleted file]
gas/testsuite/gas/riscv/march-fail-rv32iq2.d [new file with mode: 0644]
gas/testsuite/gas/riscv/march-fail-rv32iq2p0.d [new file with mode: 0644]
gas/testsuite/gas/riscv/march-fail-rv32iq2p0.l [new file with mode: 0644]
gas/testsuite/gas/riscv/march-ok-rv32iq-isa-20190608.d [new file with mode: 0644]
gas/testsuite/gas/riscv/march-ok-rv32iq2p2.d [new file with mode: 0644]

index b2806185fa8d582b824044566755c1131557e1a8..2953dc34b2f15c5b5340057281ab7ed34b7fe1f3 100644 (file)
@@ -1887,10 +1887,11 @@ riscv_parse_check_conflicts (riscv_parse_subset_t *rps)
       no_conflict = false;
     }
   if (riscv_lookup_subset (rps->subset_list, "q", &subset)
+      && (subset->major_version < 2 || (subset->major_version == 2
+                                       && subset->minor_version < 2))
       && xlen < 64)
     {
-      rps->error_handler
-        (_("rv%d does not support the `q' extension"), xlen);
+      rps->error_handler (_("rv%d does not support the `q' extension"), xlen);
       no_conflict = false;
     }
   if (riscv_lookup_subset (rps->subset_list, "e", &subset)
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq-isa-2p2.d b/gas/testsuite/gas/riscv/march-fail-rv32iq-isa-2p2.d
new file mode 100644 (file)
index 0000000..16451b0
--- /dev/null
@@ -0,0 +1,3 @@
+#as: -misa-spec=2.2 -march=rv32iq
+#source: empty.s
+#error_output: march-fail-rv32iq2p0.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq.d b/gas/testsuite/gas/riscv/march-fail-rv32iq.d
deleted file mode 100644 (file)
index c289c69..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#as: -march=rv32iq
-#source: empty.s
-#error_output: march-fail-rv32iq.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq.l b/gas/testsuite/gas/riscv/march-fail-rv32iq.l
deleted file mode 100644 (file)
index dc201b3..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-.*Assembler messages:
-.*Error: .*rv32 does not support the `q' extension
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq2.d b/gas/testsuite/gas/riscv/march-fail-rv32iq2.d
new file mode 100644 (file)
index 0000000..34fce73
--- /dev/null
@@ -0,0 +1,3 @@
+#as: -march=rv32iq2
+#source: empty.s
+#error_output: march-fail-rv32iq2p0.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq2p0.d b/gas/testsuite/gas/riscv/march-fail-rv32iq2p0.d
new file mode 100644 (file)
index 0000000..916f845
--- /dev/null
@@ -0,0 +1,3 @@
+#as: -march=rv32iq2p0
+#source: empty.s
+#error_output: march-fail-rv32iq2p0.l
diff --git a/gas/testsuite/gas/riscv/march-fail-rv32iq2p0.l b/gas/testsuite/gas/riscv/march-fail-rv32iq2p0.l
new file mode 100644 (file)
index 0000000..dc201b3
--- /dev/null
@@ -0,0 +1,2 @@
+.*Assembler messages:
+.*Error: .*rv32 does not support the `q' extension
diff --git a/gas/testsuite/gas/riscv/march-ok-rv32iq-isa-20190608.d b/gas/testsuite/gas/riscv/march-ok-rv32iq-isa-20190608.d
new file mode 100644 (file)
index 0000000..8322957
--- /dev/null
@@ -0,0 +1,5 @@
+#as: -misa-spec=20190608 -march=rv32iq
+#objdump: -dr
+#source: empty.s
+
+.*:     file format elf32-(little|big)riscv
diff --git a/gas/testsuite/gas/riscv/march-ok-rv32iq2p2.d b/gas/testsuite/gas/riscv/march-ok-rv32iq2p2.d
new file mode 100644 (file)
index 0000000..1a922bf
--- /dev/null
@@ -0,0 +1,5 @@
+#as: -march=rv32iq2p2
+#objdump: -dr
+#source: empty.s
+
+.*:     file format elf32-(little|big)riscv