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.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -S -emit-llvm -o - %s | opt -S -mem2reg | FileCheck %s
3 // RUN: %clang_cc1 -triple thumbv8.1m.main-none-none-eabi -target-feature +mve.fp -mfloat-abi hard -fallow-half-arguments-and-returns -O0 -disable-O0-optnone -DPOLYMORPHIC -S -emit-llvm -o - %s | opt -S -mem2reg -sroa -early-cse | FileCheck %s
4 
5 #include <arm_mve.h>
6 
7 // CHECK-LABEL: @test_vrev16q_s8(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14>
10 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
11 //
test_vrev16q_s8(int8x16_t a)12 int8x16_t test_vrev16q_s8(int8x16_t a)
13 {
14 #ifdef POLYMORPHIC
15     return vrev16q(a);
16 #else /* POLYMORPHIC */
17     return vrev16q_s8(a);
18 #endif /* POLYMORPHIC */
19 }
20 
21 // CHECK-LABEL: @test_vrev16q_u8(
22 // CHECK-NEXT:  entry:
23 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6, i32 9, i32 8, i32 11, i32 10, i32 13, i32 12, i32 15, i32 14>
24 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
25 //
test_vrev16q_u8(uint8x16_t a)26 uint8x16_t test_vrev16q_u8(uint8x16_t a)
27 {
28 #ifdef POLYMORPHIC
29     return vrev16q(a);
30 #else /* POLYMORPHIC */
31     return vrev16q_u8(a);
32 #endif /* POLYMORPHIC */
33 }
34 
35 // CHECK-LABEL: @test_vrev32q_s8(
36 // CHECK-NEXT:  entry:
37 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12>
38 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
39 //
test_vrev32q_s8(int8x16_t a)40 int8x16_t test_vrev32q_s8(int8x16_t a)
41 {
42 #ifdef POLYMORPHIC
43     return vrev32q(a);
44 #else /* POLYMORPHIC */
45     return vrev32q_s8(a);
46 #endif /* POLYMORPHIC */
47 }
48 
49 // CHECK-LABEL: @test_vrev32q_u8(
50 // CHECK-NEXT:  entry:
51 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4, i32 11, i32 10, i32 9, i32 8, i32 15, i32 14, i32 13, i32 12>
52 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
53 //
test_vrev32q_u8(uint8x16_t a)54 uint8x16_t test_vrev32q_u8(uint8x16_t a)
55 {
56 #ifdef POLYMORPHIC
57     return vrev32q(a);
58 #else /* POLYMORPHIC */
59     return vrev32q_u8(a);
60 #endif /* POLYMORPHIC */
61 }
62 
63 // CHECK-LABEL: @test_vrev32q_s16(
64 // CHECK-NEXT:  entry:
65 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> undef, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
66 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
67 //
test_vrev32q_s16(int16x8_t a)68 int16x8_t test_vrev32q_s16(int16x8_t a)
69 {
70 #ifdef POLYMORPHIC
71     return vrev32q(a);
72 #else /* POLYMORPHIC */
73     return vrev32q_s16(a);
74 #endif /* POLYMORPHIC */
75 }
76 
77 // CHECK-LABEL: @test_vrev32q_u16(
78 // CHECK-NEXT:  entry:
79 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> undef, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
80 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
81 //
test_vrev32q_u16(uint16x8_t a)82 uint16x8_t test_vrev32q_u16(uint16x8_t a)
83 {
84 #ifdef POLYMORPHIC
85     return vrev32q(a);
86 #else /* POLYMORPHIC */
87     return vrev32q_u16(a);
88 #endif /* POLYMORPHIC */
89 }
90 
91 // CHECK-LABEL: @test_vrev32q_f16(
92 // CHECK-NEXT:  entry:
93 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x half> [[A:%.*]], <8 x half> undef, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
94 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
95 //
test_vrev32q_f16(float16x8_t a)96 float16x8_t test_vrev32q_f16(float16x8_t a)
97 {
98 #ifdef POLYMORPHIC
99     return vrev32q(a);
100 #else /* POLYMORPHIC */
101     return vrev32q_f16(a);
102 #endif /* POLYMORPHIC */
103 }
104 
105 // CHECK-LABEL: @test_vrev64q_s8(
106 // CHECK-NEXT:  entry:
107 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8>
108 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
109 //
test_vrev64q_s8(int8x16_t a)110 int8x16_t test_vrev64q_s8(int8x16_t a)
111 {
112 #ifdef POLYMORPHIC
113     return vrev64q(a);
114 #else /* POLYMORPHIC */
115     return vrev64q_s8(a);
116 #endif /* POLYMORPHIC */
117 }
118 
119 // CHECK-LABEL: @test_vrev64q_u8(
120 // CHECK-NEXT:  entry:
121 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <16 x i8> [[A:%.*]], <16 x i8> undef, <16 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0, i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8>
122 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
123 //
test_vrev64q_u8(uint8x16_t a)124 uint8x16_t test_vrev64q_u8(uint8x16_t a)
125 {
126 #ifdef POLYMORPHIC
127     return vrev64q(a);
128 #else /* POLYMORPHIC */
129     return vrev64q_u8(a);
130 #endif /* POLYMORPHIC */
131 }
132 
133 // CHECK-LABEL: @test_vrev64q_s16(
134 // CHECK-NEXT:  entry:
135 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> undef, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
136 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
137 //
test_vrev64q_s16(int16x8_t a)138 int16x8_t test_vrev64q_s16(int16x8_t a)
139 {
140 #ifdef POLYMORPHIC
141     return vrev64q(a);
142 #else /* POLYMORPHIC */
143     return vrev64q_s16(a);
144 #endif /* POLYMORPHIC */
145 }
146 
147 // CHECK-LABEL: @test_vrev64q_u16(
148 // CHECK-NEXT:  entry:
149 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x i16> [[A:%.*]], <8 x i16> undef, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
150 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
151 //
test_vrev64q_u16(uint16x8_t a)152 uint16x8_t test_vrev64q_u16(uint16x8_t a)
153 {
154 #ifdef POLYMORPHIC
155     return vrev64q(a);
156 #else /* POLYMORPHIC */
157     return vrev64q_u16(a);
158 #endif /* POLYMORPHIC */
159 }
160 
161 // CHECK-LABEL: @test_vrev64q_f16(
162 // CHECK-NEXT:  entry:
163 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <8 x half> [[A:%.*]], <8 x half> undef, <8 x i32> <i32 3, i32 2, i32 1, i32 0, i32 7, i32 6, i32 5, i32 4>
164 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
165 //
test_vrev64q_f16(float16x8_t a)166 float16x8_t test_vrev64q_f16(float16x8_t a)
167 {
168 #ifdef POLYMORPHIC
169     return vrev64q(a);
170 #else /* POLYMORPHIC */
171     return vrev64q_f16(a);
172 #endif /* POLYMORPHIC */
173 }
174 
175 // CHECK-LABEL: @test_vrev64q_f32(
176 // CHECK-NEXT:  entry:
177 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <4 x float> [[A:%.*]], <4 x float> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
178 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
179 //
test_vrev64q_f32(float32x4_t a)180 float32x4_t test_vrev64q_f32(float32x4_t a)
181 {
182 #ifdef POLYMORPHIC
183     return vrev64q(a);
184 #else /* POLYMORPHIC */
185     return vrev64q_f32(a);
186 #endif /* POLYMORPHIC */
187 }
188 
189 // CHECK-LABEL: @test_vrev64q_s32(
190 // CHECK-NEXT:  entry:
191 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
192 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
193 //
test_vrev64q_s32(int32x4_t a)194 int32x4_t test_vrev64q_s32(int32x4_t a)
195 {
196 #ifdef POLYMORPHIC
197     return vrev64q(a);
198 #else /* POLYMORPHIC */
199     return vrev64q_s32(a);
200 #endif /* POLYMORPHIC */
201 }
202 
203 // CHECK-LABEL: @test_vrev64q_u32(
204 // CHECK-NEXT:  entry:
205 // CHECK-NEXT:    [[TMP0:%.*]] = shufflevector <4 x i32> [[A:%.*]], <4 x i32> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
206 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
207 //
test_vrev64q_u32(uint32x4_t a)208 uint32x4_t test_vrev64q_u32(uint32x4_t a)
209 {
210 #ifdef POLYMORPHIC
211     return vrev64q(a);
212 #else /* POLYMORPHIC */
213     return vrev64q_u32(a);
214 #endif /* POLYMORPHIC */
215 }
216 
217 // CHECK-LABEL: @test_vrev16q_m_s8(
218 // CHECK-NEXT:  entry:
219 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
220 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
221 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 16, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
222 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
223 //
test_vrev16q_m_s8(int8x16_t inactive,int8x16_t a,mve_pred16_t p)224 int8x16_t test_vrev16q_m_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
225 {
226 #ifdef POLYMORPHIC
227     return vrev16q_m(inactive, a, p);
228 #else /* POLYMORPHIC */
229     return vrev16q_m_s8(inactive, a, p);
230 #endif /* POLYMORPHIC */
231 }
232 
233 // CHECK-LABEL: @test_vrev16q_m_u8(
234 // CHECK-NEXT:  entry:
235 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
236 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
237 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 16, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
238 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
239 //
test_vrev16q_m_u8(uint8x16_t inactive,uint8x16_t a,mve_pred16_t p)240 uint8x16_t test_vrev16q_m_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
241 {
242 #ifdef POLYMORPHIC
243     return vrev16q_m(inactive, a, p);
244 #else /* POLYMORPHIC */
245     return vrev16q_m_u8(inactive, a, p);
246 #endif /* POLYMORPHIC */
247 }
248 
249 // CHECK-LABEL: @test_vrev32q_m_f16(
250 // CHECK-NEXT:  entry:
251 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
252 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
253 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrev.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
254 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
255 //
test_vrev32q_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)256 float16x8_t test_vrev32q_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
257 {
258 #ifdef POLYMORPHIC
259     return vrev32q_m(inactive, a, p);
260 #else /* POLYMORPHIC */
261     return vrev32q_m_f16(inactive, a, p);
262 #endif /* POLYMORPHIC */
263 }
264 
265 // CHECK-LABEL: @test_vrev32q_m_s8(
266 // CHECK-NEXT:  entry:
267 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
268 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
269 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 32, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
270 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
271 //
test_vrev32q_m_s8(int8x16_t inactive,int8x16_t a,mve_pred16_t p)272 int8x16_t test_vrev32q_m_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
273 {
274 #ifdef POLYMORPHIC
275     return vrev32q_m(inactive, a, p);
276 #else /* POLYMORPHIC */
277     return vrev32q_m_s8(inactive, a, p);
278 #endif /* POLYMORPHIC */
279 }
280 
281 // CHECK-LABEL: @test_vrev32q_m_s16(
282 // CHECK-NEXT:  entry:
283 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
284 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
285 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
286 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
287 //
test_vrev32q_m_s16(int16x8_t inactive,int16x8_t a,mve_pred16_t p)288 int16x8_t test_vrev32q_m_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
289 {
290 #ifdef POLYMORPHIC
291     return vrev32q_m(inactive, a, p);
292 #else /* POLYMORPHIC */
293     return vrev32q_m_s16(inactive, a, p);
294 #endif /* POLYMORPHIC */
295 }
296 
297 // CHECK-LABEL: @test_vrev32q_m_u8(
298 // CHECK-NEXT:  entry:
299 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
300 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
301 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 32, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
302 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
303 //
test_vrev32q_m_u8(uint8x16_t inactive,uint8x16_t a,mve_pred16_t p)304 uint8x16_t test_vrev32q_m_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
305 {
306 #ifdef POLYMORPHIC
307     return vrev32q_m(inactive, a, p);
308 #else /* POLYMORPHIC */
309     return vrev32q_m_u8(inactive, a, p);
310 #endif /* POLYMORPHIC */
311 }
312 
313 // CHECK-LABEL: @test_vrev32q_m_u16(
314 // CHECK-NEXT:  entry:
315 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
316 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
317 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
318 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
319 //
test_vrev32q_m_u16(uint16x8_t inactive,uint16x8_t a,mve_pred16_t p)320 uint16x8_t test_vrev32q_m_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
321 {
322 #ifdef POLYMORPHIC
323     return vrev32q_m(inactive, a, p);
324 #else /* POLYMORPHIC */
325     return vrev32q_m_u16(inactive, a, p);
326 #endif /* POLYMORPHIC */
327 }
328 
329 // CHECK-LABEL: @test_vrev64q_m_f16(
330 // CHECK-NEXT:  entry:
331 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
332 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
333 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrev.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
334 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
335 //
test_vrev64q_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)336 float16x8_t test_vrev64q_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
337 {
338 #ifdef POLYMORPHIC
339     return vrev64q_m(inactive, a, p);
340 #else /* POLYMORPHIC */
341     return vrev64q_m_f16(inactive, a, p);
342 #endif /* POLYMORPHIC */
343 }
344 
345 // CHECK-LABEL: @test_vrev64q_m_f32(
346 // CHECK-NEXT:  entry:
347 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
348 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
349 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrev.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
350 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
351 //
test_vrev64q_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)352 float32x4_t test_vrev64q_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
353 {
354 #ifdef POLYMORPHIC
355     return vrev64q_m(inactive, a, p);
356 #else /* POLYMORPHIC */
357     return vrev64q_m_f32(inactive, a, p);
358 #endif /* POLYMORPHIC */
359 }
360 
361 // CHECK-LABEL: @test_vrev64q_m_s8(
362 // CHECK-NEXT:  entry:
363 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
364 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
365 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 64, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
366 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
367 //
test_vrev64q_m_s8(int8x16_t inactive,int8x16_t a,mve_pred16_t p)368 int8x16_t test_vrev64q_m_s8(int8x16_t inactive, int8x16_t a, mve_pred16_t p)
369 {
370 #ifdef POLYMORPHIC
371     return vrev64q_m(inactive, a, p);
372 #else /* POLYMORPHIC */
373     return vrev64q_m_s8(inactive, a, p);
374 #endif /* POLYMORPHIC */
375 }
376 
377 // CHECK-LABEL: @test_vrev64q_m_s16(
378 // CHECK-NEXT:  entry:
379 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
380 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
381 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
382 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
383 //
test_vrev64q_m_s16(int16x8_t inactive,int16x8_t a,mve_pred16_t p)384 int16x8_t test_vrev64q_m_s16(int16x8_t inactive, int16x8_t a, mve_pred16_t p)
385 {
386 #ifdef POLYMORPHIC
387     return vrev64q_m(inactive, a, p);
388 #else /* POLYMORPHIC */
389     return vrev64q_m_s16(inactive, a, p);
390 #endif /* POLYMORPHIC */
391 }
392 
393 // CHECK-LABEL: @test_vrev64q_m_s32(
394 // CHECK-NEXT:  entry:
395 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
396 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
397 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrev.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
398 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
399 //
test_vrev64q_m_s32(int32x4_t inactive,int32x4_t a,mve_pred16_t p)400 int32x4_t test_vrev64q_m_s32(int32x4_t inactive, int32x4_t a, mve_pred16_t p)
401 {
402 #ifdef POLYMORPHIC
403     return vrev64q_m(inactive, a, p);
404 #else /* POLYMORPHIC */
405     return vrev64q_m_s32(inactive, a, p);
406 #endif /* POLYMORPHIC */
407 }
408 
409 // CHECK-LABEL: @test_vrev64q_m_u8(
410 // CHECK-NEXT:  entry:
411 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
412 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
413 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 64, <16 x i1> [[TMP1]], <16 x i8> [[INACTIVE:%.*]])
414 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
415 //
test_vrev64q_m_u8(uint8x16_t inactive,uint8x16_t a,mve_pred16_t p)416 uint8x16_t test_vrev64q_m_u8(uint8x16_t inactive, uint8x16_t a, mve_pred16_t p)
417 {
418 #ifdef POLYMORPHIC
419     return vrev64q_m(inactive, a, p);
420 #else /* POLYMORPHIC */
421     return vrev64q_m_u8(inactive, a, p);
422 #endif /* POLYMORPHIC */
423 }
424 
425 // CHECK-LABEL: @test_vrev64q_m_u16(
426 // CHECK-NEXT:  entry:
427 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
428 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
429 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x i16> [[INACTIVE:%.*]])
430 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
431 //
test_vrev64q_m_u16(uint16x8_t inactive,uint16x8_t a,mve_pred16_t p)432 uint16x8_t test_vrev64q_m_u16(uint16x8_t inactive, uint16x8_t a, mve_pred16_t p)
433 {
434 #ifdef POLYMORPHIC
435     return vrev64q_m(inactive, a, p);
436 #else /* POLYMORPHIC */
437     return vrev64q_m_u16(inactive, a, p);
438 #endif /* POLYMORPHIC */
439 }
440 
441 // CHECK-LABEL: @test_vrev64q_m_u32(
442 // CHECK-NEXT:  entry:
443 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
444 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
445 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrev.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x i32> [[INACTIVE:%.*]])
446 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
447 //
test_vrev64q_m_u32(uint32x4_t inactive,uint32x4_t a,mve_pred16_t p)448 uint32x4_t test_vrev64q_m_u32(uint32x4_t inactive, uint32x4_t a, mve_pred16_t p)
449 {
450 #ifdef POLYMORPHIC
451     return vrev64q_m(inactive, a, p);
452 #else /* POLYMORPHIC */
453     return vrev64q_m_u32(inactive, a, p);
454 #endif /* POLYMORPHIC */
455 }
456 
457 // CHECK-LABEL: @test_vrev16q_x_s8(
458 // CHECK-NEXT:  entry:
459 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
460 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
461 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 16, <16 x i1> [[TMP1]], <16 x i8> undef)
462 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
463 //
test_vrev16q_x_s8(int8x16_t a,mve_pred16_t p)464 int8x16_t test_vrev16q_x_s8(int8x16_t a, mve_pred16_t p)
465 {
466 #ifdef POLYMORPHIC
467     return vrev16q_x(a, p);
468 #else /* POLYMORPHIC */
469     return vrev16q_x_s8(a, p);
470 #endif /* POLYMORPHIC */
471 }
472 
473 // CHECK-LABEL: @test_vrev16q_x_u8(
474 // CHECK-NEXT:  entry:
475 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
476 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
477 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 16, <16 x i1> [[TMP1]], <16 x i8> undef)
478 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
479 //
test_vrev16q_x_u8(uint8x16_t a,mve_pred16_t p)480 uint8x16_t test_vrev16q_x_u8(uint8x16_t a, mve_pred16_t p)
481 {
482 #ifdef POLYMORPHIC
483     return vrev16q_x(a, p);
484 #else /* POLYMORPHIC */
485     return vrev16q_x_u8(a, p);
486 #endif /* POLYMORPHIC */
487 }
488 
489 // CHECK-LABEL: @test_vrev32q_x_f16(
490 // CHECK-NEXT:  entry:
491 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
492 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
493 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrev.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x half> undef)
494 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
495 //
test_vrev32q_x_f16(float16x8_t a,mve_pred16_t p)496 float16x8_t test_vrev32q_x_f16(float16x8_t a, mve_pred16_t p)
497 {
498 #ifdef POLYMORPHIC
499     return vrev32q_x(a, p);
500 #else /* POLYMORPHIC */
501     return vrev32q_x_f16(a, p);
502 #endif /* POLYMORPHIC */
503 }
504 
505 // CHECK-LABEL: @test_vrev32q_x_s8(
506 // CHECK-NEXT:  entry:
507 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
508 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
509 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 32, <16 x i1> [[TMP1]], <16 x i8> undef)
510 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
511 //
test_vrev32q_x_s8(int8x16_t a,mve_pred16_t p)512 int8x16_t test_vrev32q_x_s8(int8x16_t a, mve_pred16_t p)
513 {
514 #ifdef POLYMORPHIC
515     return vrev32q_x(a, p);
516 #else /* POLYMORPHIC */
517     return vrev32q_x_s8(a, p);
518 #endif /* POLYMORPHIC */
519 }
520 
521 // CHECK-LABEL: @test_vrev32q_x_s16(
522 // CHECK-NEXT:  entry:
523 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
524 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
525 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x i16> undef)
526 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
527 //
test_vrev32q_x_s16(int16x8_t a,mve_pred16_t p)528 int16x8_t test_vrev32q_x_s16(int16x8_t a, mve_pred16_t p)
529 {
530 #ifdef POLYMORPHIC
531     return vrev32q_x(a, p);
532 #else /* POLYMORPHIC */
533     return vrev32q_x_s16(a, p);
534 #endif /* POLYMORPHIC */
535 }
536 
537 // CHECK-LABEL: @test_vrev32q_x_u8(
538 // CHECK-NEXT:  entry:
539 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
540 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
541 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 32, <16 x i1> [[TMP1]], <16 x i8> undef)
542 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
543 //
test_vrev32q_x_u8(uint8x16_t a,mve_pred16_t p)544 uint8x16_t test_vrev32q_x_u8(uint8x16_t a, mve_pred16_t p)
545 {
546 #ifdef POLYMORPHIC
547     return vrev32q_x(a, p);
548 #else /* POLYMORPHIC */
549     return vrev32q_x_u8(a, p);
550 #endif /* POLYMORPHIC */
551 }
552 
553 // CHECK-LABEL: @test_vrev32q_x_u16(
554 // CHECK-NEXT:  entry:
555 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
556 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
557 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 32, <8 x i1> [[TMP1]], <8 x i16> undef)
558 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
559 //
test_vrev32q_x_u16(uint16x8_t a,mve_pred16_t p)560 uint16x8_t test_vrev32q_x_u16(uint16x8_t a, mve_pred16_t p)
561 {
562 #ifdef POLYMORPHIC
563     return vrev32q_x(a, p);
564 #else /* POLYMORPHIC */
565     return vrev32q_x_u16(a, p);
566 #endif /* POLYMORPHIC */
567 }
568 
569 // CHECK-LABEL: @test_vrev64q_x_f16(
570 // CHECK-NEXT:  entry:
571 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
572 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
573 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrev.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x half> undef)
574 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
575 //
test_vrev64q_x_f16(float16x8_t a,mve_pred16_t p)576 float16x8_t test_vrev64q_x_f16(float16x8_t a, mve_pred16_t p)
577 {
578 #ifdef POLYMORPHIC
579     return vrev64q_x(a, p);
580 #else /* POLYMORPHIC */
581     return vrev64q_x_f16(a, p);
582 #endif /* POLYMORPHIC */
583 }
584 
585 // CHECK-LABEL: @test_vrev64q_x_f32(
586 // CHECK-NEXT:  entry:
587 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
588 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
589 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrev.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x float> undef)
590 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
591 //
test_vrev64q_x_f32(float32x4_t a,mve_pred16_t p)592 float32x4_t test_vrev64q_x_f32(float32x4_t a, mve_pred16_t p)
593 {
594 #ifdef POLYMORPHIC
595     return vrev64q_x(a, p);
596 #else /* POLYMORPHIC */
597     return vrev64q_x_f32(a, p);
598 #endif /* POLYMORPHIC */
599 }
600 
601 // CHECK-LABEL: @test_vrev64q_x_s8(
602 // CHECK-NEXT:  entry:
603 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
604 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
605 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 64, <16 x i1> [[TMP1]], <16 x i8> undef)
606 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
607 //
test_vrev64q_x_s8(int8x16_t a,mve_pred16_t p)608 int8x16_t test_vrev64q_x_s8(int8x16_t a, mve_pred16_t p)
609 {
610 #ifdef POLYMORPHIC
611     return vrev64q_x(a, p);
612 #else /* POLYMORPHIC */
613     return vrev64q_x_s8(a, p);
614 #endif /* POLYMORPHIC */
615 }
616 
617 // CHECK-LABEL: @test_vrev64q_x_s16(
618 // CHECK-NEXT:  entry:
619 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
620 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
621 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x i16> undef)
622 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
623 //
test_vrev64q_x_s16(int16x8_t a,mve_pred16_t p)624 int16x8_t test_vrev64q_x_s16(int16x8_t a, mve_pred16_t p)
625 {
626 #ifdef POLYMORPHIC
627     return vrev64q_x(a, p);
628 #else /* POLYMORPHIC */
629     return vrev64q_x_s16(a, p);
630 #endif /* POLYMORPHIC */
631 }
632 
633 // CHECK-LABEL: @test_vrev64q_x_s32(
634 // CHECK-NEXT:  entry:
635 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
636 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
637 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrev.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x i32> undef)
638 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
639 //
test_vrev64q_x_s32(int32x4_t a,mve_pred16_t p)640 int32x4_t test_vrev64q_x_s32(int32x4_t a, mve_pred16_t p)
641 {
642 #ifdef POLYMORPHIC
643     return vrev64q_x(a, p);
644 #else /* POLYMORPHIC */
645     return vrev64q_x_s32(a, p);
646 #endif /* POLYMORPHIC */
647 }
648 
649 // CHECK-LABEL: @test_vrev64q_x_u8(
650 // CHECK-NEXT:  entry:
651 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
652 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
653 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vrev.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], i32 64, <16 x i1> [[TMP1]], <16 x i8> undef)
654 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
655 //
test_vrev64q_x_u8(uint8x16_t a,mve_pred16_t p)656 uint8x16_t test_vrev64q_x_u8(uint8x16_t a, mve_pred16_t p)
657 {
658 #ifdef POLYMORPHIC
659     return vrev64q_x(a, p);
660 #else /* POLYMORPHIC */
661     return vrev64q_x_u8(a, p);
662 #endif /* POLYMORPHIC */
663 }
664 
665 // CHECK-LABEL: @test_vrev64q_x_u16(
666 // CHECK-NEXT:  entry:
667 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
668 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
669 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vrev.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], i32 64, <8 x i1> [[TMP1]], <8 x i16> undef)
670 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
671 //
test_vrev64q_x_u16(uint16x8_t a,mve_pred16_t p)672 uint16x8_t test_vrev64q_x_u16(uint16x8_t a, mve_pred16_t p)
673 {
674 #ifdef POLYMORPHIC
675     return vrev64q_x(a, p);
676 #else /* POLYMORPHIC */
677     return vrev64q_x_u16(a, p);
678 #endif /* POLYMORPHIC */
679 }
680 
681 // CHECK-LABEL: @test_vrev64q_x_u32(
682 // CHECK-NEXT:  entry:
683 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
684 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
685 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vrev.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], i32 64, <4 x i1> [[TMP1]], <4 x i32> undef)
686 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
687 //
test_vrev64q_x_u32(uint32x4_t a,mve_pred16_t p)688 uint32x4_t test_vrev64q_x_u32(uint32x4_t a, mve_pred16_t p)
689 {
690 #ifdef POLYMORPHIC
691     return vrev64q_x(a, p);
692 #else /* POLYMORPHIC */
693     return vrev64q_x_u32(a, p);
694 #endif /* POLYMORPHIC */
695 }
696