From 4041e11db3ec3611921d10150572a92689aa3154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20M=C3=BCllner?= Date: Tue, 28 Jun 2022 17:44:46 +0200 Subject: RISC-V: Add T-Head MAC vendor extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Christoph Müllner --- gas/testsuite/gas/riscv/x-thead-mac.d | 15 +++++++++++++++ gas/testsuite/gas/riscv/x-thead-mac.s | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 gas/testsuite/gas/riscv/x-thead-mac.d create mode 100644 gas/testsuite/gas/riscv/x-thead-mac.s (limited to 'gas/testsuite') 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 : +[ ]+[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 -- cgit v1.1