]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Rewrite some instructions using ASM targethook
authorJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>
Fri, 12 Jan 2024 08:44:20 +0000 (16:44 +0800)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 18 Jan 2024 14:40:07 +0000 (15:40 +0100)
commit9e1b554cc75e25fe96baf9b8d7963b932cb2c36d
tree9ad7b736df0397e1c2b4e1bbe91688a58ac74deb
parentcdf4729f0889501c622cc1ad2df9377f2819cc07
RISC-V: Rewrite some instructions using ASM targethook

There are some xtheadvector instructions that differ from RVV1.0
apart from simply adding "th." prefix. For example, RVV1.0
load/store instructions will have SEW while xtheadvector not;
RVV1.0 will have "o" for indexed-ordered store instructions while
xtheadvecotr not; xtheadvector and RVV1.0 have different
vnsrl/vnsra/vfncvt suffix (vv/vx/vi vs wv/wx/wi).

To address this issue without duplicating patterns, we use ASM
targethook to rewrite the whole string of the instructions. We
identify different instructions from the corresponding attribute.

gcc/ChangeLog:

* config/riscv/thead.cc
(th_asm_output_opcode): Rewrite some instructions.

Co-authored-by: Jin Ma <jinma@linux.alibaba.com>
Co-authored-by: Xianmiao Qu <cooper.qu@linux.alibaba.com>
Co-authored-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/config/riscv/thead.cc