1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
2 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s
3 // RUN: %clang_cc1 -DPOLYMORPHIC -triple thumbv8.1m.main-none-none-eabi -target-feature +mve -mfloat-abi hard -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s
5 // REQUIRES: aarch64-registered-target || arm-registered-target
9 // CHECK-LABEL: @test_vqmovnbq_s16(
11 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0)
12 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
14 int8x16_t
test_vqmovnbq_s16(int8x16_t a
, int16x8_t b
)
17 return vqmovnbq(a
, b
);
18 #else /* POLYMORPHIC */
19 return vqmovnbq_s16(a
, b
);
20 #endif /* POLYMORPHIC */
23 // CHECK-LABEL: @test_vqmovnbq_s32(
25 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0)
26 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
28 int16x8_t
test_vqmovnbq_s32(int16x8_t a
, int32x4_t b
)
31 return vqmovnbq(a
, b
);
32 #else /* POLYMORPHIC */
33 return vqmovnbq_s32(a
, b
);
34 #endif /* POLYMORPHIC */
37 // CHECK-LABEL: @test_vqmovnbq_u16(
39 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0)
40 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
42 uint8x16_t
test_vqmovnbq_u16(uint8x16_t a
, uint16x8_t b
)
45 return vqmovnbq(a
, b
);
46 #else /* POLYMORPHIC */
47 return vqmovnbq_u16(a
, b
);
48 #endif /* POLYMORPHIC */
51 // CHECK-LABEL: @test_vqmovnbq_u32(
53 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0)
54 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
56 uint16x8_t
test_vqmovnbq_u32(uint16x8_t a
, uint32x4_t b
)
59 return vqmovnbq(a
, b
);
60 #else /* POLYMORPHIC */
61 return vqmovnbq_u32(a
, b
);
62 #endif /* POLYMORPHIC */
65 // CHECK-LABEL: @test_vqmovntq_s16(
67 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1)
68 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
70 int8x16_t
test_vqmovntq_s16(int8x16_t a
, int16x8_t b
)
73 return vqmovntq(a
, b
);
74 #else /* POLYMORPHIC */
75 return vqmovntq_s16(a
, b
);
76 #endif /* POLYMORPHIC */
79 // CHECK-LABEL: @test_vqmovntq_s32(
81 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1)
82 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
84 int16x8_t
test_vqmovntq_s32(int16x8_t a
, int32x4_t b
)
87 return vqmovntq(a
, b
);
88 #else /* POLYMORPHIC */
89 return vqmovntq_s32(a
, b
);
90 #endif /* POLYMORPHIC */
93 // CHECK-LABEL: @test_vqmovntq_u16(
95 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1)
96 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
98 uint8x16_t
test_vqmovntq_u16(uint8x16_t a
, uint16x8_t b
)
101 return vqmovntq(a
, b
);
102 #else /* POLYMORPHIC */
103 return vqmovntq_u16(a
, b
);
104 #endif /* POLYMORPHIC */
107 // CHECK-LABEL: @test_vqmovntq_u32(
108 // CHECK-NEXT: entry:
109 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1)
110 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
112 uint16x8_t
test_vqmovntq_u32(uint16x8_t a
, uint32x4_t b
)
115 return vqmovntq(a
, b
);
116 #else /* POLYMORPHIC */
117 return vqmovntq_u32(a
, b
);
118 #endif /* POLYMORPHIC */
121 // CHECK-LABEL: @test_vqmovunbq_s16(
122 // CHECK-NEXT: entry:
123 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0)
124 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
126 uint8x16_t
test_vqmovunbq_s16(uint8x16_t a
, int16x8_t b
)
129 return vqmovunbq(a
, b
);
130 #else /* POLYMORPHIC */
131 return vqmovunbq_s16(a
, b
);
132 #endif /* POLYMORPHIC */
135 // CHECK-LABEL: @test_vqmovunbq_s32(
136 // CHECK-NEXT: entry:
137 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0)
138 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
140 uint16x8_t
test_vqmovunbq_s32(uint16x8_t a
, int32x4_t b
)
143 return vqmovunbq(a
, b
);
144 #else /* POLYMORPHIC */
145 return vqmovunbq_s32(a
, b
);
146 #endif /* POLYMORPHIC */
149 // CHECK-LABEL: @test_vqmovuntq_s16(
150 // CHECK-NEXT: entry:
151 // CHECK-NEXT: [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1)
152 // CHECK-NEXT: ret <16 x i8> [[TMP0]]
154 uint8x16_t
test_vqmovuntq_s16(uint8x16_t a
, int16x8_t b
)
157 return vqmovuntq(a
, b
);
158 #else /* POLYMORPHIC */
159 return vqmovuntq_s16(a
, b
);
160 #endif /* POLYMORPHIC */
163 // CHECK-LABEL: @test_vqmovuntq_s32(
164 // CHECK-NEXT: entry:
165 // CHECK-NEXT: [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1)
166 // CHECK-NEXT: ret <8 x i16> [[TMP0]]
168 uint16x8_t
test_vqmovuntq_s32(uint16x8_t a
, int32x4_t b
)
171 return vqmovuntq(a
, b
);
172 #else /* POLYMORPHIC */
173 return vqmovuntq_s32(a
, b
);
174 #endif /* POLYMORPHIC */
177 // CHECK-LABEL: @test_vqmovnbq_m_s16(
178 // CHECK-NEXT: entry:
179 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
180 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
181 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
182 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
184 int8x16_t
test_vqmovnbq_m_s16(int8x16_t a
, int16x8_t b
, mve_pred16_t p
)
187 return vqmovnbq_m(a
, b
, p
);
188 #else /* POLYMORPHIC */
189 return vqmovnbq_m_s16(a
, b
, p
);
190 #endif /* POLYMORPHIC */
193 // CHECK-LABEL: @test_vqmovnbq_m_s32(
194 // CHECK-NEXT: entry:
195 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
196 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
197 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
198 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
200 int16x8_t
test_vqmovnbq_m_s32(int16x8_t a
, int32x4_t b
, mve_pred16_t p
)
203 return vqmovnbq_m(a
, b
, p
);
204 #else /* POLYMORPHIC */
205 return vqmovnbq_m_s32(a
, b
, p
);
206 #endif /* POLYMORPHIC */
209 // CHECK-LABEL: @test_vqmovnbq_m_u16(
210 // CHECK-NEXT: entry:
211 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
212 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
213 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
214 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
216 uint8x16_t
test_vqmovnbq_m_u16(uint8x16_t a
, uint16x8_t b
, mve_pred16_t p
)
219 return vqmovnbq_m(a
, b
, p
);
220 #else /* POLYMORPHIC */
221 return vqmovnbq_m_u16(a
, b
, p
);
222 #endif /* POLYMORPHIC */
225 // CHECK-LABEL: @test_vqmovnbq_m_u32(
226 // CHECK-NEXT: entry:
227 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
228 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
229 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
230 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
232 uint16x8_t
test_vqmovnbq_m_u32(uint16x8_t a
, uint32x4_t b
, mve_pred16_t p
)
235 return vqmovnbq_m(a
, b
, p
);
236 #else /* POLYMORPHIC */
237 return vqmovnbq_m_u32(a
, b
, p
);
238 #endif /* POLYMORPHIC */
241 // CHECK-LABEL: @test_vqmovntq_m_s16(
242 // CHECK-NEXT: entry:
243 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
244 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
245 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
246 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
248 int8x16_t
test_vqmovntq_m_s16(int8x16_t a
, int16x8_t b
, mve_pred16_t p
)
251 return vqmovntq_m(a
, b
, p
);
252 #else /* POLYMORPHIC */
253 return vqmovntq_m_s16(a
, b
, p
);
254 #endif /* POLYMORPHIC */
257 // CHECK-LABEL: @test_vqmovntq_m_s32(
258 // CHECK-NEXT: entry:
259 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
260 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
261 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
262 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
264 int16x8_t
test_vqmovntq_m_s32(int16x8_t a
, int32x4_t b
, mve_pred16_t p
)
267 return vqmovntq_m(a
, b
, p
);
268 #else /* POLYMORPHIC */
269 return vqmovntq_m_s32(a
, b
, p
);
270 #endif /* POLYMORPHIC */
273 // CHECK-LABEL: @test_vqmovntq_m_u16(
274 // CHECK-NEXT: entry:
275 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
276 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
277 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
278 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
280 uint8x16_t
test_vqmovntq_m_u16(uint8x16_t a
, uint16x8_t b
, mve_pred16_t p
)
283 return vqmovntq_m(a
, b
, p
);
284 #else /* POLYMORPHIC */
285 return vqmovntq_m_u16(a
, b
, p
);
286 #endif /* POLYMORPHIC */
289 // CHECK-LABEL: @test_vqmovntq_m_u32(
290 // CHECK-NEXT: entry:
291 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
292 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
293 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
294 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
296 uint16x8_t
test_vqmovntq_m_u32(uint16x8_t a
, uint32x4_t b
, mve_pred16_t p
)
299 return vqmovntq_m(a
, b
, p
);
300 #else /* POLYMORPHIC */
301 return vqmovntq_m_u32(a
, b
, p
);
302 #endif /* POLYMORPHIC */
305 // CHECK-LABEL: @test_vqmovunbq_m_s16(
306 // CHECK-NEXT: entry:
307 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
308 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
309 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
310 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
312 uint8x16_t
test_vqmovunbq_m_s16(uint8x16_t a
, int16x8_t b
, mve_pred16_t p
)
315 return vqmovunbq_m(a
, b
, p
);
316 #else /* POLYMORPHIC */
317 return vqmovunbq_m_s16(a
, b
, p
);
318 #endif /* POLYMORPHIC */
321 // CHECK-LABEL: @test_vqmovunbq_m_s32(
322 // CHECK-NEXT: entry:
323 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
324 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
325 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
326 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
328 uint16x8_t
test_vqmovunbq_m_s32(uint16x8_t a
, int32x4_t b
, mve_pred16_t p
)
331 return vqmovunbq_m(a
, b
, p
);
332 #else /* POLYMORPHIC */
333 return vqmovunbq_m_s32(a
, b
, p
);
334 #endif /* POLYMORPHIC */
337 // CHECK-LABEL: @test_vqmovuntq_m_s16(
338 // CHECK-NEXT: entry:
339 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
340 // CHECK-NEXT: [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
341 // CHECK-NEXT: [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vqmovn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
342 // CHECK-NEXT: ret <16 x i8> [[TMP2]]
344 uint8x16_t
test_vqmovuntq_m_s16(uint8x16_t a
, int16x8_t b
, mve_pred16_t p
)
347 return vqmovuntq_m(a
, b
, p
);
348 #else /* POLYMORPHIC */
349 return vqmovuntq_m_s16(a
, b
, p
);
350 #endif /* POLYMORPHIC */
353 // CHECK-LABEL: @test_vqmovuntq_m_s32(
354 // CHECK-NEXT: entry:
355 // CHECK-NEXT: [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
356 // CHECK-NEXT: [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
357 // CHECK-NEXT: [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vqmovn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
358 // CHECK-NEXT: ret <8 x i16> [[TMP2]]
360 uint16x8_t
test_vqmovuntq_m_s32(uint16x8_t a
, int32x4_t b
, mve_pred16_t p
)
363 return vqmovuntq_m(a
, b
, p
);
364 #else /* POLYMORPHIC */
365 return vqmovuntq_m_s32(a
, b
, p
);
366 #endif /* POLYMORPHIC */