]> git.ipfire.org Git - thirdparty/gcc.git/commit
riscv: thead: Add support for the XTheadMac ISA extension
authorChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 6 Oct 2022 11:17:40 +0000 (13:17 +0200)
committerPhilipp Tomsich <philipp.tomsich@vrull.eu>
Wed, 15 Mar 2023 09:00:42 +0000 (10:00 +0100)
commitb2a1bef96dadcd18f1cc861b10bceaeec7cf48a6
tree3c17631793b5e43217d22860ae72b78541cb14d8
parent8e7ffe126debfbc59e2d359ef3c37899327e2055
riscv: thead: Add support for the XTheadMac ISA extension

The XTheadMac ISA extension provides multiply-accumulate/subtract
instructions:
* mula/mulaw/mulah
* muls/mulsw/mulsh

To benefit from middle-end passes, we expand the following named
patterns in riscv.md (as they are not T-Head-specific):
* maddhisi4
* msubhisi4

Co-Developed-by: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/ChangeLog:

* config/riscv/riscv.md (maddhisi4): New expand.
(msubhisi4): New expand.
* config/riscv/thead.md (*th_mula<mode>): New pattern.
(*th_mulawsi): New pattern.
(*th_mulawsi2): New pattern.
(*th_maddhisi4): New pattern.
(*th_sextw_maddhisi4): New pattern.
(*th_muls<mode>): New pattern.
(*th_mulswsi): New pattern.
(*th_mulswsi2): New pattern.
(*th_msubhisi4): New pattern.
(*th_sextw_msubhisi4): New pattern.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xtheadmac-mula-muls.c: New test.
gcc/config/riscv/riscv.md
gcc/config/riscv/thead.md
gcc/testsuite/gcc.target/riscv/xtheadmac-mula-muls.c [new file with mode: 0644]