Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/sve/cnt_fold_6.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4
5 #include <arm_sve.h>
6
7 /*
8 ** f1:
9 ** ...
10 ** cntb (x[0-9]+)
11 ** ...
12 ** add x[0-9]+, \1, #?16
13 ** ...
14 ** csel [^\n]+
15 ** ret
16 */
17 uint64_t
18 f1 (int x)
19 {
20 uint64_t y = x ? svcnth () : svcnth () + 8;
21 y >>= 3;
22 y <<= 4;
23 return y;
24 }
25
26 /*
27 ** f2:
28 ** ...
29 ** (?:and|[al]sr) [^\n]+
30 ** ...
31 ** ret
32 */
33 uint64_t
34 f2 (int x)
35 {
36 uint64_t y = x ? svcnth () : svcnth () + 8;
37 y >>= 4;
38 y <<= 5;
39 return y;
40 }
41
42 /*
43 ** f3:
44 ** ...
45 ** cntw (x[0-9]+)
46 ** ...
47 ** add x[0-9]+, \1, #?16
48 ** ...
49 ** csel [^\n]+
50 ** ret
51 */
52 uint64_t
53 f3 (int x)
54 {
55 uint64_t y = x ? svcntd () : svcntd () + 8;
56 y >>= 1;
57 y <<= 2;
58 return y;
59 }
60
61 /*
62 ** f4:
63 ** ...
64 ** (?:and|[al]sr) [^\n]+
65 ** ...
66 ** ret
67 */
68 uint64_t
69 f4 (int x)
70 {
71 uint64_t y = x ? svcntd () : svcntd () + 8;
72 y >>= 2;
73 y <<= 3;
74 return y;
75 }