| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -march=armv8.2-a+dotprod -fno-vect-cost-model -fno-schedule-insns -fno-schedule-insns2" } */ |
| 3 |
|
| 4 |
/* |
| 5 |
** bar: |
| 6 |
** movi v([0-9]+).16b, 0x1 |
| 7 |
** movi v([0-9]+).4s, 0 |
| 8 |
** ldr q([0-9]+), \[x0\] |
| 9 |
** cnt v([0-9]+).16b, v\3.16b |
| 10 |
** udot v\2.4s, v\4.16b, v\1.16b |
| 11 |
** str q\2, \[x1\] |
| 12 |
** ret |
| 13 |
*/ |
| 14 |
void |
| 15 |
bar (unsigned int *__restrict b, unsigned int *__restrict d) |
| 16 |
{ |
| 17 |
d[0] = __builtin_popcount (b[0]); |
| 18 |
d[1] = __builtin_popcount (b[1]); |
| 19 |
d[2] = __builtin_popcount (b[2]); |
| 20 |
d[3] = __builtin_popcount (b[3]); |
| 21 |
} |
| 22 |
|
| 23 |
/* |
| 24 |
** bar1: |
| 25 |
** movi v([0-9]+).8b, 0x1 |
| 26 |
** movi v([0-9]+).2s, 0 |
| 27 |
** ldr d([0-9]+), \[x0\] |
| 28 |
** cnt v([0-9]+).8b, v\3.8b |
| 29 |
** udot v\2.2s, v\4.8b, v\1.8b |
| 30 |
** str d\2, \[x1\] |
| 31 |
** ret |
| 32 |
*/ |
| 33 |
void |
| 34 |
bar1 (unsigned int *__restrict b, unsigned int *__restrict d) |
| 35 |
{ |
| 36 |
d[0] = __builtin_popcount (b[0]); |
| 37 |
d[1] = __builtin_popcount (b[1]); |
| 38 |
} |
| 39 |
|
| 40 |
/* |
| 41 |
** bar2: |
| 42 |
** movi v([0-9]+).16b, 0x1 |
| 43 |
** movi v([0-9]+).4s, 0 |
| 44 |
** ldr q([0-9]+), \[x0\] |
| 45 |
** cnt v([0-9]+).16b, v\3.16b |
| 46 |
** udot v\2.4s, v\4.16b, v\1.16b |
| 47 |
** uaddlp v\2.2d, v\2.4s |
| 48 |
** str q\2, \[x1\] |
| 49 |
** ret |
| 50 |
*/ |
| 51 |
void |
| 52 |
bar2 (unsigned long long *__restrict b, unsigned long long *__restrict d) |
| 53 |
{ |
| 54 |
d[0] = __builtin_popcountll (b[0]); |
| 55 |
d[1] = __builtin_popcountll (b[1]); |
| 56 |
} |
| 57 |
|
| 58 |
/* { dg-final { check-function-bodies "**" "" "" } } */ |