]> git.ipfire.org Git - thirdparty/gcc.git/commit
MIPS: Set condmove cost to SET(REG, REG)
authorYunQiang Su <syq@gcc.gnu.org>
Tue, 18 Jun 2024 09:03:51 +0000 (17:03 +0800)
committerYunQiang Su <syq@gcc.gnu.org>
Fri, 21 Jun 2024 02:53:26 +0000 (10:53 +0800)
commit7b67ec4b50ae523a1e1be410644abb627daa9590
treed192f7386aefb8605530da8b8c84ff9bce458fcb
parent52c112800d9f44457c4832309a48c00945811313
MIPS: Set condmove cost to SET(REG, REG)

On most uarch, the cost condmove is same as other noraml integer,
and it should be COSTS_N_INSNS(1).

In GCC12 or previous, the condmove is always enabled, and from
GCC13, we start to compare the cost.

The generic rtx_cost give the result of COSTS_N_INSN(2).
Let's define it to COSTS_N_INSN(1) in mips_rtx_costs.

gcc
* config/mips/mips.cc(mips_rtx_costs): Set condmove cost.
* config/mips/mips.md(mov<GPR:mode>_on_<MOVECC:mode>,
mov<GPR:mode>_on_<MOVECC:mode>_mips16e2,
mov<GPR:mode>_on_<GPR2:mode>_ne
mov<GPR:mode>_on_<GPR2:mode>_ne_mips16e2): Define name by
remove starting *, so that we can use CODE_FOR_.

gcc/testsuite
* gcc.target/mips/movcc-2.c: Add k?100:1000 test.
gcc/config/mips/mips.cc
gcc/config/mips/mips.md
gcc/testsuite/gcc.target/mips/movcc-2.c