1 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
7 define <vscale x 16 x i8> @cnt_i8(<vscale x 16 x i8> %a, <vscale x 16 x i1> %pg, <vscale x 16 x i8> %b) {
9 ; CHECK: cnt z0.b, p0/m, z1.b
11 %out = call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> %a,
12 <vscale x 16 x i1> %pg,
13 <vscale x 16 x i8> %b)
14 ret <vscale x 16 x i8> %out
17 define <vscale x 8 x i16> @cnt_i16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x i16> %b) {
18 ; CHECK-LABEL: cnt_i16:
19 ; CHECK: cnt z0.h, p0/m, z1.h
21 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> %a,
22 <vscale x 8 x i1> %pg,
23 <vscale x 8 x i16> %b)
24 ret <vscale x 8 x i16> %out
27 define <vscale x 4 x i32> @cnt_i32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x i32> %b) {
28 ; CHECK-LABEL: cnt_i32:
29 ; CHECK: cnt z0.s, p0/m, z1.s
31 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> %a,
32 <vscale x 4 x i1> %pg,
33 <vscale x 4 x i32> %b)
34 ret <vscale x 4 x i32> %out
37 define <vscale x 2 x i64> @cnt_i64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x i64> %b) {
38 ; CHECK-LABEL: cnt_i64:
39 ; CHECK: cnt z0.d, p0/m, z1.d
41 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> %a,
42 <vscale x 2 x i1> %pg,
43 <vscale x 2 x i64> %b)
44 ret <vscale x 2 x i64> %out
47 define <vscale x 8 x i16> @cnt_f16(<vscale x 8 x i16> %a, <vscale x 8 x i1> %pg, <vscale x 8 x half> %b) {
48 ; CHECK-LABEL: cnt_f16:
49 ; CHECK: cnt z0.h, p0/m, z1.h
51 %out = call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> %a,
52 <vscale x 8 x i1> %pg,
53 <vscale x 8 x half> %b)
54 ret <vscale x 8 x i16> %out
57 define <vscale x 4 x i32> @cnt_f32(<vscale x 4 x i32> %a, <vscale x 4 x i1> %pg, <vscale x 4 x float> %b) {
58 ; CHECK-LABEL: cnt_f32:
59 ; CHECK: cnt z0.s, p0/m, z1.s
61 %out = call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> %a,
62 <vscale x 4 x i1> %pg,
63 <vscale x 4 x float> %b)
64 ret <vscale x 4 x i32> %out
67 define <vscale x 2 x i64> @cnt_f64(<vscale x 2 x i64> %a, <vscale x 2 x i1> %pg, <vscale x 2 x double> %b) {
68 ; CHECK-LABEL: cnt_f64:
69 ; CHECK: cnt z0.d, p0/m, z1.d
71 %out = call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> %a,
72 <vscale x 2 x i1> %pg,
73 <vscale x 2 x double> %b)
74 ret <vscale x 2 x i64> %out
77 declare <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8>, <vscale x 16 x i1>, <vscale x 16 x i8>)
78 declare <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x i16>)
79 declare <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x i32>)
80 declare <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x i64>)
81 declare <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16>, <vscale x 8 x i1>, <vscale x 8 x half>)
82 declare <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32>, <vscale x 4 x i1>, <vscale x 4 x float>)
83 declare <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64>, <vscale x 2 x i1>, <vscale x 2 x double>)