1 /* { dg-do run { target aarch64_sve_hw } } */
2 /* { dg-options "-O2 -ftree-vectorize" } */
4 #include "popcount_1.c"
6 extern void abort (void) __attribute__ ((noreturn
));
8 unsigned int data
[] = {
19 int __attribute__ ((optimize (1)))
22 unsigned int count
= sizeof (data
) / sizeof (data
[0]) / 2;
25 unsigned int out32
[count
];
26 for (unsigned int i
= 0; i
< count
; ++i
)
28 in32
[i
] = data
[i
* 2];
29 asm volatile ("" ::: "memory");
31 popcount_32 (out32
, in32
, count
);
32 for (unsigned int i
= 0; i
< count
; ++i
)
33 if (out32
[i
] != data
[i
* 2 + 1])
38 unsigned int out64
[count
];
39 for (unsigned int i
= 0; i
< count
; ++i
)
41 in64
[i
] = ((uint64_t) data
[i
* 4] << 32) | data
[i
* 4 + 2];
42 asm volatile ("" ::: "memory");
44 popcount_64 (out64
, in64
, count
);
45 for (unsigned int i
= 0; i
< count
; ++i
)
46 if (out64
[i
] != data
[i
* 4 + 1] + data
[i
* 4 + 3])