1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // REQUIRES: aarch64-registered-target
3 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s
4 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
5 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s
6 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -emit-llvm -o - -x c++ %s | opt -S -passes=mem2reg,instcombine,tailcallelim | FileCheck %s -check-prefix=CPP-CHECK
7 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -S -disable-O0-optnone -Werror -Wall -o /dev/null %s
10 #ifdef SVE_OVERLOADED_FORMS
11 // A simple used,unused... macro, long enough to represent any SVE builtin.
12 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
14 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
17 // CHECK-LABEL: @test_svclasta_s8(
19 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.clasta.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
20 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
22 // CPP-CHECK-LABEL: @_Z16test_svclasta_s8u10__SVBool_tu10__SVInt8_tS0_(
23 // CPP-CHECK-NEXT: entry:
24 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.clasta.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
25 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
27 svint8_t
test_svclasta_s8(svbool_t pg
, svint8_t fallback
, svint8_t data
)
29 return SVE_ACLE_FUNC(svclasta
,_s8
,,)(pg
, fallback
, data
);
32 // CHECK-LABEL: @test_svclasta_s16(
34 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
35 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.clasta.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[FALLBACK:%.*]], <vscale x 8 x i16> [[DATA:%.*]])
36 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
38 // CPP-CHECK-LABEL: @_Z17test_svclasta_s16u10__SVBool_tu11__SVInt16_tS0_(
39 // CPP-CHECK-NEXT: entry:
40 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
41 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.clasta.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[FALLBACK:%.*]], <vscale x 8 x i16> [[DATA:%.*]])
42 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
44 svint16_t
test_svclasta_s16(svbool_t pg
, svint16_t fallback
, svint16_t data
)
46 return SVE_ACLE_FUNC(svclasta
,_s16
,,)(pg
, fallback
, data
);
49 // CHECK-LABEL: @test_svclasta_s32(
51 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
52 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.clasta.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[FALLBACK:%.*]], <vscale x 4 x i32> [[DATA:%.*]])
53 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
55 // CPP-CHECK-LABEL: @_Z17test_svclasta_s32u10__SVBool_tu11__SVInt32_tS0_(
56 // CPP-CHECK-NEXT: entry:
57 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
58 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.clasta.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[FALLBACK:%.*]], <vscale x 4 x i32> [[DATA:%.*]])
59 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
61 svint32_t
test_svclasta_s32(svbool_t pg
, svint32_t fallback
, svint32_t data
)
63 return SVE_ACLE_FUNC(svclasta
,_s32
,,)(pg
, fallback
, data
);
66 // CHECK-LABEL: @test_svclasta_s64(
68 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
69 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.clasta.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[FALLBACK:%.*]], <vscale x 2 x i64> [[DATA:%.*]])
70 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
72 // CPP-CHECK-LABEL: @_Z17test_svclasta_s64u10__SVBool_tu11__SVInt64_tS0_(
73 // CPP-CHECK-NEXT: entry:
74 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
75 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.clasta.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[FALLBACK:%.*]], <vscale x 2 x i64> [[DATA:%.*]])
76 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
78 svint64_t
test_svclasta_s64(svbool_t pg
, svint64_t fallback
, svint64_t data
)
80 return SVE_ACLE_FUNC(svclasta
,_s64
,,)(pg
, fallback
, data
);
83 // CHECK-LABEL: @test_svclasta_u8(
85 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.clasta.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
86 // CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
88 // CPP-CHECK-LABEL: @_Z16test_svclasta_u8u10__SVBool_tu11__SVUint8_tS0_(
89 // CPP-CHECK-NEXT: entry:
90 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 16 x i8> @llvm.aarch64.sve.clasta.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], <vscale x 16 x i8> [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
91 // CPP-CHECK-NEXT: ret <vscale x 16 x i8> [[TMP0]]
93 svuint8_t
test_svclasta_u8(svbool_t pg
, svuint8_t fallback
, svuint8_t data
)
95 return SVE_ACLE_FUNC(svclasta
,_u8
,,)(pg
, fallback
, data
);
98 // CHECK-LABEL: @test_svclasta_u16(
100 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
101 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.clasta.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[FALLBACK:%.*]], <vscale x 8 x i16> [[DATA:%.*]])
102 // CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
104 // CPP-CHECK-LABEL: @_Z17test_svclasta_u16u10__SVBool_tu12__SVUint16_tS0_(
105 // CPP-CHECK-NEXT: entry:
106 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
107 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x i16> @llvm.aarch64.sve.clasta.nxv8i16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x i16> [[FALLBACK:%.*]], <vscale x 8 x i16> [[DATA:%.*]])
108 // CPP-CHECK-NEXT: ret <vscale x 8 x i16> [[TMP1]]
110 svuint16_t
test_svclasta_u16(svbool_t pg
, svuint16_t fallback
, svuint16_t data
)
112 return SVE_ACLE_FUNC(svclasta
,_u16
,,)(pg
, fallback
, data
);
115 // CHECK-LABEL: @test_svclasta_u32(
116 // CHECK-NEXT: entry:
117 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
118 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.clasta.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[FALLBACK:%.*]], <vscale x 4 x i32> [[DATA:%.*]])
119 // CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
121 // CPP-CHECK-LABEL: @_Z17test_svclasta_u32u10__SVBool_tu12__SVUint32_tS0_(
122 // CPP-CHECK-NEXT: entry:
123 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
124 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x i32> @llvm.aarch64.sve.clasta.nxv4i32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x i32> [[FALLBACK:%.*]], <vscale x 4 x i32> [[DATA:%.*]])
125 // CPP-CHECK-NEXT: ret <vscale x 4 x i32> [[TMP1]]
127 svuint32_t
test_svclasta_u32(svbool_t pg
, svuint32_t fallback
, svuint32_t data
)
129 return SVE_ACLE_FUNC(svclasta
,_u32
,,)(pg
, fallback
, data
);
132 // CHECK-LABEL: @test_svclasta_u64(
133 // CHECK-NEXT: entry:
134 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
135 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.clasta.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[FALLBACK:%.*]], <vscale x 2 x i64> [[DATA:%.*]])
136 // CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
138 // CPP-CHECK-LABEL: @_Z17test_svclasta_u64u10__SVBool_tu12__SVUint64_tS0_(
139 // CPP-CHECK-NEXT: entry:
140 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
141 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x i64> @llvm.aarch64.sve.clasta.nxv2i64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x i64> [[FALLBACK:%.*]], <vscale x 2 x i64> [[DATA:%.*]])
142 // CPP-CHECK-NEXT: ret <vscale x 2 x i64> [[TMP1]]
144 svuint64_t
test_svclasta_u64(svbool_t pg
, svuint64_t fallback
, svuint64_t data
)
146 return SVE_ACLE_FUNC(svclasta
,_u64
,,)(pg
, fallback
, data
);
149 // CHECK-LABEL: @test_svclasta_f16(
150 // CHECK-NEXT: entry:
151 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
152 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.clasta.nxv8f16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[FALLBACK:%.*]], <vscale x 8 x half> [[DATA:%.*]])
153 // CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
155 // CPP-CHECK-LABEL: @_Z17test_svclasta_f16u10__SVBool_tu13__SVFloat16_tS0_(
156 // CPP-CHECK-NEXT: entry:
157 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
158 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 8 x half> @llvm.aarch64.sve.clasta.nxv8f16(<vscale x 8 x i1> [[TMP0]], <vscale x 8 x half> [[FALLBACK:%.*]], <vscale x 8 x half> [[DATA:%.*]])
159 // CPP-CHECK-NEXT: ret <vscale x 8 x half> [[TMP1]]
161 svfloat16_t
test_svclasta_f16(svbool_t pg
, svfloat16_t fallback
, svfloat16_t data
)
163 return SVE_ACLE_FUNC(svclasta
,_f16
,,)(pg
, fallback
, data
);
166 // CHECK-LABEL: @test_svclasta_f32(
167 // CHECK-NEXT: entry:
168 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
169 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.clasta.nxv4f32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[FALLBACK:%.*]], <vscale x 4 x float> [[DATA:%.*]])
170 // CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
172 // CPP-CHECK-LABEL: @_Z17test_svclasta_f32u10__SVBool_tu13__SVFloat32_tS0_(
173 // CPP-CHECK-NEXT: entry:
174 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
175 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 4 x float> @llvm.aarch64.sve.clasta.nxv4f32(<vscale x 4 x i1> [[TMP0]], <vscale x 4 x float> [[FALLBACK:%.*]], <vscale x 4 x float> [[DATA:%.*]])
176 // CPP-CHECK-NEXT: ret <vscale x 4 x float> [[TMP1]]
178 svfloat32_t
test_svclasta_f32(svbool_t pg
, svfloat32_t fallback
, svfloat32_t data
)
180 return SVE_ACLE_FUNC(svclasta
,_f32
,,)(pg
, fallback
, data
);
183 // CHECK-LABEL: @test_svclasta_f64(
184 // CHECK-NEXT: entry:
185 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
186 // CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.clasta.nxv2f64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[FALLBACK:%.*]], <vscale x 2 x double> [[DATA:%.*]])
187 // CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
189 // CPP-CHECK-LABEL: @_Z17test_svclasta_f64u10__SVBool_tu13__SVFloat64_tS0_(
190 // CPP-CHECK-NEXT: entry:
191 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
192 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call <vscale x 2 x double> @llvm.aarch64.sve.clasta.nxv2f64(<vscale x 2 x i1> [[TMP0]], <vscale x 2 x double> [[FALLBACK:%.*]], <vscale x 2 x double> [[DATA:%.*]])
193 // CPP-CHECK-NEXT: ret <vscale x 2 x double> [[TMP1]]
195 svfloat64_t
test_svclasta_f64(svbool_t pg
, svfloat64_t fallback
, svfloat64_t data
)
197 return SVE_ACLE_FUNC(svclasta
,_f64
,,)(pg
, fallback
, data
);
200 // CHECK-LABEL: @test_svclasta_n_s8(
201 // CHECK-NEXT: entry:
202 // CHECK-NEXT: [[TMP0:%.*]] = tail call i8 @llvm.aarch64.sve.clasta.n.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], i8 [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
203 // CHECK-NEXT: ret i8 [[TMP0]]
205 // CPP-CHECK-LABEL: @_Z18test_svclasta_n_s8u10__SVBool_tau10__SVInt8_t(
206 // CPP-CHECK-NEXT: entry:
207 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i8 @llvm.aarch64.sve.clasta.n.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], i8 [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
208 // CPP-CHECK-NEXT: ret i8 [[TMP0]]
210 int8_t test_svclasta_n_s8(svbool_t pg
, int8_t fallback
, svint8_t data
)
212 return SVE_ACLE_FUNC(svclasta
,_n_s8
,,)(pg
, fallback
, data
);
215 // CHECK-LABEL: @test_svclasta_n_s16(
216 // CHECK-NEXT: entry:
217 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
218 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[FALLBACK:%.*]] to half
219 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 8 x i16> [[DATA:%.*]] to <vscale x 8 x half>
220 // CHECK-NEXT: [[TMP3:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[TMP1]], <vscale x 8 x half> [[TMP2]])
221 // CHECK-NEXT: [[TMP4:%.*]] = bitcast half [[TMP3]] to i16
222 // CHECK-NEXT: ret i16 [[TMP4]]
224 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_s16u10__SVBool_tsu11__SVInt16_t(
225 // CPP-CHECK-NEXT: entry:
226 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
227 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[FALLBACK:%.*]] to half
228 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 8 x i16> [[DATA:%.*]] to <vscale x 8 x half>
229 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[TMP1]], <vscale x 8 x half> [[TMP2]])
230 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast half [[TMP3]] to i16
231 // CPP-CHECK-NEXT: ret i16 [[TMP4]]
233 int16_t test_svclasta_n_s16(svbool_t pg
, int16_t fallback
, svint16_t data
)
235 return SVE_ACLE_FUNC(svclasta
,_n_s16
,,)(pg
, fallback
, data
);
238 // CHECK-LABEL: @test_svclasta_n_s32(
239 // CHECK-NEXT: entry:
240 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
241 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i32 [[FALLBACK:%.*]] to float
242 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 4 x i32> [[DATA:%.*]] to <vscale x 4 x float>
243 // CHECK-NEXT: [[TMP3:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[TMP1]], <vscale x 4 x float> [[TMP2]])
244 // CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[TMP3]] to i32
245 // CHECK-NEXT: ret i32 [[TMP4]]
247 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_s32u10__SVBool_tiu11__SVInt32_t(
248 // CPP-CHECK-NEXT: entry:
249 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
250 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i32 [[FALLBACK:%.*]] to float
251 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 4 x i32> [[DATA:%.*]] to <vscale x 4 x float>
252 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[TMP1]], <vscale x 4 x float> [[TMP2]])
253 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[TMP3]] to i32
254 // CPP-CHECK-NEXT: ret i32 [[TMP4]]
256 int32_t test_svclasta_n_s32(svbool_t pg
, int32_t fallback
, svint32_t data
)
258 return SVE_ACLE_FUNC(svclasta
,_n_s32
,,)(pg
, fallback
, data
);
261 // CHECK-LABEL: @test_svclasta_n_s64(
262 // CHECK-NEXT: entry:
263 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
264 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i64 [[FALLBACK:%.*]] to double
265 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 2 x i64> [[DATA:%.*]] to <vscale x 2 x double>
266 // CHECK-NEXT: [[TMP3:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[TMP1]], <vscale x 2 x double> [[TMP2]])
267 // CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[TMP3]] to i64
268 // CHECK-NEXT: ret i64 [[TMP4]]
270 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_s64u10__SVBool_tlu11__SVInt64_t(
271 // CPP-CHECK-NEXT: entry:
272 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
273 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i64 [[FALLBACK:%.*]] to double
274 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 2 x i64> [[DATA:%.*]] to <vscale x 2 x double>
275 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[TMP1]], <vscale x 2 x double> [[TMP2]])
276 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[TMP3]] to i64
277 // CPP-CHECK-NEXT: ret i64 [[TMP4]]
279 int64_t test_svclasta_n_s64(svbool_t pg
, int64_t fallback
, svint64_t data
)
281 return SVE_ACLE_FUNC(svclasta
,_n_s64
,,)(pg
, fallback
, data
);
284 // CHECK-LABEL: @test_svclasta_n_u8(
285 // CHECK-NEXT: entry:
286 // CHECK-NEXT: [[TMP0:%.*]] = tail call i8 @llvm.aarch64.sve.clasta.n.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], i8 [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
287 // CHECK-NEXT: ret i8 [[TMP0]]
289 // CPP-CHECK-LABEL: @_Z18test_svclasta_n_u8u10__SVBool_thu11__SVUint8_t(
290 // CPP-CHECK-NEXT: entry:
291 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i8 @llvm.aarch64.sve.clasta.n.nxv16i8(<vscale x 16 x i1> [[PG:%.*]], i8 [[FALLBACK:%.*]], <vscale x 16 x i8> [[DATA:%.*]])
292 // CPP-CHECK-NEXT: ret i8 [[TMP0]]
294 uint8_t test_svclasta_n_u8(svbool_t pg
, uint8_t fallback
, svuint8_t data
)
296 return SVE_ACLE_FUNC(svclasta
,_n_u8
,,)(pg
, fallback
, data
);
299 // CHECK-LABEL: @test_svclasta_n_u16(
300 // CHECK-NEXT: entry:
301 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
302 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[FALLBACK:%.*]] to half
303 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 8 x i16> [[DATA:%.*]] to <vscale x 8 x half>
304 // CHECK-NEXT: [[TMP3:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[TMP1]], <vscale x 8 x half> [[TMP2]])
305 // CHECK-NEXT: [[TMP4:%.*]] = bitcast half [[TMP3]] to i16
306 // CHECK-NEXT: ret i16 [[TMP4]]
308 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_u16u10__SVBool_ttu12__SVUint16_t(
309 // CPP-CHECK-NEXT: entry:
310 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
311 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i16 [[FALLBACK:%.*]] to half
312 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 8 x i16> [[DATA:%.*]] to <vscale x 8 x half>
313 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[TMP1]], <vscale x 8 x half> [[TMP2]])
314 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast half [[TMP3]] to i16
315 // CPP-CHECK-NEXT: ret i16 [[TMP4]]
317 uint16_t test_svclasta_n_u16(svbool_t pg
, uint16_t fallback
, svuint16_t data
)
319 return SVE_ACLE_FUNC(svclasta
,_n_u16
,,)(pg
, fallback
, data
);
322 // CHECK-LABEL: @test_svclasta_n_u32(
323 // CHECK-NEXT: entry:
324 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
325 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i32 [[FALLBACK:%.*]] to float
326 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 4 x i32> [[DATA:%.*]] to <vscale x 4 x float>
327 // CHECK-NEXT: [[TMP3:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[TMP1]], <vscale x 4 x float> [[TMP2]])
328 // CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[TMP3]] to i32
329 // CHECK-NEXT: ret i32 [[TMP4]]
331 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_u32u10__SVBool_tju12__SVUint32_t(
332 // CPP-CHECK-NEXT: entry:
333 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
334 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i32 [[FALLBACK:%.*]] to float
335 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 4 x i32> [[DATA:%.*]] to <vscale x 4 x float>
336 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[TMP1]], <vscale x 4 x float> [[TMP2]])
337 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast float [[TMP3]] to i32
338 // CPP-CHECK-NEXT: ret i32 [[TMP4]]
340 uint32_t test_svclasta_n_u32(svbool_t pg
, uint32_t fallback
, svuint32_t data
)
342 return SVE_ACLE_FUNC(svclasta
,_n_u32
,,)(pg
, fallback
, data
);
345 // CHECK-LABEL: @test_svclasta_n_u64(
346 // CHECK-NEXT: entry:
347 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
348 // CHECK-NEXT: [[TMP1:%.*]] = bitcast i64 [[FALLBACK:%.*]] to double
349 // CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 2 x i64> [[DATA:%.*]] to <vscale x 2 x double>
350 // CHECK-NEXT: [[TMP3:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[TMP1]], <vscale x 2 x double> [[TMP2]])
351 // CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[TMP3]] to i64
352 // CHECK-NEXT: ret i64 [[TMP4]]
354 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_u64u10__SVBool_tmu12__SVUint64_t(
355 // CPP-CHECK-NEXT: entry:
356 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
357 // CPP-CHECK-NEXT: [[TMP1:%.*]] = bitcast i64 [[FALLBACK:%.*]] to double
358 // CPP-CHECK-NEXT: [[TMP2:%.*]] = bitcast <vscale x 2 x i64> [[DATA:%.*]] to <vscale x 2 x double>
359 // CPP-CHECK-NEXT: [[TMP3:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[TMP1]], <vscale x 2 x double> [[TMP2]])
360 // CPP-CHECK-NEXT: [[TMP4:%.*]] = bitcast double [[TMP3]] to i64
361 // CPP-CHECK-NEXT: ret i64 [[TMP4]]
363 uint64_t test_svclasta_n_u64(svbool_t pg
, uint64_t fallback
, svuint64_t data
)
365 return SVE_ACLE_FUNC(svclasta
,_n_u64
,,)(pg
, fallback
, data
);
368 // CHECK-LABEL: @test_svclasta_n_f16(
369 // CHECK-NEXT: entry:
370 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
371 // CHECK-NEXT: [[TMP1:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[FALLBACK:%.*]], <vscale x 8 x half> [[DATA:%.*]])
372 // CHECK-NEXT: ret half [[TMP1]]
374 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_f16u10__SVBool_tDhu13__SVFloat16_t(
375 // CPP-CHECK-NEXT: entry:
376 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 8 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv8i1(<vscale x 16 x i1> [[PG:%.*]])
377 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call half @llvm.aarch64.sve.clasta.n.nxv8f16(<vscale x 8 x i1> [[TMP0]], half [[FALLBACK:%.*]], <vscale x 8 x half> [[DATA:%.*]])
378 // CPP-CHECK-NEXT: ret half [[TMP1]]
380 float16_t
test_svclasta_n_f16(svbool_t pg
, float16_t fallback
, svfloat16_t data
)
382 return SVE_ACLE_FUNC(svclasta
,_n_f16
,,)(pg
, fallback
, data
);
385 // CHECK-LABEL: @test_svclasta_n_f32(
386 // CHECK-NEXT: entry:
387 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
388 // CHECK-NEXT: [[TMP1:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[FALLBACK:%.*]], <vscale x 4 x float> [[DATA:%.*]])
389 // CHECK-NEXT: ret float [[TMP1]]
391 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_f32u10__SVBool_tfu13__SVFloat32_t(
392 // CPP-CHECK-NEXT: entry:
393 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 4 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv4i1(<vscale x 16 x i1> [[PG:%.*]])
394 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call float @llvm.aarch64.sve.clasta.n.nxv4f32(<vscale x 4 x i1> [[TMP0]], float [[FALLBACK:%.*]], <vscale x 4 x float> [[DATA:%.*]])
395 // CPP-CHECK-NEXT: ret float [[TMP1]]
397 float32_t
test_svclasta_n_f32(svbool_t pg
, float32_t fallback
, svfloat32_t data
)
399 return SVE_ACLE_FUNC(svclasta
,_n_f32
,,)(pg
, fallback
, data
);
402 // CHECK-LABEL: @test_svclasta_n_f64(
403 // CHECK-NEXT: entry:
404 // CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
405 // CHECK-NEXT: [[TMP1:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[FALLBACK:%.*]], <vscale x 2 x double> [[DATA:%.*]])
406 // CHECK-NEXT: ret double [[TMP1]]
408 // CPP-CHECK-LABEL: @_Z19test_svclasta_n_f64u10__SVBool_tdu13__SVFloat64_t(
409 // CPP-CHECK-NEXT: entry:
410 // CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call <vscale x 2 x i1> @llvm.aarch64.sve.convert.from.svbool.nxv2i1(<vscale x 16 x i1> [[PG:%.*]])
411 // CPP-CHECK-NEXT: [[TMP1:%.*]] = tail call double @llvm.aarch64.sve.clasta.n.nxv2f64(<vscale x 2 x i1> [[TMP0]], double [[FALLBACK:%.*]], <vscale x 2 x double> [[DATA:%.*]])
412 // CPP-CHECK-NEXT: ret double [[TMP1]]
414 float64_t
test_svclasta_n_f64(svbool_t pg
, float64_t fallback
, svfloat64_t data
)
416 return SVE_ACLE_FUNC(svclasta
,_n_f64
,,)(pg
, fallback
, data
);