diff options
author | Die Li <lidie@eswincomputing.com> | 2023-05-29 11:10:32 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-05-29 11:11:46 -0600 |
commit | a1806f0918c0d3612c99b6193b9703d4b4c82c21 (patch) | |
tree | de05f78b34b20e9b2a0782b6d09884498969529c /gcc/combine.cc | |
parent | 3c1e2b76e0f44a3a149dae8d803b03214025fd5e (diff) | |
download | gcc-a1806f0918c0d3612c99b6193b9703d4b4c82c21.zip gcc-a1806f0918c0d3612c99b6193b9703d4b4c82c21.tar.gz gcc-a1806f0918c0d3612c99b6193b9703d4b4c82c21.tar.bz2 |
RISC-V: Optimize TARGET_XTHEADCONDMOV
This patch allows less instructions to be used when TARGET_XTHEADCONDMOV is enabled.
Provide an example from the existing testcases.
Testcase:
int ConEmv_imm_imm_reg(int x, int y){
if (x == 1000) return 10;
return y;
}
Cflags:
-O2 -march=rv64gc_xtheadcondmov -mabi=lp64d
before patch:
ConEmv_imm_imm_reg:
addi a5,a0,-1000
li a0,10
th.mvnez a0,zero,a5
th.mveqz a1,zero,a5
or a0,a0,a1
ret
after patch:
ConEmv_imm_imm_reg:
addi a5,a0,-1000
li a0,10
th.mvnez a0,a1,a5
ret
Signed-off-by: Die Li <lidie@eswincomputing.com>
gcc/ChangeLog:
* config/riscv/riscv.cc (riscv_expand_conditional_move_onesided):
Delete.
(riscv_expand_conditional_move): Reuse the TARGET_SFB_ALU expand
process for TARGET_XTHEADCONDMOV
gcc/testsuite/ChangeLog:
* gcc.target/riscv/xtheadcondmov-indirect-rv32.c: Update the output.
* gcc.target/riscv/xtheadcondmov-indirect-rv64.c: Likewise.
Diffstat (limited to 'gcc/combine.cc')
0 files changed, 0 insertions, 0 deletions