aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authorTsukasa OI <research_trasio@irq.a4lg.com>2022-02-02 10:06:15 +0900
committerNelson Chu <nelson@rivosinc.com>2022-08-30 17:46:11 +0800
commit0938b032daa52129b4215d8e0eedb6c9804f5280 (patch)
treef66e988ae822b77aa3b7757b65b1850c387b2205 /ld
parent1c04f72368c925288a6f1b1abb0dbc31a60d2f49 (diff)
downloadgdb-0938b032daa52129b4215d8e0eedb6c9804f5280.zip
gdb-0938b032daa52129b4215d8e0eedb6c9804f5280.tar.gz
gdb-0938b032daa52129b4215d8e0eedb6c9804f5280.tar.bz2
RISC-V: Add 'Zmmul' extension in assembler.
Three-part patch set from Tsukasa OI to support zmmul in assembler. The 'Zmmul' is a RISC-V extension consisting of only multiply instructions (a subset of 'M' which has multiply and divide instructions). bfd/ * elfxx-riscv.c (riscv_implicit_subsets): Add 'Zmmul' implied by 'M'. (riscv_supported_std_z_ext): Add 'Zmmul' extension. (riscv_multi_subset_supports): Add handling for new instruction class. gas/ * testsuite/gas/riscv/attribute-09.d: Updated implicit 'Zmmul' by 'M'. * testsuite/gas/riscv/option-arch-02.d: Likewise. * testsuite/gas/riscv/m-ext.s: New test. * testsuite/gas/riscv/m-ext-32.d: New test (RV32). * testsuite/gas/riscv/m-ext-64.d: New test (RV64). * testsuite/gas/riscv/zmmul-32.d: New expected output. * testsuite/gas/riscv/zmmul-64.d: Likewise. * testsuite/gas/riscv/m-ext-fail-xlen-32.d: New test (failure by using RV64-only instructions in RV32). * testsuite/gas/riscv/m-ext-fail-xlen-32.l: Likewise. * testsuite/gas/riscv/m-ext-fail-zmmul-32.d: New failure test (RV32 + Zmmul but with no M). * testsuite/gas/riscv/m-ext-fail-zmmul-32.l: Likewise. * testsuite/gas/riscv/m-ext-fail-zmmul-64.d: New failure test (RV64 + Zmmul but with no M). * testsuite/gas/riscv/m-ext-fail-zmmul-64.l: Likewise. * testsuite/gas/riscv/m-ext-fail-noarch-64.d: New failure test (no Zmmul or M). * testsuite/gas/riscv/m-ext-fail-noarch-64.l: Likewise. include/ * opcode/riscv.h (enum riscv_insn_class): Added INSN_CLASS_ZMMUL. ld/ * testsuite/ld-riscv-elf/attr-merge-arch-01.d: We don't care zmmul in these testcases, so just replaced m by a. * testsuite/ld-riscv-elf/attr-merge-arch-01a.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-01b.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-02.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-02a.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-03.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-arch-03a.s: Likewise. * testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: Likewise. * testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p0.s: Renamed. * testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p1.s: Renamed. opcodes/ * riscv-opc.c (riscv_opcodes): Updated multiply instructions to zmmul.
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-01.d2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-01a.s2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-01b.s2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-02.d2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-02a.s2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-03.d2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-arch-03a.s2
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d6
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p0.s1
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p1.s1
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p0.s1
-rw-r--r--ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p1.s1
12 files changed, 12 insertions, 12 deletions
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01.d b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01.d
index a4b0322..de87f60 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01.d
@@ -6,4 +6,4 @@
Attribute Section: riscv
File Attributes
- Tag_RISCV_arch: "rv32i2p1_m2p0"
+ Tag_RISCV_arch: "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01a.s b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01a.s
index ea097f9..4593241 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01a.s
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01a.s
@@ -1 +1 @@
- .attribute arch, "rv32i2p1_m2p0"
+ .attribute arch, "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01b.s b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01b.s
index ea097f9..4593241 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-01b.s
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-01b.s
@@ -1 +1 @@
- .attribute arch, "rv32i2p1_m2p0"
+ .attribute arch, "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-02.d b/ld/testsuite/ld-riscv-elf/attr-merge-arch-02.d
index 852fd55..381ef85 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-02.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-02.d
@@ -6,4 +6,4 @@
Attribute Section: riscv
File Attributes
- Tag_RISCV_arch: "rv32i2p1_m2p0"
+ Tag_RISCV_arch: "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-02a.s b/ld/testsuite/ld-riscv-elf/attr-merge-arch-02a.s
index ea097f9..4593241 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-02a.s
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-02a.s
@@ -1 +1 @@
- .attribute arch, "rv32i2p1_m2p0"
+ .attribute arch, "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-03.d b/ld/testsuite/ld-riscv-elf/attr-merge-arch-03.d
index c1cf808..6419fe8 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-03.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-03.d
@@ -6,4 +6,4 @@
Attribute Section: riscv
File Attributes
- Tag_RISCV_arch: "rv32i2p1_m2p0_xbar2p0_xfoo2p0"
+ Tag_RISCV_arch: "rv32i2p1_a2p0_xbar2p0_xfoo2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-arch-03a.s b/ld/testsuite/ld-riscv-elf/attr-merge-arch-03a.s
index 3a9fb97..603b5d6 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-arch-03a.s
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-arch-03a.s
@@ -1 +1 @@
- .attribute arch, "rv32i2p1_m2p0_xfoo2p0"
+ .attribute arch, "rv32i2p1_a2p0_xfoo2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d
index d15bcdc..f4012dc 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d
@@ -1,9 +1,9 @@
-#source: attr-merge-user-ext-rv32i2p1_m2p0.s
-#source: attr-merge-user-ext-rv32i2p1_m2p1.s
+#source: attr-merge-user-ext-rv32i2p1_a2p0.s
+#source: attr-merge-user-ext-rv32i2p1_a2p1.s
#as:
#ld: -r -m[riscv_choose_ilp32_emul]
#readelf: -A
Attribute Section: riscv
File Attributes
- Tag_RISCV_arch: "rv32i2p1_m2p1"
+ Tag_RISCV_arch: "rv32i2p1_a2p1"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p0.s b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p0.s
new file mode 100644
index 0000000..0d4fba5
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p0.s
@@ -0,0 +1 @@
+.attribute arch, "rv32i2p1_a2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p1.s b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p1.s
new file mode 100644
index 0000000..ded3583
--- /dev/null
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_a2p1.s
@@ -0,0 +1 @@
+.attribute arch, "rv32i2p1_a2p1"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p0.s b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p0.s
deleted file mode 100644
index a7e0547..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p0.s
+++ /dev/null
@@ -1 +0,0 @@
-.attribute arch, "rv32i2p1_m2p0"
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p1.s b/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p1.s
deleted file mode 100644
index a1b61e3..0000000
--- a/ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p1.s
+++ /dev/null
@@ -1 +0,0 @@
-.attribute arch, "rv32i2p1_m2p1"