summaryrefslogtreecommitdiff
path: root/sim/testsuite/aarch64/cnt.s
blob: b4be2e3b6244d7cf151bb925a87cd29f63a212a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# mach: aarch64

# Check the popcount instruction: cnt.

.include "testutils.inc"

	.data
	.align 4
input:
	.word 0x04030201
	.word 0x0f070605
	.word 0x44332211
	.word 0xff776655

	start
	adrp x0, input
	ldr q0, [x0, #:lo12:input]

	cnt v1.8b, v0.8b
	addv b2, v1.8b
	mov x1, v2.d[0]
	cmp x1, #16
	bne .Lfailure

	cnt v1.16b, v0.16b
	addv b2, v1.16b
	mov x1, v2.d[0]
	cmp x1, #48
	bne .Lfailure

	pass
.Lfailure:
	fail