Debian Codegraph @

gcc/testsuite/gcc.target/riscv/movdifge.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=5 -mmovcc -fdump-rtl-ce1" } */
5
6 typedef int __attribute__ ((mode (DI))) int_t;
7
8 int_t
9 movdifge (double w, double x, int_t y, int_t z)
10 {
11 return w >= x ? y : z;
12 }
13
14 /* Expect branchless assembly like:
15
16 fge.d a5,fa0,fa1
17 neg a5,a5
18 and a0,a5,a0
19 not a5,a5
20 and a5,a5,a1
21 or a0,a0,a5
22 */
23
24 /* { dg-final { scan-rtl-dump-times "Conversion succeeded on pass 1\\." 1 "ce1" } } */
25 /* { dg-final { scan-rtl-dump-not "if-conversion succeeded through" "ce1" } } */
26 /* { dg-final { scan-assembler-times "\\s(?:fge\\.d|fle\\.d)\\s" 1 } } */
27 /* { dg-final { scan-assembler-not "\\s(?:beq|bne)\\s" } } */
28 /* { dg-final { scan-assembler-not "\\s(?:seqz|snez)\\s" } } */