Debian Codegraph @

gcc/testsuite/gcc.target/riscv/branch-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64gc -mabi=lp64" } */
3 /* { dg-skip-if "" { *-*-* } { "-O0" "-Og" "-O1" } } */
4
5 void g();
6
7 void f(long long a)
8 {
9 if (a & 0xff00)
10 g();
11 }
12
13 void f2(long long a)
14 {
15 if (a & (-4ull << 3))
16 g();
17 }
18
19 void f3(long long a)
20 {
21 if (a & 0xffff00)
22 g();
23 }
24
25 void f4(long long a)
26 {
27 if (a & 0x7ff800)
28 g();
29 }
30
31 void f5(long long a)
32 {
33 if ((a & 0x1ff800) == 0x11c800)
34 g();
35 }
36
37 void f6(long long a)
38 {
39 if ((a & 0x33f800) == 0x110000)
40 g();
41 }
42
43 /* { dg-final { scan-assembler-times "slli\t" 2 } } */
44 /* { dg-final { scan-assembler-times "srai\t" 2 } } */
45 /* { dg-final { scan-assembler-times "srli\t" 3 } } */
46 /* { dg-final { scan-assembler-times "andi\t" 3 } } */
47 /* { dg-final { scan-assembler-times "\tli\t" 3 } } */
48 /* { dg-final { scan-assembler-not "addi\t" } } */
49 /* { dg-final { scan-assembler-not "and\t" } } */
50