1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-apple- -mcpu=cyclone | FileCheck %s
4 ; The non-byte ones used to fail with "Cannot select"
6 define <8 x i8> @ctpopv8i8(<8 x i8> %x) nounwind readnone {
7 ; CHECK-LABEL: ctpopv8i8:
9 ; CHECK-NEXT: cnt v0.8b, v0.8b
11 %cnt = tail call <8 x i8> @llvm.ctpop.v8i8(<8 x i8> %x)
15 declare <8 x i8> @llvm.ctpop.v8i8(<8 x i8>) nounwind readnone
17 define <4 x i16> @ctpopv4i16(<4 x i16> %x) nounwind readnone {
18 ; CHECK-LABEL: ctpopv4i16:
20 ; CHECK-NEXT: cnt v0.8b, v0.8b
21 ; CHECK-NEXT: uaddlp v0.4h, v0.8b
23 %cnt = tail call <4 x i16> @llvm.ctpop.v4i16(<4 x i16> %x)
27 declare <4 x i16> @llvm.ctpop.v4i16(<4 x i16>) nounwind readnone
29 define <2 x i32> @ctpopv2i32(<2 x i32> %x) nounwind readnone {
30 ; CHECK-LABEL: ctpopv2i32:
32 ; CHECK-NEXT: cnt v0.8b, v0.8b
33 ; CHECK-NEXT: uaddlp v0.4h, v0.8b
34 ; CHECK-NEXT: uaddlp v0.2s, v0.4h
36 %cnt = tail call <2 x i32> @llvm.ctpop.v2i32(<2 x i32> %x)
40 declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32>) nounwind readnone
42 define <1 x i64> @ctpopv1i64(<1 x i64> %x) nounwind readnone {
43 ; CHECK-LABEL: ctpopv1i64:
45 ; CHECK-NEXT: cnt v0.8b, v0.8b
46 ; CHECK-NEXT: uaddlp v0.4h, v0.8b
47 ; CHECK-NEXT: uaddlp v0.2s, v0.4h
48 ; CHECK-NEXT: uaddlp v0.1d, v0.2s
50 %cnt = tail call <1 x i64> @llvm.ctpop.v1i64(<1 x i64> %x)
54 declare <1 x i64> @llvm.ctpop.v1i64(<1 x i64>) nounwind readnone
56 define <16 x i8> @ctpopv16i8(<16 x i8> %x) nounwind readnone {
57 ; CHECK-LABEL: ctpopv16i8:
59 ; CHECK-NEXT: cnt v0.16b, v0.16b
61 %cnt = tail call <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %x)
65 declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8>) nounwind readnone
67 define <8 x i16> @ctpopv8i16(<8 x i16> %x) nounwind readnone {
68 ; CHECK-LABEL: ctpopv8i16:
70 ; CHECK-NEXT: cnt v0.16b, v0.16b
71 ; CHECK-NEXT: uaddlp v0.8h, v0.16b
73 %cnt = tail call <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %x)
77 declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16>) nounwind readnone
79 define <4 x i32> @ctpopv4i32(<4 x i32> %x) nounwind readnone {
80 ; CHECK-LABEL: ctpopv4i32:
82 ; CHECK-NEXT: cnt v0.16b, v0.16b
83 ; CHECK-NEXT: uaddlp v0.8h, v0.16b
84 ; CHECK-NEXT: uaddlp v0.4s, v0.8h
86 %cnt = tail call <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %x)
90 declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32>) nounwind readnone
92 define <2 x i64> @ctpopv2i64(<2 x i64> %x) nounwind readnone {
93 ; CHECK-LABEL: ctpopv2i64:
95 ; CHECK-NEXT: cnt v0.16b, v0.16b
96 ; CHECK-NEXT: uaddlp v0.8h, v0.16b
97 ; CHECK-NEXT: uaddlp v0.4s, v0.8h
98 ; CHECK-NEXT: uaddlp v0.2d, v0.4s
100 %cnt = tail call <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %x)
104 declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64>) nounwind readnone