]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gcc.dg/tree-ssa/popcount5ll.c
1 /* PR tree-optimization/94800 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target popcountll } */
4 /* { dg-options "-O2 -fdump-tree-optimized" } */
6 const unsigned long long m1
= 0x5555555555555555ULL
;
7 const unsigned long long m2
= 0x3333333333333333ULL
;
8 const unsigned long long m4
= 0x0F0F0F0F0F0F0F0FULL
;
11 int popcount64c(unsigned long long x
)
14 x
= (x
& m2
) + ((x
>> 2) & m2
);
15 x
= (x
+ (x
>> 4)) & m4
;
22 /* { dg-final { scan-tree-dump-times "\.POPCOUNT" 1 "optimized" { target { lp64 } } } } */
23 /* { dg-final { scan-tree-dump-times "\.POPCOUNT" 2 "optimized" { target { ! lp64 } } } } */