gcc/ChangeLog:
* config/loongarch/loongarch-def.c: Modify the default value of
branch_cost.
gcc/testsuite/ChangeLog:
* gcc.target/loongarch/cmov_ii.c: New test.
.int_mult_di = COSTS_N_INSNS (1), \
.int_div_si = COSTS_N_INSNS (4), \
.int_div_di = COSTS_N_INSNS (6), \
- .branch_cost = 2, \
+ .branch_cost = 6, \
.memory_latency = 4
/* The following properties cannot be looked up directly using "cpucfg".
.int_mult_di = 4,
.int_div_si = 4,
.int_div_di = 4,
- .branch_cost = 2,
+ .branch_cost = 6,
.memory_latency = 4,
};
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler "test:.*xor.*maskeqz.*masknez.*or.*" } } */
+
+extern void foo_ii (int *, int *, int *, int *);
+
+int
+test (void)
+{
+ int a, b;
+ int c, d, out;
+ foo_ii (&a, &b, &c, &d);
+ out = a == b ? c : d;
+ return out;
+}