Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/popcount.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -mlsx -fdump-tree-optimized" } */
3 /* { dg-final { scan-tree-dump-times "__builtin_popcount|\\.POPCOUNT" 1 "optimized" } } */
4
5 int
6 PopCount (long b)
7 {
8 int c = 0;
9
10 while (b)
11 {
12 b &= b - 1;
13 c++;
14 }
15
16 return c;
17 }