Debian Codegraph @

gcc/testsuite/gcc.target/aarch64/popcnt9.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-optimized" } */
3 /* { dg-final { check-function-bodies "**" "" } } */
4 /* PR target/113042 */
5
6 #pragma GCC target "+nocssc"
7
8 /*
9 ** h128:
10 ** ldr q([0-9]+), \[x0\]
11 ** cnt v([0-9]+).16b, v\1.16b
12 ** addv b([0-9]+), v\2.16b
13 ** fmov w0, s\3
14 ** ret
15 */
16
17
18 unsigned h128 (const unsigned __int128 *a) {
19 return __builtin_popcountg (a[0]);
20 }
21
22 /* There should be only one POPCOUNT. */
23 /* { dg-final { scan-tree-dump-times "POPCOUNT " 1 "optimized" } } */
24 /* { dg-final { scan-tree-dump-not " __builtin_popcount" "optimized" } } */
25