]> 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 07:25:33 +0000 (15:25 +0800)
commitf558f45deeae1bd9396231da41c96f695a28bf0c
treecb958bae164a94b1ab307c3cb2e58a7af5091b5c
parentf092f60ee0f044b8c73f9c22ab0a0a88a91f40e6
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.

(cherry picked from commit 7811fb6fa35fd3c3694eba34fbfc992eed1d3e67)
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]