Debian Codegraph @

gcc/testsuite/gcc.target/riscv/movdilt.c

raw
1 /* { dg-do compile { target { ! riscv_abi_e } } } */
2 /* { dg-require-effective-target rv64 } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-Os" "-Oz" } } */
4 /* { dg-options "-march=rv64gc -mtune=sifive-5-series -mbranch-cost=6 -mmovcc -fdump-rtl-ce1" } */
5
6 typedef int __attribute__ ((mode (DI))) int_t;
7
8 int_t
9 movdilt (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 slt a1,a0,a1
17 neg a1,a1
18 and a3,a1,a3
19 not a1,a1
20 and a1,a1,a2
21 or a0,a3,a1
22 */
23
24 /* { dg-final { scan-rtl-dump-times "Conversion succeeded on pass 1\\." 1 "ce1" } } */
25 /* { dg-final { scan-rtl-dump-times "if-conversion succeeded through noce_try_cmove" 1 "ce1" } } */
26 /* { dg-final { scan-assembler-times "\\s(?:sgt|slt)\\s" 1 } } */
27 /* { dg-final { scan-assembler-not "\\s(?:seqz|snez)\\s" } } */
28 /* { dg-final { scan-assembler-not "\\s(?:bge|bgt|ble|blt)\\s" } } */