1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -fclang-abi-compat=latest -DSVE_OVERLOADED_FORMS -triple aarch64 -target-feature +sve -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
8 // RUN: %clang_cc1 -fclang-abi-compat=latest -triple aarch64 -target-feature +sme -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
12 #if defined __ARM_FEATURE_SME
13 #define MODE_ATTR __arm_streaming
18 #ifdef SVE_OVERLOADED_FORMS
19 // A simple used,unused... macro, long enough to represent any SVE builtin.
20 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
22 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
25 // CHECK-LABEL: @test_svcnt_s8_z(
27 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
28 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
30 // CPP-CHECK-LABEL: @_Z15test_svcnt_s8_zu10__SVBool_tu10__SVInt8_t(
31 // CPP-CHECK-NEXT: entry:
32 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
33 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
35 svuint8_t
test_svcnt_s8_z(svbool_t pg
, svint8_t op
) MODE_ATTR
37 return SVE_ACLE_FUNC(svcnt
,_s8
,_z
,)(pg
, op
);
40 // CHECK-LABEL: @test_svcnt_s16_z(
42 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
43 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
44 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
46 // CPP-CHECK-LABEL: @_Z16test_svcnt_s16_zu10__SVBool_tu11__SVInt16_t(
47 // CPP-CHECK-NEXT: entry:
48 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
49 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
50 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
52 svuint16_t
test_svcnt_s16_z(svbool_t pg
, svint16_t op
) MODE_ATTR
54 return SVE_ACLE_FUNC(svcnt
,_s16
,_z
,)(pg
, op
);
57 // CHECK-LABEL: @test_svcnt_s32_z(
59 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
60 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
61 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
63 // CPP-CHECK-LABEL: @_Z16test_svcnt_s32_zu10__SVBool_tu11__SVInt32_t(
64 // CPP-CHECK-NEXT: entry:
65 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
66 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
67 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
69 svuint32_t
test_svcnt_s32_z(svbool_t pg
, svint32_t op
) MODE_ATTR
71 return SVE_ACLE_FUNC(svcnt
,_s32
,_z
,)(pg
, op
);
74 // CHECK-LABEL: @test_svcnt_s64_z(
76 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
77 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
78 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
80 // CPP-CHECK-LABEL: @_Z16test_svcnt_s64_zu10__SVBool_tu11__SVInt64_t(
81 // CPP-CHECK-NEXT: entry:
82 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
83 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
84 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
86 svuint64_t
test_svcnt_s64_z(svbool_t pg
, svint64_t op
) MODE_ATTR
88 return SVE_ACLE_FUNC(svcnt
,_s64
,_z
,)(pg
, op
);
91 // CHECK-LABEL: @test_svcnt_u8_z(
93 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
94 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
96 // CPP-CHECK-LABEL: @_Z15test_svcnt_u8_zu10__SVBool_tu11__SVUint8_t(
97 // CPP-CHECK-NEXT: entry:
98 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> zeroinitializer, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
99 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
101 svuint8_t
test_svcnt_u8_z(svbool_t pg
, svuint8_t op
) MODE_ATTR
103 return SVE_ACLE_FUNC(svcnt
,_u8
,_z
,)(pg
, op
);
106 // CHECK-LABEL: @test_svcnt_u16_z(
107 // CHECK-NEXT: entry:
108 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
109 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
110 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
112 // CPP-CHECK-LABEL: @_Z16test_svcnt_u16_zu10__SVBool_tu12__SVUint16_t(
113 // CPP-CHECK-NEXT: entry:
114 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
115 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
116 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
118 svuint16_t
test_svcnt_u16_z(svbool_t pg
, svuint16_t op
) MODE_ATTR
120 return SVE_ACLE_FUNC(svcnt
,_u16
,_z
,)(pg
, op
);
123 // CHECK-LABEL: @test_svcnt_u32_z(
124 // CHECK-NEXT: entry:
125 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
126 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
127 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
129 // CPP-CHECK-LABEL: @_Z16test_svcnt_u32_zu10__SVBool_tu12__SVUint32_t(
130 // CPP-CHECK-NEXT: entry:
131 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
132 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
133 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
135 svuint32_t
test_svcnt_u32_z(svbool_t pg
, svuint32_t op
) MODE_ATTR
137 return SVE_ACLE_FUNC(svcnt
,_u32
,_z
,)(pg
, op
);
140 // CHECK-LABEL: @test_svcnt_u64_z(
141 // CHECK-NEXT: entry:
142 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
143 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
144 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
146 // CPP-CHECK-LABEL: @_Z16test_svcnt_u64_zu10__SVBool_tu12__SVUint64_t(
147 // CPP-CHECK-NEXT: entry:
148 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
149 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
150 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
152 svuint64_t
test_svcnt_u64_z(svbool_t pg
, svuint64_t op
) MODE_ATTR
154 return SVE_ACLE_FUNC(svcnt
,_u64
,_z
,)(pg
, op
);
157 // CHECK-LABEL: @test_svcnt_f16_z(
158 // CHECK-NEXT: entry:
159 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
160 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
161 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
163 // CPP-CHECK-LABEL: @_Z16test_svcnt_f16_zu10__SVBool_tu13__SVFloat16_t(
164 // CPP-CHECK-NEXT: entry:
165 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
166 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> zeroinitializer, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
167 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
169 svuint16_t
test_svcnt_f16_z(svbool_t pg
, svfloat16_t op
) MODE_ATTR
171 return SVE_ACLE_FUNC(svcnt
,_f16
,_z
,)(pg
, op
);
174 // CHECK-LABEL: @test_svcnt_f32_z(
175 // CHECK-NEXT: entry:
176 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
177 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
178 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
180 // CPP-CHECK-LABEL: @_Z16test_svcnt_f32_zu10__SVBool_tu13__SVFloat32_t(
181 // CPP-CHECK-NEXT: entry:
182 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
183 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> zeroinitializer, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
184 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
186 svuint32_t
test_svcnt_f32_z(svbool_t pg
, svfloat32_t op
) MODE_ATTR
188 return SVE_ACLE_FUNC(svcnt
,_f32
,_z
,)(pg
, op
);
191 // CHECK-LABEL: @test_svcnt_f64_z(
192 // CHECK-NEXT: entry:
193 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
194 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
195 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
197 // CPP-CHECK-LABEL: @_Z16test_svcnt_f64_zu10__SVBool_tu13__SVFloat64_t(
198 // CPP-CHECK-NEXT: entry:
199 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
200 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> zeroinitializer, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
201 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
203 svuint64_t
test_svcnt_f64_z(svbool_t pg
, svfloat64_t op
) MODE_ATTR
205 return SVE_ACLE_FUNC(svcnt
,_f64
,_z
,)(pg
, op
);
208 // CHECK-LABEL: @test_svcnt_s8_m(
209 // CHECK-NEXT: entry:
210 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> [[INACTIVE:%.*]], <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
211 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
213 // CPP-CHECK-LABEL: @_Z15test_svcnt_s8_mu11__SVUint8_tu10__SVBool_tu10__SVInt8_t(
214 // CPP-CHECK-NEXT: entry:
215 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> [[INACTIVE:%.*]], <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
216 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
218 svuint8_t
test_svcnt_s8_m(svuint8_t inactive
, svbool_t pg
, svint8_t op
) MODE_ATTR
220 return SVE_ACLE_FUNC(svcnt
,_s8
,_m
,)(inactive
, pg
, op
);
223 // CHECK-LABEL: @test_svcnt_s16_m(
224 // CHECK-NEXT: entry:
225 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
226 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
227 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
229 // CPP-CHECK-LABEL: @_Z16test_svcnt_s16_mu12__SVUint16_tu10__SVBool_tu11__SVInt16_t(
230 // CPP-CHECK-NEXT: entry:
231 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
232 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
233 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
235 svuint16_t
test_svcnt_s16_m(svuint16_t inactive
, svbool_t pg
, svint16_t op
) MODE_ATTR
237 return SVE_ACLE_FUNC(svcnt
,_s16
,_m
,)(inactive
, pg
, op
);
240 // CHECK-LABEL: @test_svcnt_s32_m(
241 // CHECK-NEXT: entry:
242 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
243 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
244 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
246 // CPP-CHECK-LABEL: @_Z16test_svcnt_s32_mu12__SVUint32_tu10__SVBool_tu11__SVInt32_t(
247 // CPP-CHECK-NEXT: entry:
248 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
249 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
250 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
252 svuint32_t
test_svcnt_s32_m(svuint32_t inactive
, svbool_t pg
, svint32_t op
) MODE_ATTR
254 return SVE_ACLE_FUNC(svcnt
,_s32
,_m
,)(inactive
, pg
, op
);
257 // CHECK-LABEL: @test_svcnt_s64_m(
258 // CHECK-NEXT: entry:
259 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
260 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
261 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
263 // CPP-CHECK-LABEL: @_Z16test_svcnt_s64_mu12__SVUint64_tu10__SVBool_tu11__SVInt64_t(
264 // CPP-CHECK-NEXT: entry:
265 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
266 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
267 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
269 svuint64_t
test_svcnt_s64_m(svuint64_t inactive
, svbool_t pg
, svint64_t op
) MODE_ATTR
271 return SVE_ACLE_FUNC(svcnt
,_s64
,_m
,)(inactive
, pg
, op
);
274 // CHECK-LABEL: @test_svcnt_u8_m(
275 // CHECK-NEXT: entry:
276 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> [[INACTIVE:%.*]], <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
277 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
279 // CPP-CHECK-LABEL: @_Z15test_svcnt_u8_mu11__SVUint8_tu10__SVBool_tS_(
280 // CPP-CHECK-NEXT: entry:
281 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> [[INACTIVE:%.*]], <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
282 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
284 svuint8_t
test_svcnt_u8_m(svuint8_t inactive
, svbool_t pg
, svuint8_t op
) MODE_ATTR
286 return SVE_ACLE_FUNC(svcnt
,_u8
,_m
,)(inactive
, pg
, op
);
289 // CHECK-LABEL: @test_svcnt_u16_m(
290 // CHECK-NEXT: entry:
291 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
292 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
293 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
295 // CPP-CHECK-LABEL: @_Z16test_svcnt_u16_mu12__SVUint16_tu10__SVBool_tS_(
296 // CPP-CHECK-NEXT: entry:
297 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
298 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
299 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
301 svuint16_t
test_svcnt_u16_m(svuint16_t inactive
, svbool_t pg
, svuint16_t op
) MODE_ATTR
303 return SVE_ACLE_FUNC(svcnt
,_u16
,_m
,)(inactive
, pg
, op
);
306 // CHECK-LABEL: @test_svcnt_u32_m(
307 // CHECK-NEXT: entry:
308 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
309 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
310 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
312 // CPP-CHECK-LABEL: @_Z16test_svcnt_u32_mu12__SVUint32_tu10__SVBool_tS_(
313 // CPP-CHECK-NEXT: entry:
314 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
315 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
316 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
318 svuint32_t
test_svcnt_u32_m(svuint32_t inactive
, svbool_t pg
, svuint32_t op
) MODE_ATTR
320 return SVE_ACLE_FUNC(svcnt
,_u32
,_m
,)(inactive
, pg
, op
);
323 // CHECK-LABEL: @test_svcnt_u64_m(
324 // CHECK-NEXT: entry:
325 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
326 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
327 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
329 // CPP-CHECK-LABEL: @_Z16test_svcnt_u64_mu12__SVUint64_tu10__SVBool_tS_(
330 // CPP-CHECK-NEXT: entry:
331 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
332 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
333 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
335 svuint64_t
test_svcnt_u64_m(svuint64_t inactive
, svbool_t pg
, svuint64_t op
) MODE_ATTR
337 return SVE_ACLE_FUNC(svcnt
,_u64
,_m
,)(inactive
, pg
, op
);
340 // CHECK-LABEL: @test_svcnt_f16_m(
341 // CHECK-NEXT: entry:
342 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
343 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
344 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
346 // CPP-CHECK-LABEL: @_Z16test_svcnt_f16_mu12__SVUint16_tu10__SVBool_tu13__SVFloat16_t(
347 // CPP-CHECK-NEXT: entry:
348 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
349 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> [[INACTIVE:%.*]], <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
350 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
352 svuint16_t
test_svcnt_f16_m(svuint16_t inactive
, svbool_t pg
, svfloat16_t op
) MODE_ATTR
354 return SVE_ACLE_FUNC(svcnt
,_f16
,_m
,)(inactive
, pg
, op
);
357 // CHECK-LABEL: @test_svcnt_f32_m(
358 // CHECK-NEXT: entry:
359 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
360 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
361 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
363 // CPP-CHECK-LABEL: @_Z16test_svcnt_f32_mu12__SVUint32_tu10__SVBool_tu13__SVFloat32_t(
364 // CPP-CHECK-NEXT: entry:
365 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
366 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> [[INACTIVE:%.*]], <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
367 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
369 svuint32_t
test_svcnt_f32_m(svuint32_t inactive
, svbool_t pg
, svfloat32_t op
) MODE_ATTR
371 return SVE_ACLE_FUNC(svcnt
,_f32
,_m
,)(inactive
, pg
, op
);
374 // CHECK-LABEL: @test_svcnt_f64_m(
375 // CHECK-NEXT: entry:
376 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
377 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
378 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
380 // CPP-CHECK-LABEL: @_Z16test_svcnt_f64_mu12__SVUint64_tu10__SVBool_tu13__SVFloat64_t(
381 // CPP-CHECK-NEXT: entry:
382 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
383 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> [[INACTIVE:%.*]], <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
384 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
386 svuint64_t
test_svcnt_f64_m(svuint64_t inactive
, svbool_t pg
, svfloat64_t op
) MODE_ATTR
388 return SVE_ACLE_FUNC(svcnt
,_f64
,_m
,)(inactive
, pg
, op
);
391 // CHECK-LABEL: @test_svcnt_s8_x(
392 // CHECK-NEXT: entry:
393 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
394 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
396 // CPP-CHECK-LABEL: @_Z15test_svcnt_s8_xu10__SVBool_tu10__SVInt8_t(
397 // CPP-CHECK-NEXT: entry:
398 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
399 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
401 svuint8_t
test_svcnt_s8_x(svbool_t pg
, svint8_t op
) MODE_ATTR
403 return SVE_ACLE_FUNC(svcnt
,_s8
,_x
,)(pg
, op
);
406 // CHECK-LABEL: @test_svcnt_s16_x(
407 // CHECK-NEXT: entry:
408 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
409 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
410 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
412 // CPP-CHECK-LABEL: @_Z16test_svcnt_s16_xu10__SVBool_tu11__SVInt16_t(
413 // CPP-CHECK-NEXT: entry:
414 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
415 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
416 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
418 svuint16_t
test_svcnt_s16_x(svbool_t pg
, svint16_t op
) MODE_ATTR
420 return SVE_ACLE_FUNC(svcnt
,_s16
,_x
,)(pg
, op
);
423 // CHECK-LABEL: @test_svcnt_s32_x(
424 // CHECK-NEXT: entry:
425 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
426 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
427 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
429 // CPP-CHECK-LABEL: @_Z16test_svcnt_s32_xu10__SVBool_tu11__SVInt32_t(
430 // CPP-CHECK-NEXT: entry:
431 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
432 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
433 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
435 svuint32_t
test_svcnt_s32_x(svbool_t pg
, svint32_t op
) MODE_ATTR
437 return SVE_ACLE_FUNC(svcnt
,_s32
,_x
,)(pg
, op
);
440 // CHECK-LABEL: @test_svcnt_s64_x(
441 // CHECK-NEXT: entry:
442 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
443 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
444 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
446 // CPP-CHECK-LABEL: @_Z16test_svcnt_s64_xu10__SVBool_tu11__SVInt64_t(
447 // CPP-CHECK-NEXT: entry:
448 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
449 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
450 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
452 svuint64_t
test_svcnt_s64_x(svbool_t pg
, svint64_t op
) MODE_ATTR
454 return SVE_ACLE_FUNC(svcnt
,_s64
,_x
,)(pg
, op
);
457 // CHECK-LABEL: @test_svcnt_u8_x(
458 // CHECK-NEXT: entry:
459 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
460 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
462 // CPP-CHECK-LABEL: @_Z15test_svcnt_u8_xu10__SVBool_tu11__SVUint8_t(
463 // CPP-CHECK-NEXT: entry:
464 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.cnt.nxv16i8(<vscale x 16 x i8> undef, <vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[OP:%.*]])
465 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
467 svuint8_t
test_svcnt_u8_x(svbool_t pg
, svuint8_t op
) MODE_ATTR
469 return SVE_ACLE_FUNC(svcnt
,_u8
,_x
,)(pg
, op
);
472 // CHECK-LABEL: @test_svcnt_u16_x(
473 // CHECK-NEXT: entry:
474 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
475 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
476 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
478 // CPP-CHECK-LABEL: @_Z16test_svcnt_u16_xu10__SVBool_tu12__SVUint16_t(
479 // CPP-CHECK-NEXT: entry:
480 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
481 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8i16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[OP:%.*]])
482 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
484 svuint16_t
test_svcnt_u16_x(svbool_t pg
, svuint16_t op
) MODE_ATTR
486 return SVE_ACLE_FUNC(svcnt
,_u16
,_x
,)(pg
, op
);
489 // CHECK-LABEL: @test_svcnt_u32_x(
490 // CHECK-NEXT: entry:
491 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
492 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
493 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
495 // CPP-CHECK-LABEL: @_Z16test_svcnt_u32_xu10__SVBool_tu12__SVUint32_t(
496 // CPP-CHECK-NEXT: entry:
497 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
498 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4i32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[OP:%.*]])
499 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
501 svuint32_t
test_svcnt_u32_x(svbool_t pg
, svuint32_t op
) MODE_ATTR
503 return SVE_ACLE_FUNC(svcnt
,_u32
,_x
,)(pg
, op
);
506 // CHECK-LABEL: @test_svcnt_u64_x(
507 // CHECK-NEXT: entry:
508 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
509 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
510 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
512 // CPP-CHECK-LABEL: @_Z16test_svcnt_u64_xu10__SVBool_tu12__SVUint64_t(
513 // CPP-CHECK-NEXT: entry:
514 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
515 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2i64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[OP:%.*]])
516 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
518 svuint64_t
test_svcnt_u64_x(svbool_t pg
, svuint64_t op
) MODE_ATTR
520 return SVE_ACLE_FUNC(svcnt
,_u64
,_x
,)(pg
, op
);
523 // CHECK-LABEL: @test_svcnt_f16_x(
524 // CHECK-NEXT: entry:
525 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
526 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
527 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
529 // CPP-CHECK-LABEL: @_Z16test_svcnt_f16_xu10__SVBool_tu13__SVFloat16_t(
530 // CPP-CHECK-NEXT: entry:
531 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
532 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.cnt.nxv8f16(<vscale x 8 x i16> undef, <vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[OP:%.*]])
533 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
535 svuint16_t
test_svcnt_f16_x(svbool_t pg
, svfloat16_t op
) MODE_ATTR
537 return SVE_ACLE_FUNC(svcnt
,_f16
,_x
,)(pg
, op
);
540 // CHECK-LABEL: @test_svcnt_f32_x(
541 // CHECK-NEXT: entry:
542 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
543 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
544 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
546 // CPP-CHECK-LABEL: @_Z16test_svcnt_f32_xu10__SVBool_tu13__SVFloat32_t(
547 // CPP-CHECK-NEXT: entry:
548 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
549 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.cnt.nxv4f32(<vscale x 4 x i32> undef, <vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[OP:%.*]])
550 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
552 svuint32_t
test_svcnt_f32_x(svbool_t pg
, svfloat32_t op
) MODE_ATTR
554 return SVE_ACLE_FUNC(svcnt
,_f32
,_x
,)(pg
, op
);
557 // CHECK-LABEL: @test_svcnt_f64_x(
558 // CHECK-NEXT: entry:
559 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
560 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
561 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
563 // CPP-CHECK-LABEL: @_Z16test_svcnt_f64_xu10__SVBool_tu13__SVFloat64_t(
564 // CPP-CHECK-NEXT: entry:
565 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
566 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.cnt.nxv2f64(<vscale x 2 x i64> undef, <vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[OP:%.*]])
567 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
569 svuint64_t
test_svcnt_f64_x(svbool_t pg
, svfloat64_t op
) MODE_ATTR
571 return SVE_ACLE_FUNC(svcnt
,_f64
,_x
,)(pg
, op
);