Debian Codegraph @

gcc/testsuite/gcc.target/riscv/sfb.c

raw
1 //* { dg-do compile } */
2 /* { dg-options "-O2 -march=rv32gc -mabi=ilp32d -mtune=sifive-7-series" } */
3
4 int f1(unsigned int x, unsigned int y, unsigned int z)
5 {
6 return ((x & 1) == 0) ? y : z ^ y;
7 }
8
9 int f2(unsigned int x, unsigned int y, unsigned int z)
10 {
11 return ((x & 1) != 0) ? z ^ y : y;
12 }
13
14 int f3(unsigned int x, unsigned int y, unsigned int z)
15 {
16 return ((x & 1) == 0) ? y : z | y;
17 }
18
19 int f4(unsigned int x, unsigned int y, unsigned int z)
20 {
21 return ((x & 1) != 0) ? z | y : y;
22 }
23 /* { dg-final { scan-assembler-times "bne" 4 } } */
24 /* { dg-final { scan-assembler-times "movcc" 4 } } */