diff options
author | Christoph Müllner <christoph.muellner@vrull.eu> | 2022-06-28 17:44:46 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2022-09-22 18:06:09 +0200 |
commit | 4041e11db3ec3611921d10150572a92689aa3154 (patch) | |
tree | bba8aafa39329d95a4cc101c5672a52689033b44 /gas | |
parent | 73442230966a22b3238b2074691a71d7b4ed914a (diff) | |
download | gdb-4041e11db3ec3611921d10150572a92689aa3154.zip gdb-4041e11db3ec3611921d10150572a92689aa3154.tar.gz 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')
-rw-r--r-- | gas/doc/c-riscv.texi | 5 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/x-thead-mac.d | 15 | ||||
-rw-r--r-- | gas/testsuite/gas/riscv/x-thead-mac.s | 7 |
3 files changed, 27 insertions, 0 deletions
diff --git a/gas/doc/c-riscv.texi b/gas/doc/c-riscv.texi index b1462ce..401f7e4 100644 --- a/gas/doc/c-riscv.texi +++ b/gas/doc/c-riscv.texi @@ -729,6 +729,11 @@ The XTheadCondMov extension provides instructions for conditional moves. It is documented in @url{https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.0.0/xthead-2022-09-05-2.0.0.pdf}. +@item XTheadMac +The XTheadMac extension provides multiply-accumulate instructions. + +It is documented in @url{https://github.com/T-head-Semi/thead-extension-spec/releases/download/2.0.0/xthead-2022-09-05-2.0.0.pdf}. + @item XTheadSync The XTheadSync extension provides instructions for multi-processor synchronization. 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 |