Skip to content
Snippets Groups Projects
Commit b2a1bef9 authored by Christoph Müllner's avatar Christoph Müllner Committed by Philipp Tomsich
Browse files

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: default avatarXianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: default avatarXianmiao Qu <cooper.qu@linux.alibaba.com>
Signed-off-by: default avatarChristoph 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.
parent 8e7ffe12
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment