1# mach: aarch64
2
3# Check the popcount instruction: cnt.
4
5.include "testutils.inc"
6
7	.data
8	.align 4
9input:
10	.word 0x04030201
11	.word 0x0f070605
12	.word 0x44332211
13	.word 0xff776655
14
15	start
16	adrp x0, input
17	ldr q0, [x0, #:lo12:input]
18
19	cnt v1.8b, v0.8b
20	addv b2, v1.8b
21	mov x1, v2.d[0]
22	cmp x1, #16
23	bne .Lfailure
24
25	cnt v1.16b, v0.16b
26	addv b2, v1.16b
27	mov x1, v2.d[0]
28	cmp x1, #48
29	bne .Lfailure
30
31	pass
32.Lfailure:
33	fail
34