comparison gcc/testsuite/gcc.dg/tree-ssa/popcount5.c @ 19:2b5abeee2509 default tip

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
18:1830386684a0 19:2b5abeee2509
1 /* PR tree-optimization/94800 */
2 /* { dg-do compile } */
3 /* { dg-require-effective-target popcount } */
4 /* { dg-require-effective-target int32plus } */
5 /* { dg-options "-O2 -fdump-tree-optimized" } */
6
7 const unsigned m1 = 0x55555555UL;
8 const unsigned m2 = 0x33333333UL;
9 const unsigned m4 = 0x0F0F0F0FUL;
10 const int shift = 24;
11
12 int popcount64c(unsigned x)
13 {
14 x -= (x >> 1) & m1;
15 x = (x & m2) + ((x >> 2) & m2);
16 x = (x + (x >> 4)) & m4;
17 x += (x << 8);
18 x += (x << 16);
19 return x >> shift;
20 }
21
22 /* { dg-final { scan-tree-dump-times "\.POPCOUNT" 1 "optimized" } } */