]> git.ipfire.org Git - thirdparty/gcc.git/commit
MIPS: Add MSUBF.fmt instruction for MIPSr6
authorJie Mei <jie.mei@oss.cipunited.com>
Sat, 14 Sep 2024 07:04:09 +0000 (15:04 +0800)
committerYunQiang Su <syq@debian.org>
Sat, 27 Sep 2025 05:48:40 +0000 (13:48 +0800)
commit51a3669ab65586c3cffe302a1bf7c368ad08e61a
treedf0f6d9ba709cbf3cfa680d1ad8ce9b910fbe12c
parent4ab8a985b8063734ed364eb1e49de3303464aab7
MIPS: Add MSUBF.fmt instruction for MIPSr6

GCC currently uses two instructions (NEG.fmt and MADDF.fmt) for
operations like `x - (y * z)' for MIPSr6. We can further tune this by
using only MSUBF.fmt instead of those two.

This patch adds MSUBF.fmt instrutions with corresponding tests.

gcc/ChangeLog:

* config/mips/mips.md (fms<mode>4): Generates MSUBF.fmt
instructions.
(*fms<mode>4_msubf): Same as above.
(fnma<mode>4): Same as above.
(*fnma<mode>4_msubf): Same as above.

gcc/testsuite/ChangeLog:

* gcc.target/mips/mips-msubf.c: New tests for MIPSr6.
gcc/config/mips/mips.md
gcc/testsuite/gcc.target/mips/mips-msubf.c [new file with mode: 0644]