aboutsummaryrefslogtreecommitdiff
path: root/gas/testsuite
diff options
context:
space:
mode:
authorChristoph Müllner <christoph.muellner@vrull.eu>2022-06-28 17:44:46 +0200
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>2022-09-22 18:06:09 +0200
commit4041e11db3ec3611921d10150572a92689aa3154 (patch)
treebba8aafa39329d95a4cc101c5672a52689033b44 /gas/testsuite
parent73442230966a22b3238b2074691a71d7b4ed914a (diff)
downloadfsf-binutils-gdb-4041e11db3ec3611921d10150572a92689aa3154.zip
fsf-binutils-gdb-4041e11db3ec3611921d10150572a92689aa3154.tar.gz
fsf-binutils-gdb-4041e11db3ec3611921d10150572a92689aa3154.tar.bz2
RISC-V: Add T-Head MAC vendor extension
T-Head has a range of vendor-specific instructions. Therefore it makes sense to group them into smaller chunks in form of vendor extensions. This patch adds the XTheadMac extension, a collection of T-Head-specific multiply-accumulate instructions. The 'th' prefix and the "XTheadMac" extension are documented in a PR for the RISC-V toolchain conventions ([1]). [1] https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/19 Co-developed-by: Lifang Xia <lifang_xia@linux.alibaba.com> Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Diffstat (limited to 'gas/testsuite')
-rw-r--r--gas/testsuite/gas/riscv/x-thead-mac.d15
-rw-r--r--gas/testsuite/gas/riscv/x-thead-mac.s7
2 files changed, 22 insertions, 0 deletions
diff --git a/gas/testsuite/gas/riscv/x-thead-mac.d b/gas/testsuite/gas/riscv/x-thead-mac.d
new file mode 100644
index 0000000..3f8e654
--- /dev/null
+++ b/gas/testsuite/gas/riscv/x-thead-mac.d
@@ -0,0 +1,15 @@
+#as: -march=rv64i_xtheadmac
+#source: x-thead-mac.s
+#objdump: -dr
+
+.*:[ ]+file format .*
+
+Disassembly of section .text:
+
+0+000 <target>:
+[ ]+[0-9a-f]+:[ ]+20c5950b[ ]+th.mula[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+28c5950b[ ]+th.mulah[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+24c5950b[ ]+th.mulaw[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+22c5950b[ ]+th.muls[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+2ac5950b[ ]+th.mulsh[ ]+a0,a1,a2
+[ ]+[0-9a-f]+:[ ]+26c5950b[ ]+th.mulsw[ ]+a0,a1,a2
diff --git a/gas/testsuite/gas/riscv/x-thead-mac.s b/gas/testsuite/gas/riscv/x-thead-mac.s
new file mode 100644
index 0000000..986b96f
--- /dev/null
+++ b/gas/testsuite/gas/riscv/x-thead-mac.s
@@ -0,0 +1,7 @@
+target:
+ th.mula a0, a1, a2
+ th.mulah a0, a1, a2
+ th.mulaw a0, a1, a2
+ th.muls a0, a1, a2
+ th.mulsh a0, a1, a2
+ th.mulsw a0, a1, a2