]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Fix register overlap issue for some xtheadvector instructions
authorJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>
Fri, 12 Jan 2024 03:23:21 +0000 (11:23 +0800)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Thu, 18 Jan 2024 14:39:52 +0000 (15:39 +0100)
commitcdf4729f0889501c622cc1ad2df9377f2819cc07
tree35123d4415c7d9ac31f7abed3df707a1d3ac5914
parent0a41c3e49af36cde6792413051c7054eeccb63fb
RISC-V: Fix register overlap issue for some xtheadvector instructions

For th.vmadc/th.vmsbc as well as narrowing arithmetic instructions
and floating-point compare instructions, an illegal instruction
exception will be raised if the destination vector register overlaps
a source vector register group.

To handle this issue, we add an attribute "spec_restriction" to disable
some alternatives for xtheadvector.

gcc/ChangeLog:

* config/riscv/riscv.md (none,thv,rvv): New attribute.
(no,yes): Add an attribute to disable alternative
for xtheadvector or RVV1.0.
* config/riscv/vector.md:
Disable alternatives that destination register overlaps
source register group for xtheadvector.

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/riscv.md
gcc/config/riscv/vector.md