1 /* { dg-do assemble { target aarch64_asm_sve_ok } } */
2 /* { dg-options "-O2 -ftree-vectorize --save-temps" } */
6 void __attribute__ ((noinline
, noclone
))
7 popcount_32 (unsigned int *restrict dst
, uint32_t *restrict src
, int size
)
9 for (int i
= 0; i
< size
; ++i
)
10 dst
[i
] = __builtin_popcount (src
[i
]);
13 void __attribute__ ((noinline
, noclone
))
14 popcount_64 (unsigned int *restrict dst
, uint64_t *restrict src
, int size
)
16 for (int i
= 0; i
< size
; ++i
)
17 dst
[i
] = __builtin_popcountll (src
[i
]);
20 /* { dg-final { scan-assembler-times {\tcnt\tz[0-9]+\.s, p[0-7]/m, z[0-9]+\.s\n} 1 } } */
21 /* { dg-final { scan-assembler-times {\tcnt\tz[0-9]+\.d, p[0-7]/m, z[0-9]+\.d\n} 2 } } */
22 /* { dg-final { scan-assembler-times {\tuzp1\tz[0-9]+\.s, z[0-9]+\.s, z[0-9]+\.s\n} 1 } } */