| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=icelake-server -O3" } */ |
| 3 |
/* { dg-final { scan-assembler-times "vpopcntd\[ \t\]+" 1 } } */ |
| 4 |
/* { dg-final { scan-assembler-times "vplzcntd\[ \t\]+" 5 } } */ |
| 5 |
|
| 6 |
void |
| 7 |
popcntd (unsigned int *p, unsigned int *q) |
| 8 |
{ |
| 9 |
for (unsigned int i = 0; i < 2048; ++i) |
| 10 |
p[i] = __builtin_popcountll (q[i]); |
| 11 |
} |
| 12 |
|
| 13 |
void |
| 14 |
clzd (unsigned int *p, unsigned int* __restrict q) |
| 15 |
{ |
| 16 |
for (unsigned int i = 0; i < 2048; ++i) |
| 17 |
p[i] = __builtin_clzll (q[i]); |
| 18 |
} |
| 19 |
|
| 20 |
void |
| 21 |
ffsd (unsigned int *p, unsigned int* __restrict q) |
| 22 |
{ |
| 23 |
for (unsigned int i = 0; i < 2048; ++i) |
| 24 |
p[i] = __builtin_ffsll (q[i]); |
| 25 |
} |
| 26 |
|
| 27 |
void |
| 28 |
ctzd (unsigned int *p, unsigned int* __restrict q) |
| 29 |
{ |
| 30 |
for (unsigned int i = 0; i < 2048; ++i) |
| 31 |
p[i] = __builtin_ctzll (q[i]); |
| 32 |
} |
| 33 |
|
| 34 |
void |
| 35 |
clzd0 (unsigned int *p, unsigned int* __restrict q) |
| 36 |
{ |
| 37 |
for (unsigned int i = 0; i < 2048; ++i) |
| 38 |
p[i] = q[i] ? __builtin_clzll (q[i]) : 32; |
| 39 |
} |
| 40 |
|
| 41 |
void |
| 42 |
ctzd0 (unsigned int *p, unsigned int* __restrict q) |
| 43 |
{ |
| 44 |
for (unsigned int i = 0; i < 2048; ++i) |
| 45 |
p[i] = q[i] ? __builtin_ctzll (q[i]) : 32; |
| 46 |
} |