Debian Codegraph @

gcc/testsuite/gcc.target/riscv/movsieq-thead.c

raw
1 /* { dg-do compile { target { ! riscv_abi_e } } } */
2 /* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-Os" "-Oz" } } */
3 /* { dg-options "-march=rv64gc_xtheadcondmov -mtune=thead-c906 -mbranch-cost=2 -fdump-rtl-ce1" { target { rv64 } } } */
4 /* { dg-options "-march=rv32gc_xtheadcondmov -mtune=thead-c906 -mbranch-cost=2 -fdump-rtl-ce1" { target { rv32 } } } */
5
6 typedef int __attribute__ ((mode (SI))) int_t;
7
8 int_t
9 movsieq (int_t w, int_t x, int_t y, int_t z)
10 {
11 return w == x ? y : z;
12 }
13
14 /* Expect branchless assembly like:
15
16 sub a0,a0,a1
17 th.mvnez a2,a3,a0
18 mv a0,a2
19 */
20
21 /* { dg-final { scan-rtl-dump-times "Conversion succeeded on pass 1\\." 1 "ce1" } } */
22 /* { dg-final { scan-rtl-dump-times "if-conversion succeeded through noce_try_cmove" 1 "ce1" } } */
23 /* { dg-final { scan-assembler-times "\\ssub\\s" 1 } } */
24 /* { dg-final { scan-assembler-times "\\s(?:th\\.mveqz|th\\.mvnez)\\s" 1 } } */
25 /* { dg-final { scan-assembler-not "\\s(?:seqz|snez)\\s" } } */
26 /* { dg-final { scan-assembler-not "\\s(?:beq|bne)\\s" } } */