]> git.ipfire.org Git - thirdparty/gcc.git/commit
LoongArch: Standard instruction template fnmam4 correction
authorGuo Jie <guojie@loongson.cn>
Wed, 29 Oct 2025 08:38:54 +0000 (16:38 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Thu, 30 Oct 2025 03:31:21 +0000 (11:31 +0800)
commit7811fb6fa35fd3c3694eba34fbfc992eed1d3e67
tree576f4df8913af904f55bf8ee95989aa334a0af15
parent824eae920f0f64dd7687c969a2436b129161fdc9
LoongArch: Standard instruction template fnmam4 correction

The current implementation of the fnmam4 instruction template requires
the third source operand to be assigned the same hard register as the
target operand, but the constraint is not documented in the instruction
manual or standard template definitions. The current constraint will
generate additional data dependencies and extra instructions.

gcc/ChangeLog:

* config/loongarch/lasx.md (fnma<mode>4): Remove.
* config/loongarch/lsx.md (fnma<mode>4): Remove.
* config/loongarch/simd.md (fnma<mode>4): Simplify and correct.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/fnmam4-vec.c: New test.
gcc/config/loongarch/lasx.md
gcc/config/loongarch/lsx.md
gcc/config/loongarch/simd.md
gcc/testsuite/gcc.target/loongarch/fnmam4-vec.c [new file with mode: 0644]