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 | FileCheck %s
4 
5 #include <arm_mve.h>
6 
7 // CHECK-LABEL: @test_vshrnbq_n_s16(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 0, i32 0, i32 0, i32 0, i32 0)
10 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
11 //
test_vshrnbq_n_s16(int8x16_t a,int16x8_t b)12 int8x16_t test_vshrnbq_n_s16(int8x16_t a, int16x8_t b)
13 {
14 #ifdef POLYMORPHIC
15     return vshrnbq(a, b, 3);
16 #else /* POLYMORPHIC */
17     return vshrnbq_n_s16(a, b, 3);
18 #endif /* POLYMORPHIC */
19 }
20 
21 // CHECK-LABEL: @test_vshrnbq_n_s32(
22 // CHECK-NEXT:  entry:
23 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 9, i32 0, i32 0, i32 0, i32 0, i32 0)
24 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
25 //
test_vshrnbq_n_s32(int16x8_t a,int32x4_t b)26 int16x8_t test_vshrnbq_n_s32(int16x8_t a, int32x4_t b)
27 {
28 #ifdef POLYMORPHIC
29     return vshrnbq(a, b, 9);
30 #else /* POLYMORPHIC */
31     return vshrnbq_n_s32(a, b, 9);
32 #endif /* POLYMORPHIC */
33 }
34 
35 // CHECK-LABEL: @test_vshrnbq_n_u16(
36 // CHECK-NEXT:  entry:
37 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 1, i32 1, i32 0)
38 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
39 //
test_vshrnbq_n_u16(uint8x16_t a,uint16x8_t b)40 uint8x16_t test_vshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
41 {
42 #ifdef POLYMORPHIC
43     return vshrnbq(a, b, 1);
44 #else /* POLYMORPHIC */
45     return vshrnbq_n_u16(a, b, 1);
46 #endif /* POLYMORPHIC */
47 }
48 
49 // CHECK-LABEL: @test_vshrnbq_n_u32(
50 // CHECK-NEXT:  entry:
51 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 0, i32 0, i32 1, i32 1, i32 0)
52 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
53 //
test_vshrnbq_n_u32(uint16x8_t a,uint32x4_t b)54 uint16x8_t test_vshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
55 {
56 #ifdef POLYMORPHIC
57     return vshrnbq(a, b, 3);
58 #else /* POLYMORPHIC */
59     return vshrnbq_n_u32(a, b, 3);
60 #endif /* POLYMORPHIC */
61 }
62 
63 // CHECK-LABEL: @test_vshrntq_n_s16(
64 // CHECK-NEXT:  entry:
65 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 0, i32 0, i32 1)
66 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
67 //
test_vshrntq_n_s16(int8x16_t a,int16x8_t b)68 int8x16_t test_vshrntq_n_s16(int8x16_t a, int16x8_t b)
69 {
70 #ifdef POLYMORPHIC
71     return vshrntq(a, b, 1);
72 #else /* POLYMORPHIC */
73     return vshrntq_n_s16(a, b, 1);
74 #endif /* POLYMORPHIC */
75 }
76 
77 // CHECK-LABEL: @test_vshrntq_n_s32(
78 // CHECK-NEXT:  entry:
79 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 0, i32 0, i32 1)
80 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
81 //
test_vshrntq_n_s32(int16x8_t a,int32x4_t b)82 int16x8_t test_vshrntq_n_s32(int16x8_t a, int32x4_t b)
83 {
84 #ifdef POLYMORPHIC
85     return vshrntq(a, b, 10);
86 #else /* POLYMORPHIC */
87     return vshrntq_n_s32(a, b, 10);
88 #endif /* POLYMORPHIC */
89 }
90 
91 // CHECK-LABEL: @test_vshrntq_n_u16(
92 // CHECK-NEXT:  entry:
93 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 0, i32 1, i32 1, i32 1)
94 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
95 //
test_vshrntq_n_u16(uint8x16_t a,uint16x8_t b)96 uint8x16_t test_vshrntq_n_u16(uint8x16_t a, uint16x8_t b)
97 {
98 #ifdef POLYMORPHIC
99     return vshrntq(a, b, 6);
100 #else /* POLYMORPHIC */
101     return vshrntq_n_u16(a, b, 6);
102 #endif /* POLYMORPHIC */
103 }
104 
105 // CHECK-LABEL: @test_vshrntq_n_u32(
106 // CHECK-NEXT:  entry:
107 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 1, i32 1, i32 1)
108 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
109 //
test_vshrntq_n_u32(uint16x8_t a,uint32x4_t b)110 uint16x8_t test_vshrntq_n_u32(uint16x8_t a, uint32x4_t b)
111 {
112 #ifdef POLYMORPHIC
113     return vshrntq(a, b, 10);
114 #else /* POLYMORPHIC */
115     return vshrntq_n_u32(a, b, 10);
116 #endif /* POLYMORPHIC */
117 }
118 
119 // CHECK-LABEL: @test_vshrnbq_m_n_s16(
120 // CHECK-NEXT:  entry:
121 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
122 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
123 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 0, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
124 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
125 //
test_vshrnbq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)126 int8x16_t test_vshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
127 {
128 #ifdef POLYMORPHIC
129     return vshrnbq_m(a, b, 4, p);
130 #else /* POLYMORPHIC */
131     return vshrnbq_m_n_s16(a, b, 4, p);
132 #endif /* POLYMORPHIC */
133 }
134 
135 // CHECK-LABEL: @test_vshrnbq_m_n_s32(
136 // CHECK-NEXT:  entry:
137 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
138 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
139 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 0, i32 0, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
140 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
141 //
test_vshrnbq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)142 int16x8_t test_vshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
143 {
144 #ifdef POLYMORPHIC
145     return vshrnbq_m(a, b, 13, p);
146 #else /* POLYMORPHIC */
147     return vshrnbq_m_n_s32(a, b, 13, p);
148 #endif /* POLYMORPHIC */
149 }
150 
151 // CHECK-LABEL: @test_vshrnbq_m_n_u16(
152 // CHECK-NEXT:  entry:
153 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
154 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
155 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 0, i32 0, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
156 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
157 //
test_vshrnbq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)158 uint8x16_t test_vshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
159 {
160 #ifdef POLYMORPHIC
161     return vshrnbq_m(a, b, 7, p);
162 #else /* POLYMORPHIC */
163     return vshrnbq_m_n_u16(a, b, 7, p);
164 #endif /* POLYMORPHIC */
165 }
166 
167 // CHECK-LABEL: @test_vshrnbq_m_n_u32(
168 // CHECK-NEXT:  entry:
169 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
170 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
171 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 0, i32 0, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
172 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
173 //
test_vshrnbq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)174 uint16x8_t test_vshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
175 {
176 #ifdef POLYMORPHIC
177     return vshrnbq_m(a, b, 15, p);
178 #else /* POLYMORPHIC */
179     return vshrnbq_m_n_u32(a, b, 15, p);
180 #endif /* POLYMORPHIC */
181 }
182 
183 // CHECK-LABEL: @test_vshrntq_m_n_s16(
184 // CHECK-NEXT:  entry:
185 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
186 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
187 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 0, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
188 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
189 //
test_vshrntq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)190 int8x16_t test_vshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
191 {
192 #ifdef POLYMORPHIC
193     return vshrntq_m(a, b, 6, p);
194 #else /* POLYMORPHIC */
195     return vshrntq_m_n_s16(a, b, 6, p);
196 #endif /* POLYMORPHIC */
197 }
198 
199 // CHECK-LABEL: @test_vshrntq_m_n_s32(
200 // CHECK-NEXT:  entry:
201 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
202 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
203 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 0, i32 0, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
204 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
205 //
test_vshrntq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)206 int16x8_t test_vshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
207 {
208 #ifdef POLYMORPHIC
209     return vshrntq_m(a, b, 13, p);
210 #else /* POLYMORPHIC */
211     return vshrntq_m_n_s32(a, b, 13, p);
212 #endif /* POLYMORPHIC */
213 }
214 
215 // CHECK-LABEL: @test_vshrntq_m_n_u16(
216 // CHECK-NEXT:  entry:
217 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
218 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
219 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 0, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
220 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
221 //
test_vshrntq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)222 uint8x16_t test_vshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
223 {
224 #ifdef POLYMORPHIC
225     return vshrntq_m(a, b, 1, p);
226 #else /* POLYMORPHIC */
227     return vshrntq_m_n_u16(a, b, 1, p);
228 #endif /* POLYMORPHIC */
229 }
230 
231 // CHECK-LABEL: @test_vshrntq_m_n_u32(
232 // CHECK-NEXT:  entry:
233 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
234 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
235 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 0, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
236 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
237 //
test_vshrntq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)238 uint16x8_t test_vshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
239 {
240 #ifdef POLYMORPHIC
241     return vshrntq_m(a, b, 10, p);
242 #else /* POLYMORPHIC */
243     return vshrntq_m_n_u32(a, b, 10, p);
244 #endif /* POLYMORPHIC */
245 }
246 
247 // CHECK-LABEL: @test_vrshrnbq_n_s16(
248 // CHECK-NEXT:  entry:
249 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 0, i32 1, i32 0, i32 0, i32 0)
250 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
251 //
test_vrshrnbq_n_s16(int8x16_t a,int16x8_t b)252 int8x16_t test_vrshrnbq_n_s16(int8x16_t a, int16x8_t b)
253 {
254 #ifdef POLYMORPHIC
255     return vrshrnbq(a, b, 5);
256 #else /* POLYMORPHIC */
257     return vrshrnbq_n_s16(a, b, 5);
258 #endif /* POLYMORPHIC */
259 }
260 
261 // CHECK-LABEL: @test_vrshrnbq_n_s32(
262 // CHECK-NEXT:  entry:
263 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 1, i32 0, i32 0, i32 0)
264 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
265 //
test_vrshrnbq_n_s32(int16x8_t a,int32x4_t b)266 int16x8_t test_vrshrnbq_n_s32(int16x8_t a, int32x4_t b)
267 {
268 #ifdef POLYMORPHIC
269     return vrshrnbq(a, b, 10);
270 #else /* POLYMORPHIC */
271     return vrshrnbq_n_s32(a, b, 10);
272 #endif /* POLYMORPHIC */
273 }
274 
275 // CHECK-LABEL: @test_vrshrnbq_n_u16(
276 // CHECK-NEXT:  entry:
277 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 0, i32 1, i32 1, i32 1, i32 0)
278 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
279 //
test_vrshrnbq_n_u16(uint8x16_t a,uint16x8_t b)280 uint8x16_t test_vrshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
281 {
282 #ifdef POLYMORPHIC
283     return vrshrnbq(a, b, 2);
284 #else /* POLYMORPHIC */
285     return vrshrnbq_n_u16(a, b, 2);
286 #endif /* POLYMORPHIC */
287 }
288 
289 // CHECK-LABEL: @test_vrshrnbq_n_u32(
290 // CHECK-NEXT:  entry:
291 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 0, i32 1, i32 1, i32 1, i32 0)
292 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
293 //
test_vrshrnbq_n_u32(uint16x8_t a,uint32x4_t b)294 uint16x8_t test_vrshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
295 {
296 #ifdef POLYMORPHIC
297     return vrshrnbq(a, b, 12);
298 #else /* POLYMORPHIC */
299     return vrshrnbq_n_u32(a, b, 12);
300 #endif /* POLYMORPHIC */
301 }
302 
303 // CHECK-LABEL: @test_vrshrntq_n_s16(
304 // CHECK-NEXT:  entry:
305 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 1, i32 0, i32 0, i32 1)
306 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
307 //
test_vrshrntq_n_s16(int8x16_t a,int16x8_t b)308 int8x16_t test_vrshrntq_n_s16(int8x16_t a, int16x8_t b)
309 {
310 #ifdef POLYMORPHIC
311     return vrshrntq(a, b, 4);
312 #else /* POLYMORPHIC */
313     return vrshrntq_n_s16(a, b, 4);
314 #endif /* POLYMORPHIC */
315 }
316 
317 // CHECK-LABEL: @test_vrshrntq_n_s32(
318 // CHECK-NEXT:  entry:
319 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 0, i32 1, i32 0, i32 0, i32 1)
320 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
321 //
test_vrshrntq_n_s32(int16x8_t a,int32x4_t b)322 int16x8_t test_vrshrntq_n_s32(int16x8_t a, int32x4_t b)
323 {
324 #ifdef POLYMORPHIC
325     return vrshrntq(a, b, 11);
326 #else /* POLYMORPHIC */
327     return vrshrntq_n_s32(a, b, 11);
328 #endif /* POLYMORPHIC */
329 }
330 
331 // CHECK-LABEL: @test_vrshrntq_n_u16(
332 // CHECK-NEXT:  entry:
333 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, i32 1, i32 1, i32 1)
334 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
335 //
test_vrshrntq_n_u16(uint8x16_t a,uint16x8_t b)336 uint8x16_t test_vrshrntq_n_u16(uint8x16_t a, uint16x8_t b)
337 {
338 #ifdef POLYMORPHIC
339     return vrshrntq(a, b, 1);
340 #else /* POLYMORPHIC */
341     return vrshrntq_n_u16(a, b, 1);
342 #endif /* POLYMORPHIC */
343 }
344 
345 // CHECK-LABEL: @test_vrshrntq_n_u32(
346 // CHECK-NEXT:  entry:
347 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 0, i32 1, i32 1, i32 1, i32 1)
348 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
349 //
test_vrshrntq_n_u32(uint16x8_t a,uint32x4_t b)350 uint16x8_t test_vrshrntq_n_u32(uint16x8_t a, uint32x4_t b)
351 {
352 #ifdef POLYMORPHIC
353     return vrshrntq(a, b, 6);
354 #else /* POLYMORPHIC */
355     return vrshrntq_n_u32(a, b, 6);
356 #endif /* POLYMORPHIC */
357 }
358 
359 // CHECK-LABEL: @test_vrshrnbq_m_n_s16(
360 // CHECK-NEXT:  entry:
361 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
362 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
363 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 0, i32 1, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
364 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
365 //
test_vrshrnbq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)366 int8x16_t test_vrshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
367 {
368 #ifdef POLYMORPHIC
369     return vrshrnbq_m(a, b, 1, p);
370 #else /* POLYMORPHIC */
371     return vrshrnbq_m_n_s16(a, b, 1, p);
372 #endif /* POLYMORPHIC */
373 }
374 
375 // CHECK-LABEL: @test_vrshrnbq_m_n_s32(
376 // CHECK-NEXT:  entry:
377 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
378 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
379 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 14, i32 0, i32 1, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
380 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
381 //
test_vrshrnbq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)382 int16x8_t test_vrshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
383 {
384 #ifdef POLYMORPHIC
385     return vrshrnbq_m(a, b, 14, p);
386 #else /* POLYMORPHIC */
387     return vrshrnbq_m_n_s32(a, b, 14, p);
388 #endif /* POLYMORPHIC */
389 }
390 
391 // CHECK-LABEL: @test_vrshrnbq_m_n_u16(
392 // CHECK-NEXT:  entry:
393 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
394 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
395 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 0, i32 1, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
396 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
397 //
test_vrshrnbq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)398 uint8x16_t test_vrshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
399 {
400 #ifdef POLYMORPHIC
401     return vrshrnbq_m(a, b, 2, p);
402 #else /* POLYMORPHIC */
403     return vrshrnbq_m_n_u16(a, b, 2, p);
404 #endif /* POLYMORPHIC */
405 }
406 
407 // CHECK-LABEL: @test_vrshrnbq_m_n_u32(
408 // CHECK-NEXT:  entry:
409 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
410 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
411 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 0, i32 1, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
412 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
413 //
test_vrshrnbq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)414 uint16x8_t test_vrshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
415 {
416 #ifdef POLYMORPHIC
417     return vrshrnbq_m(a, b, 12, p);
418 #else /* POLYMORPHIC */
419     return vrshrnbq_m_n_u32(a, b, 12, p);
420 #endif /* POLYMORPHIC */
421 }
422 
423 // CHECK-LABEL: @test_vrshrntq_m_n_s16(
424 // CHECK-NEXT:  entry:
425 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
426 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
427 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 0, i32 1, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
428 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
429 //
test_vrshrntq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)430 int8x16_t test_vrshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
431 {
432 #ifdef POLYMORPHIC
433     return vrshrntq_m(a, b, 4, p);
434 #else /* POLYMORPHIC */
435     return vrshrntq_m_n_s16(a, b, 4, p);
436 #endif /* POLYMORPHIC */
437 }
438 
439 // CHECK-LABEL: @test_vrshrntq_m_n_s32(
440 // CHECK-NEXT:  entry:
441 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
442 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
443 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 0, i32 1, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
444 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
445 //
test_vrshrntq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)446 int16x8_t test_vrshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
447 {
448 #ifdef POLYMORPHIC
449     return vrshrntq_m(a, b, 6, p);
450 #else /* POLYMORPHIC */
451     return vrshrntq_m_n_s32(a, b, 6, p);
452 #endif /* POLYMORPHIC */
453 }
454 
455 // CHECK-LABEL: @test_vrshrntq_m_n_u16(
456 // CHECK-NEXT:  entry:
457 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
458 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
459 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 6, i32 0, i32 1, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
460 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
461 //
test_vrshrntq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)462 uint8x16_t test_vrshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
463 {
464 #ifdef POLYMORPHIC
465     return vrshrntq_m(a, b, 6, p);
466 #else /* POLYMORPHIC */
467     return vrshrntq_m_n_u16(a, b, 6, p);
468 #endif /* POLYMORPHIC */
469 }
470 
471 // CHECK-LABEL: @test_vrshrntq_m_n_u32(
472 // CHECK-NEXT:  entry:
473 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
474 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
475 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 0, i32 1, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
476 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
477 //
test_vrshrntq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)478 uint16x8_t test_vrshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
479 {
480 #ifdef POLYMORPHIC
481     return vrshrntq_m(a, b, 10, p);
482 #else /* POLYMORPHIC */
483     return vrshrntq_m_n_u32(a, b, 10, p);
484 #endif /* POLYMORPHIC */
485 }
486 
487 // CHECK-LABEL: @test_vqshrnbq_n_s16(
488 // CHECK-NEXT:  entry:
489 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 0, i32 0, i32 0)
490 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
491 //
test_vqshrnbq_n_s16(int8x16_t a,int16x8_t b)492 int8x16_t test_vqshrnbq_n_s16(int8x16_t a, int16x8_t b)
493 {
494 #ifdef POLYMORPHIC
495     return vqshrnbq(a, b, 7);
496 #else /* POLYMORPHIC */
497     return vqshrnbq_n_s16(a, b, 7);
498 #endif /* POLYMORPHIC */
499 }
500 
501 // CHECK-LABEL: @test_vqshrnbq_n_s32(
502 // CHECK-NEXT:  entry:
503 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 0, i32 0, i32 0, i32 0)
504 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
505 //
test_vqshrnbq_n_s32(int16x8_t a,int32x4_t b)506 int16x8_t test_vqshrnbq_n_s32(int16x8_t a, int32x4_t b)
507 {
508 #ifdef POLYMORPHIC
509     return vqshrnbq(a, b, 15);
510 #else /* POLYMORPHIC */
511     return vqshrnbq_n_s32(a, b, 15);
512 #endif /* POLYMORPHIC */
513 }
514 
515 // CHECK-LABEL: @test_vqshrnbq_n_u16(
516 // CHECK-NEXT:  entry:
517 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 0)
518 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
519 //
test_vqshrnbq_n_u16(uint8x16_t a,uint16x8_t b)520 uint8x16_t test_vqshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
521 {
522 #ifdef POLYMORPHIC
523     return vqshrnbq(a, b, 3);
524 #else /* POLYMORPHIC */
525     return vqshrnbq_n_u16(a, b, 3);
526 #endif /* POLYMORPHIC */
527 }
528 
529 // CHECK-LABEL: @test_vqshrnbq_n_u32(
530 // CHECK-NEXT:  entry:
531 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 0)
532 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
533 //
test_vqshrnbq_n_u32(uint16x8_t a,uint32x4_t b)534 uint16x8_t test_vqshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
535 {
536 #ifdef POLYMORPHIC
537     return vqshrnbq(a, b, 3);
538 #else /* POLYMORPHIC */
539     return vqshrnbq_n_u32(a, b, 3);
540 #endif /* POLYMORPHIC */
541 }
542 
543 // CHECK-LABEL: @test_vqshrntq_n_s16(
544 // CHECK-NEXT:  entry:
545 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 0, i32 0, i32 0, i32 1)
546 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
547 //
test_vqshrntq_n_s16(int8x16_t a,int16x8_t b)548 int8x16_t test_vqshrntq_n_s16(int8x16_t a, int16x8_t b)
549 {
550 #ifdef POLYMORPHIC
551     return vqshrntq(a, b, 5);
552 #else /* POLYMORPHIC */
553     return vqshrntq_n_s16(a, b, 5);
554 #endif /* POLYMORPHIC */
555 }
556 
557 // CHECK-LABEL: @test_vqshrntq_n_s32(
558 // CHECK-NEXT:  entry:
559 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 1, i32 0, i32 0, i32 0, i32 1)
560 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
561 //
test_vqshrntq_n_s32(int16x8_t a,int32x4_t b)562 int16x8_t test_vqshrntq_n_s32(int16x8_t a, int32x4_t b)
563 {
564 #ifdef POLYMORPHIC
565     return vqshrntq(a, b, 6);
566 #else /* POLYMORPHIC */
567     return vqshrntq_n_s32(a, b, 6);
568 #endif /* POLYMORPHIC */
569 }
570 
571 // CHECK-LABEL: @test_vqshrntq_n_u16(
572 // CHECK-NEXT:  entry:
573 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 1)
574 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
575 //
test_vqshrntq_n_u16(uint8x16_t a,uint16x8_t b)576 uint8x16_t test_vqshrntq_n_u16(uint8x16_t a, uint16x8_t b)
577 {
578 #ifdef POLYMORPHIC
579     return vqshrntq(a, b, 1);
580 #else /* POLYMORPHIC */
581     return vqshrntq_n_u16(a, b, 1);
582 #endif /* POLYMORPHIC */
583 }
584 
585 // CHECK-LABEL: @test_vqshrntq_n_u32(
586 // CHECK-NEXT:  entry:
587 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 0, i32 1, i32 1, i32 1)
588 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
589 //
test_vqshrntq_n_u32(uint16x8_t a,uint32x4_t b)590 uint16x8_t test_vqshrntq_n_u32(uint16x8_t a, uint32x4_t b)
591 {
592 #ifdef POLYMORPHIC
593     return vqshrntq(a, b, 15);
594 #else /* POLYMORPHIC */
595     return vqshrntq_n_u32(a, b, 15);
596 #endif /* POLYMORPHIC */
597 }
598 
599 // CHECK-LABEL: @test_vqshrnbq_m_n_s16(
600 // CHECK-NEXT:  entry:
601 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
602 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
603 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
604 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
605 //
test_vqshrnbq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)606 int8x16_t test_vqshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
607 {
608 #ifdef POLYMORPHIC
609     return vqshrnbq_m(a, b, 7, p);
610 #else /* POLYMORPHIC */
611     return vqshrnbq_m_n_s16(a, b, 7, p);
612 #endif /* POLYMORPHIC */
613 }
614 
615 // CHECK-LABEL: @test_vqshrnbq_m_n_s32(
616 // CHECK-NEXT:  entry:
617 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
618 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
619 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
620 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
621 //
test_vqshrnbq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)622 int16x8_t test_vqshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
623 {
624 #ifdef POLYMORPHIC
625     return vqshrnbq_m(a, b, 1, p);
626 #else /* POLYMORPHIC */
627     return vqshrnbq_m_n_s32(a, b, 1, p);
628 #endif /* POLYMORPHIC */
629 }
630 
631 // CHECK-LABEL: @test_vqshrnbq_m_n_u16(
632 // CHECK-NEXT:  entry:
633 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
634 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
635 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
636 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
637 //
test_vqshrnbq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)638 uint8x16_t test_vqshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
639 {
640 #ifdef POLYMORPHIC
641     return vqshrnbq_m(a, b, 1, p);
642 #else /* POLYMORPHIC */
643     return vqshrnbq_m_n_u16(a, b, 1, p);
644 #endif /* POLYMORPHIC */
645 }
646 
647 // CHECK-LABEL: @test_vqshrnbq_m_n_u32(
648 // CHECK-NEXT:  entry:
649 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
650 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
651 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 8, i32 1, i32 0, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
652 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
653 //
test_vqshrnbq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)654 uint16x8_t test_vqshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
655 {
656 #ifdef POLYMORPHIC
657     return vqshrnbq_m(a, b, 8, p);
658 #else /* POLYMORPHIC */
659     return vqshrnbq_m_n_u32(a, b, 8, p);
660 #endif /* POLYMORPHIC */
661 }
662 
663 // CHECK-LABEL: @test_vqshrntq_m_n_s16(
664 // CHECK-NEXT:  entry:
665 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
666 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
667 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 0, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
668 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
669 //
test_vqshrntq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)670 int8x16_t test_vqshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
671 {
672 #ifdef POLYMORPHIC
673     return vqshrntq_m(a, b, 1, p);
674 #else /* POLYMORPHIC */
675     return vqshrntq_m_n_s16(a, b, 1, p);
676 #endif /* POLYMORPHIC */
677 }
678 
679 // CHECK-LABEL: @test_vqshrntq_m_n_s32(
680 // CHECK-NEXT:  entry:
681 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
682 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
683 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 0, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
684 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
685 //
test_vqshrntq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)686 int16x8_t test_vqshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
687 {
688 #ifdef POLYMORPHIC
689     return vqshrntq_m(a, b, 11, p);
690 #else /* POLYMORPHIC */
691     return vqshrntq_m_n_s32(a, b, 11, p);
692 #endif /* POLYMORPHIC */
693 }
694 
695 // CHECK-LABEL: @test_vqshrntq_m_n_u16(
696 // CHECK-NEXT:  entry:
697 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
698 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
699 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 0, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
700 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
701 //
test_vqshrntq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)702 uint8x16_t test_vqshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
703 {
704 #ifdef POLYMORPHIC
705     return vqshrntq_m(a, b, 3, p);
706 #else /* POLYMORPHIC */
707     return vqshrntq_m_n_u16(a, b, 3, p);
708 #endif /* POLYMORPHIC */
709 }
710 
711 // CHECK-LABEL: @test_vqshrntq_m_n_u32(
712 // CHECK-NEXT:  entry:
713 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
714 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
715 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 0, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
716 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
717 //
test_vqshrntq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)718 uint16x8_t test_vqshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
719 {
720 #ifdef POLYMORPHIC
721     return vqshrntq_m(a, b, 1, p);
722 #else /* POLYMORPHIC */
723     return vqshrntq_m_n_u32(a, b, 1, p);
724 #endif /* POLYMORPHIC */
725 }
726 
727 // CHECK-LABEL: @test_vqshrunbq_n_s16(
728 // CHECK-NEXT:  entry:
729 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 0, i32 1, i32 0, i32 0)
730 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
731 //
test_vqshrunbq_n_s16(uint8x16_t a,int16x8_t b)732 uint8x16_t test_vqshrunbq_n_s16(uint8x16_t a, int16x8_t b)
733 {
734 #ifdef POLYMORPHIC
735     return vqshrunbq(a, b, 5);
736 #else /* POLYMORPHIC */
737     return vqshrunbq_n_s16(a, b, 5);
738 #endif /* POLYMORPHIC */
739 }
740 
741 // CHECK-LABEL: @test_vqshrunbq_n_s32(
742 // CHECK-NEXT:  entry:
743 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 0, i32 1, i32 0, i32 0)
744 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
745 //
test_vqshrunbq_n_s32(uint16x8_t a,int32x4_t b)746 uint16x8_t test_vqshrunbq_n_s32(uint16x8_t a, int32x4_t b)
747 {
748 #ifdef POLYMORPHIC
749     return vqshrunbq(a, b, 13);
750 #else /* POLYMORPHIC */
751     return vqshrunbq_n_s32(a, b, 13);
752 #endif /* POLYMORPHIC */
753 }
754 
755 // CHECK-LABEL: @test_vqshruntq_n_s16(
756 // CHECK-NEXT:  entry:
757 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 1, i32 0, i32 1, i32 0, i32 1)
758 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
759 //
test_vqshruntq_n_s16(uint8x16_t a,int16x8_t b)760 uint8x16_t test_vqshruntq_n_s16(uint8x16_t a, int16x8_t b)
761 {
762 #ifdef POLYMORPHIC
763     return vqshruntq(a, b, 2);
764 #else /* POLYMORPHIC */
765     return vqshruntq_n_s16(a, b, 2);
766 #endif /* POLYMORPHIC */
767 }
768 
769 // CHECK-LABEL: @test_vqshruntq_n_s32(
770 // CHECK-NEXT:  entry:
771 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1)
772 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
773 //
test_vqshruntq_n_s32(uint16x8_t a,int32x4_t b)774 uint16x8_t test_vqshruntq_n_s32(uint16x8_t a, int32x4_t b)
775 {
776 #ifdef POLYMORPHIC
777     return vqshruntq(a, b, 7);
778 #else /* POLYMORPHIC */
779     return vqshruntq_n_s32(a, b, 7);
780 #endif /* POLYMORPHIC */
781 }
782 
783 // CHECK-LABEL: @test_vqshrunbq_m_n_s16(
784 // CHECK-NEXT:  entry:
785 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
786 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
787 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
788 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
789 //
test_vqshrunbq_m_n_s16(uint8x16_t a,int16x8_t b,mve_pred16_t p)790 uint8x16_t test_vqshrunbq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
791 {
792 #ifdef POLYMORPHIC
793     return vqshrunbq_m(a, b, 7, p);
794 #else /* POLYMORPHIC */
795     return vqshrunbq_m_n_s16(a, b, 7, p);
796 #endif /* POLYMORPHIC */
797 }
798 
799 // CHECK-LABEL: @test_vqshrunbq_m_n_s32(
800 // CHECK-NEXT:  entry:
801 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
802 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
803 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
804 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
805 //
test_vqshrunbq_m_n_s32(uint16x8_t a,int32x4_t b,mve_pred16_t p)806 uint16x8_t test_vqshrunbq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
807 {
808 #ifdef POLYMORPHIC
809     return vqshrunbq_m(a, b, 7, p);
810 #else /* POLYMORPHIC */
811     return vqshrunbq_m_n_s32(a, b, 7, p);
812 #endif /* POLYMORPHIC */
813 }
814 
815 // CHECK-LABEL: @test_vqshruntq_m_n_s16(
816 // CHECK-NEXT:  entry:
817 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
818 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
819 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
820 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
821 //
test_vqshruntq_m_n_s16(uint8x16_t a,int16x8_t b,mve_pred16_t p)822 uint8x16_t test_vqshruntq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
823 {
824 #ifdef POLYMORPHIC
825     return vqshruntq_m(a, b, 7, p);
826 #else /* POLYMORPHIC */
827     return vqshruntq_m_n_s16(a, b, 7, p);
828 #endif /* POLYMORPHIC */
829 }
830 
831 // CHECK-LABEL: @test_vqshruntq_m_n_s32(
832 // CHECK-NEXT:  entry:
833 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
834 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
835 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 7, i32 1, i32 0, i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
836 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
837 //
test_vqshruntq_m_n_s32(uint16x8_t a,int32x4_t b,mve_pred16_t p)838 uint16x8_t test_vqshruntq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
839 {
840 #ifdef POLYMORPHIC
841     return vqshruntq_m(a, b, 7, p);
842 #else /* POLYMORPHIC */
843     return vqshruntq_m_n_s32(a, b, 7, p);
844 #endif /* POLYMORPHIC */
845 }
846 
847 // CHECK-LABEL: @test_vqrshrnbq_n_s16(
848 // CHECK-NEXT:  entry:
849 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 1, i32 0, i32 0, i32 0)
850 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
851 //
test_vqrshrnbq_n_s16(int8x16_t a,int16x8_t b)852 int8x16_t test_vqrshrnbq_n_s16(int8x16_t a, int16x8_t b)
853 {
854 #ifdef POLYMORPHIC
855     return vqrshrnbq(a, b, 5);
856 #else /* POLYMORPHIC */
857     return vqrshrnbq_n_s16(a, b, 5);
858 #endif /* POLYMORPHIC */
859 }
860 
861 // CHECK-LABEL: @test_vqrshrnbq_n_s32(
862 // CHECK-NEXT:  entry:
863 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 1, i32 0, i32 0, i32 0)
864 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
865 //
test_vqrshrnbq_n_s32(int16x8_t a,int32x4_t b)866 int16x8_t test_vqrshrnbq_n_s32(int16x8_t a, int32x4_t b)
867 {
868 #ifdef POLYMORPHIC
869     return vqrshrnbq(a, b, 13);
870 #else /* POLYMORPHIC */
871     return vqrshrnbq_n_s32(a, b, 13);
872 #endif /* POLYMORPHIC */
873 }
874 
875 // CHECK-LABEL: @test_vqrshrnbq_n_u16(
876 // CHECK-NEXT:  entry:
877 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 1, i32 0)
878 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
879 //
test_vqrshrnbq_n_u16(uint8x16_t a,uint16x8_t b)880 uint8x16_t test_vqrshrnbq_n_u16(uint8x16_t a, uint16x8_t b)
881 {
882 #ifdef POLYMORPHIC
883     return vqrshrnbq(a, b, 7);
884 #else /* POLYMORPHIC */
885     return vqrshrnbq_n_u16(a, b, 7);
886 #endif /* POLYMORPHIC */
887 }
888 
889 // CHECK-LABEL: @test_vqrshrnbq_n_u32(
890 // CHECK-NEXT:  entry:
891 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 8, i32 1, i32 1, i32 1, i32 1, i32 0)
892 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
893 //
test_vqrshrnbq_n_u32(uint16x8_t a,uint32x4_t b)894 uint16x8_t test_vqrshrnbq_n_u32(uint16x8_t a, uint32x4_t b)
895 {
896 #ifdef POLYMORPHIC
897     return vqrshrnbq(a, b, 8);
898 #else /* POLYMORPHIC */
899     return vqrshrnbq_n_u32(a, b, 8);
900 #endif /* POLYMORPHIC */
901 }
902 
903 // CHECK-LABEL: @test_vqrshrntq_n_s16(
904 // CHECK-NEXT:  entry:
905 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 0, i32 0, i32 1)
906 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
907 //
test_vqrshrntq_n_s16(int8x16_t a,int16x8_t b)908 int8x16_t test_vqrshrntq_n_s16(int8x16_t a, int16x8_t b)
909 {
910 #ifdef POLYMORPHIC
911     return vqrshrntq(a, b, 7);
912 #else /* POLYMORPHIC */
913     return vqrshrntq_n_s16(a, b, 7);
914 #endif /* POLYMORPHIC */
915 }
916 
917 // CHECK-LABEL: @test_vqrshrntq_n_s32(
918 // CHECK-NEXT:  entry:
919 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 2, i32 1, i32 1, i32 0, i32 0, i32 1)
920 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
921 //
test_vqrshrntq_n_s32(int16x8_t a,int32x4_t b)922 int16x8_t test_vqrshrntq_n_s32(int16x8_t a, int32x4_t b)
923 {
924 #ifdef POLYMORPHIC
925     return vqrshrntq(a, b, 2);
926 #else /* POLYMORPHIC */
927     return vqrshrntq_n_s32(a, b, 2);
928 #endif /* POLYMORPHIC */
929 }
930 
931 // CHECK-LABEL: @test_vqrshrntq_n_u16(
932 // CHECK-NEXT:  entry:
933 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 1, i32 1)
934 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
935 //
test_vqrshrntq_n_u16(uint8x16_t a,uint16x8_t b)936 uint8x16_t test_vqrshrntq_n_u16(uint8x16_t a, uint16x8_t b)
937 {
938 #ifdef POLYMORPHIC
939     return vqrshrntq(a, b, 1);
940 #else /* POLYMORPHIC */
941     return vqrshrntq_n_u16(a, b, 1);
942 #endif /* POLYMORPHIC */
943 }
944 
945 // CHECK-LABEL: @test_vqrshrntq_n_u32(
946 // CHECK-NEXT:  entry:
947 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 1, i32 1, i32 1, i32 1)
948 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
949 //
test_vqrshrntq_n_u32(uint16x8_t a,uint32x4_t b)950 uint16x8_t test_vqrshrntq_n_u32(uint16x8_t a, uint32x4_t b)
951 {
952 #ifdef POLYMORPHIC
953     return vqrshrntq(a, b, 11);
954 #else /* POLYMORPHIC */
955     return vqrshrntq_n_u32(a, b, 11);
956 #endif /* POLYMORPHIC */
957 }
958 
959 // CHECK-LABEL: @test_vqrshrnbq_m_n_s16(
960 // CHECK-NEXT:  entry:
961 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
962 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
963 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2, i32 1, i32 1, i32 0, i32 0, i32 0, <8 x i1> [[TMP1]])
964 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
965 //
test_vqrshrnbq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)966 int8x16_t test_vqrshrnbq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
967 {
968 #ifdef POLYMORPHIC
969     return vqrshrnbq_m(a, b, 2, p);
970 #else /* POLYMORPHIC */
971     return vqrshrnbq_m_n_s16(a, b, 2, p);
972 #endif /* POLYMORPHIC */
973 }
974 
975 // CHECK-LABEL: @test_vqrshrnbq_m_n_s32(
976 // CHECK-NEXT:  entry:
977 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
978 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
979 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 12, i32 1, i32 1, i32 0, i32 0, i32 0, <4 x i1> [[TMP1]])
980 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
981 //
test_vqrshrnbq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)982 int16x8_t test_vqrshrnbq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
983 {
984 #ifdef POLYMORPHIC
985     return vqrshrnbq_m(a, b, 12, p);
986 #else /* POLYMORPHIC */
987     return vqrshrnbq_m_n_s32(a, b, 12, p);
988 #endif /* POLYMORPHIC */
989 }
990 
991 // CHECK-LABEL: @test_vqrshrnbq_m_n_u16(
992 // CHECK-NEXT:  entry:
993 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
994 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
995 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 5, i32 1, i32 1, i32 1, i32 1, i32 0, <8 x i1> [[TMP1]])
996 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
997 //
test_vqrshrnbq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)998 uint8x16_t test_vqrshrnbq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
999 {
1000 #ifdef POLYMORPHIC
1001     return vqrshrnbq_m(a, b, 5, p);
1002 #else /* POLYMORPHIC */
1003     return vqrshrnbq_m_n_u16(a, b, 5, p);
1004 #endif /* POLYMORPHIC */
1005 }
1006 
1007 // CHECK-LABEL: @test_vqrshrnbq_m_n_u32(
1008 // CHECK-NEXT:  entry:
1009 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1010 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1011 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 11, i32 1, i32 1, i32 1, i32 1, i32 0, <4 x i1> [[TMP1]])
1012 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1013 //
test_vqrshrnbq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)1014 uint16x8_t test_vqrshrnbq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
1015 {
1016 #ifdef POLYMORPHIC
1017     return vqrshrnbq_m(a, b, 11, p);
1018 #else /* POLYMORPHIC */
1019     return vqrshrnbq_m_n_u32(a, b, 11, p);
1020 #endif /* POLYMORPHIC */
1021 }
1022 
1023 // CHECK-LABEL: @test_vqrshrntq_m_n_s16(
1024 // CHECK-NEXT:  entry:
1025 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1026 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1027 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 1, i32 1, i32 0, i32 0, i32 1, <8 x i1> [[TMP1]])
1028 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1029 //
test_vqrshrntq_m_n_s16(int8x16_t a,int16x8_t b,mve_pred16_t p)1030 int8x16_t test_vqrshrntq_m_n_s16(int8x16_t a, int16x8_t b, mve_pred16_t p)
1031 {
1032 #ifdef POLYMORPHIC
1033     return vqrshrntq_m(a, b, 4, p);
1034 #else /* POLYMORPHIC */
1035     return vqrshrntq_m_n_s16(a, b, 4, p);
1036 #endif /* POLYMORPHIC */
1037 }
1038 
1039 // CHECK-LABEL: @test_vqrshrntq_m_n_s32(
1040 // CHECK-NEXT:  entry:
1041 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1042 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1043 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 6, i32 1, i32 1, i32 0, i32 0, i32 1, <4 x i1> [[TMP1]])
1044 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1045 //
test_vqrshrntq_m_n_s32(int16x8_t a,int32x4_t b,mve_pred16_t p)1046 int16x8_t test_vqrshrntq_m_n_s32(int16x8_t a, int32x4_t b, mve_pred16_t p)
1047 {
1048 #ifdef POLYMORPHIC
1049     return vqrshrntq_m(a, b, 6, p);
1050 #else /* POLYMORPHIC */
1051     return vqrshrntq_m_n_s32(a, b, 6, p);
1052 #endif /* POLYMORPHIC */
1053 }
1054 
1055 // CHECK-LABEL: @test_vqrshrntq_m_n_u16(
1056 // CHECK-NEXT:  entry:
1057 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1058 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1059 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 1, i32 1, <8 x i1> [[TMP1]])
1060 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1061 //
test_vqrshrntq_m_n_u16(uint8x16_t a,uint16x8_t b,mve_pred16_t p)1062 uint8x16_t test_vqrshrntq_m_n_u16(uint8x16_t a, uint16x8_t b, mve_pred16_t p)
1063 {
1064 #ifdef POLYMORPHIC
1065     return vqrshrntq_m(a, b, 7, p);
1066 #else /* POLYMORPHIC */
1067     return vqrshrntq_m_n_u16(a, b, 7, p);
1068 #endif /* POLYMORPHIC */
1069 }
1070 
1071 // CHECK-LABEL: @test_vqrshrntq_m_n_u32(
1072 // CHECK-NEXT:  entry:
1073 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1074 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1075 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 15, i32 1, i32 1, i32 1, i32 1, i32 1, <4 x i1> [[TMP1]])
1076 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1077 //
test_vqrshrntq_m_n_u32(uint16x8_t a,uint32x4_t b,mve_pred16_t p)1078 uint16x8_t test_vqrshrntq_m_n_u32(uint16x8_t a, uint32x4_t b, mve_pred16_t p)
1079 {
1080 #ifdef POLYMORPHIC
1081     return vqrshrntq_m(a, b, 15, p);
1082 #else /* POLYMORPHIC */
1083     return vqrshrntq_m_n_u32(a, b, 15, p);
1084 #endif /* POLYMORPHIC */
1085 }
1086 
1087 // CHECK-LABEL: @test_vqrshrunbq_n_s16(
1088 // CHECK-NEXT:  entry:
1089 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 7, i32 1, i32 1, i32 1, i32 0, i32 0)
1090 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1091 //
test_vqrshrunbq_n_s16(uint8x16_t a,int16x8_t b)1092 uint8x16_t test_vqrshrunbq_n_s16(uint8x16_t a, int16x8_t b)
1093 {
1094 #ifdef POLYMORPHIC
1095     return vqrshrunbq(a, b, 7);
1096 #else /* POLYMORPHIC */
1097     return vqrshrunbq_n_s16(a, b, 7);
1098 #endif /* POLYMORPHIC */
1099 }
1100 
1101 // CHECK-LABEL: @test_vqrshrunbq_n_s32(
1102 // CHECK-NEXT:  entry:
1103 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 0, i32 0)
1104 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1105 //
test_vqrshrunbq_n_s32(uint16x8_t a,int32x4_t b)1106 uint16x8_t test_vqrshrunbq_n_s32(uint16x8_t a, int32x4_t b)
1107 {
1108 #ifdef POLYMORPHIC
1109     return vqrshrunbq(a, b, 1);
1110 #else /* POLYMORPHIC */
1111     return vqrshrunbq_n_s32(a, b, 1);
1112 #endif /* POLYMORPHIC */
1113 }
1114 
1115 // CHECK-LABEL: @test_vqrshruntq_n_s16(
1116 // CHECK-NEXT:  entry:
1117 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.v16i8.v8i16(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, i32 1, i32 1, i32 1, i32 0, i32 1)
1118 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1119 //
test_vqrshruntq_n_s16(uint8x16_t a,int16x8_t b)1120 uint8x16_t test_vqrshruntq_n_s16(uint8x16_t a, int16x8_t b)
1121 {
1122 #ifdef POLYMORPHIC
1123     return vqrshruntq(a, b, 1);
1124 #else /* POLYMORPHIC */
1125     return vqrshruntq_n_s16(a, b, 1);
1126 #endif /* POLYMORPHIC */
1127 }
1128 
1129 // CHECK-LABEL: @test_vqrshruntq_n_s32(
1130 // CHECK-NEXT:  entry:
1131 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.v8i16.v4i32(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 3, i32 1, i32 1, i32 1, i32 0, i32 1)
1132 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1133 //
test_vqrshruntq_n_s32(uint16x8_t a,int32x4_t b)1134 uint16x8_t test_vqrshruntq_n_s32(uint16x8_t a, int32x4_t b)
1135 {
1136 #ifdef POLYMORPHIC
1137     return vqrshruntq(a, b, 3);
1138 #else /* POLYMORPHIC */
1139     return vqrshruntq_n_s32(a, b, 3);
1140 #endif /* POLYMORPHIC */
1141 }
1142 
1143 // CHECK-LABEL: @test_vqrshrunbq_m_n_s16(
1144 // CHECK-NEXT:  entry:
1145 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1146 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1147 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 4, i32 1, i32 1, i32 1, i32 0, i32 0, <8 x i1> [[TMP1]])
1148 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1149 //
test_vqrshrunbq_m_n_s16(uint8x16_t a,int16x8_t b,mve_pred16_t p)1150 uint8x16_t test_vqrshrunbq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
1151 {
1152 #ifdef POLYMORPHIC
1153     return vqrshrunbq_m(a, b, 4, p);
1154 #else /* POLYMORPHIC */
1155     return vqrshrunbq_m_n_s16(a, b, 4, p);
1156 #endif /* POLYMORPHIC */
1157 }
1158 
1159 // CHECK-LABEL: @test_vqrshrunbq_m_n_s32(
1160 // CHECK-NEXT:  entry:
1161 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1162 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1163 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 10, i32 1, i32 1, i32 1, i32 0, i32 0, <4 x i1> [[TMP1]])
1164 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1165 //
test_vqrshrunbq_m_n_s32(uint16x8_t a,int32x4_t b,mve_pred16_t p)1166 uint16x8_t test_vqrshrunbq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
1167 {
1168 #ifdef POLYMORPHIC
1169     return vqrshrunbq_m(a, b, 10, p);
1170 #else /* POLYMORPHIC */
1171     return vqrshrunbq_m_n_s32(a, b, 10, p);
1172 #endif /* POLYMORPHIC */
1173 }
1174 
1175 // CHECK-LABEL: @test_vqrshruntq_m_n_s16(
1176 // CHECK-NEXT:  entry:
1177 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1178 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1179 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vshrn.predicated.v16i8.v8i16.v8i1(<16 x i8> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, i32 1, i32 1, i32 1, i32 0, i32 1, <8 x i1> [[TMP1]])
1180 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1181 //
test_vqrshruntq_m_n_s16(uint8x16_t a,int16x8_t b,mve_pred16_t p)1182 uint8x16_t test_vqrshruntq_m_n_s16(uint8x16_t a, int16x8_t b, mve_pred16_t p)
1183 {
1184 #ifdef POLYMORPHIC
1185     return vqrshruntq_m(a, b, 3, p);
1186 #else /* POLYMORPHIC */
1187     return vqrshruntq_m_n_s16(a, b, 3, p);
1188 #endif /* POLYMORPHIC */
1189 }
1190 
1191 // CHECK-LABEL: @test_vqrshruntq_m_n_s32(
1192 // CHECK-NEXT:  entry:
1193 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1194 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1195 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vshrn.predicated.v8i16.v4i32.v4i1(<8 x i16> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, i32 1, i32 1, i32 1, i32 0, i32 1, <4 x i1> [[TMP1]])
1196 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1197 //
test_vqrshruntq_m_n_s32(uint16x8_t a,int32x4_t b,mve_pred16_t p)1198 uint16x8_t test_vqrshruntq_m_n_s32(uint16x8_t a, int32x4_t b, mve_pred16_t p)
1199 {
1200 #ifdef POLYMORPHIC
1201     return vqrshruntq_m(a, b, 13, p);
1202 #else /* POLYMORPHIC */
1203     return vqrshruntq_m_n_s32(a, b, 13, p);
1204 #endif /* POLYMORPHIC */
1205 }
1206 
1207 // CHECK-LABEL: @test_vsliq_n_s8(
1208 // CHECK-NEXT:  entry:
1209 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 2)
1210 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1211 //
test_vsliq_n_s8(int8x16_t a,int8x16_t b)1212 int8x16_t test_vsliq_n_s8(int8x16_t a, int8x16_t b)
1213 {
1214 #ifdef POLYMORPHIC
1215     return vsliq(a, b, 2);
1216 #else /* POLYMORPHIC */
1217     return vsliq_n_s8(a, b, 2);
1218 #endif /* POLYMORPHIC */
1219 }
1220 
1221 // CHECK-LABEL: @test_vsliq_n_s16(
1222 // CHECK-NEXT:  entry:
1223 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 10)
1224 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1225 //
test_vsliq_n_s16(int16x8_t a,int16x8_t b)1226 int16x8_t test_vsliq_n_s16(int16x8_t a, int16x8_t b)
1227 {
1228 #ifdef POLYMORPHIC
1229     return vsliq(a, b, 10);
1230 #else /* POLYMORPHIC */
1231     return vsliq_n_s16(a, b, 10);
1232 #endif /* POLYMORPHIC */
1233 }
1234 
1235 // CHECK-LABEL: @test_vsliq_n_s32(
1236 // CHECK-NEXT:  entry:
1237 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1)
1238 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
1239 //
test_vsliq_n_s32(int32x4_t a,int32x4_t b)1240 int32x4_t test_vsliq_n_s32(int32x4_t a, int32x4_t b)
1241 {
1242 #ifdef POLYMORPHIC
1243     return vsliq(a, b, 1);
1244 #else /* POLYMORPHIC */
1245     return vsliq_n_s32(a, b, 1);
1246 #endif /* POLYMORPHIC */
1247 }
1248 
1249 // CHECK-LABEL: @test_vsliq_n_u8(
1250 // CHECK-NEXT:  entry:
1251 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 1)
1252 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1253 //
test_vsliq_n_u8(uint8x16_t a,uint8x16_t b)1254 uint8x16_t test_vsliq_n_u8(uint8x16_t a, uint8x16_t b)
1255 {
1256 #ifdef POLYMORPHIC
1257     return vsliq(a, b, 1);
1258 #else /* POLYMORPHIC */
1259     return vsliq_n_u8(a, b, 1);
1260 #endif /* POLYMORPHIC */
1261 }
1262 
1263 // CHECK-LABEL: @test_vsliq_n_u16(
1264 // CHECK-NEXT:  entry:
1265 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1)
1266 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1267 //
test_vsliq_n_u16(uint16x8_t a,uint16x8_t b)1268 uint16x8_t test_vsliq_n_u16(uint16x8_t a, uint16x8_t b)
1269 {
1270 #ifdef POLYMORPHIC
1271     return vsliq(a, b, 1);
1272 #else /* POLYMORPHIC */
1273     return vsliq_n_u16(a, b, 1);
1274 #endif /* POLYMORPHIC */
1275 }
1276 
1277 // CHECK-LABEL: @test_vsliq_n_u32(
1278 // CHECK-NEXT:  entry:
1279 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 28)
1280 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
1281 //
test_vsliq_n_u32(uint32x4_t a,uint32x4_t b)1282 uint32x4_t test_vsliq_n_u32(uint32x4_t a, uint32x4_t b)
1283 {
1284 #ifdef POLYMORPHIC
1285     return vsliq(a, b, 28);
1286 #else /* POLYMORPHIC */
1287     return vsliq_n_u32(a, b, 28);
1288 #endif /* POLYMORPHIC */
1289 }
1290 
1291 // CHECK-LABEL: @test_vsliq_m_n_s8(
1292 // CHECK-NEXT:  entry:
1293 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1294 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
1295 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 4, <16 x i1> [[TMP1]])
1296 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1297 //
test_vsliq_m_n_s8(int8x16_t a,int8x16_t b,mve_pred16_t p)1298 int8x16_t test_vsliq_m_n_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
1299 {
1300 #ifdef POLYMORPHIC
1301     return vsliq_m(a, b, 4, p);
1302 #else /* POLYMORPHIC */
1303     return vsliq_m_n_s8(a, b, 4, p);
1304 #endif /* POLYMORPHIC */
1305 }
1306 
1307 // CHECK-LABEL: @test_vsliq_m_n_s16(
1308 // CHECK-NEXT:  entry:
1309 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1310 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1311 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]])
1312 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1313 //
test_vsliq_m_n_s16(int16x8_t a,int16x8_t b,mve_pred16_t p)1314 int16x8_t test_vsliq_m_n_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
1315 {
1316 #ifdef POLYMORPHIC
1317     return vsliq_m(a, b, 1, p);
1318 #else /* POLYMORPHIC */
1319     return vsliq_m_n_s16(a, b, 1, p);
1320 #endif /* POLYMORPHIC */
1321 }
1322 
1323 // CHECK-LABEL: @test_vsliq_m_n_s32(
1324 // CHECK-NEXT:  entry:
1325 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1326 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1327 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 1, <4 x i1> [[TMP1]])
1328 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
1329 //
test_vsliq_m_n_s32(int32x4_t a,int32x4_t b,mve_pred16_t p)1330 int32x4_t test_vsliq_m_n_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
1331 {
1332 #ifdef POLYMORPHIC
1333     return vsliq_m(a, b, 1, p);
1334 #else /* POLYMORPHIC */
1335     return vsliq_m_n_s32(a, b, 1, p);
1336 #endif /* POLYMORPHIC */
1337 }
1338 
1339 // CHECK-LABEL: @test_vsliq_m_n_u8(
1340 // CHECK-NEXT:  entry:
1341 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1342 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
1343 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsli.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 5, <16 x i1> [[TMP1]])
1344 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1345 //
test_vsliq_m_n_u8(uint8x16_t a,uint8x16_t b,mve_pred16_t p)1346 uint8x16_t test_vsliq_m_n_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
1347 {
1348 #ifdef POLYMORPHIC
1349     return vsliq_m(a, b, 5, p);
1350 #else /* POLYMORPHIC */
1351     return vsliq_m_n_u8(a, b, 5, p);
1352 #endif /* POLYMORPHIC */
1353 }
1354 
1355 // CHECK-LABEL: @test_vsliq_m_n_u16(
1356 // CHECK-NEXT:  entry:
1357 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1358 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1359 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsli.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3, <8 x i1> [[TMP1]])
1360 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1361 //
test_vsliq_m_n_u16(uint16x8_t a,uint16x8_t b,mve_pred16_t p)1362 uint16x8_t test_vsliq_m_n_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
1363 {
1364 #ifdef POLYMORPHIC
1365     return vsliq_m(a, b, 3, p);
1366 #else /* POLYMORPHIC */
1367     return vsliq_m_n_u16(a, b, 3, p);
1368 #endif /* POLYMORPHIC */
1369 }
1370 
1371 // CHECK-LABEL: @test_vsliq_m_n_u32(
1372 // CHECK-NEXT:  entry:
1373 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1374 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1375 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsli.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 9, <4 x i1> [[TMP1]])
1376 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
1377 //
test_vsliq_m_n_u32(uint32x4_t a,uint32x4_t b,mve_pred16_t p)1378 uint32x4_t test_vsliq_m_n_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
1379 {
1380 #ifdef POLYMORPHIC
1381     return vsliq_m(a, b, 9, p);
1382 #else /* POLYMORPHIC */
1383     return vsliq_m_n_u32(a, b, 9, p);
1384 #endif /* POLYMORPHIC */
1385 }
1386 
1387 // CHECK-LABEL: @test_vsriq_n_s8(
1388 // CHECK-NEXT:  entry:
1389 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 3)
1390 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1391 //
test_vsriq_n_s8(int8x16_t a,int8x16_t b)1392 int8x16_t test_vsriq_n_s8(int8x16_t a, int8x16_t b)
1393 {
1394 #ifdef POLYMORPHIC
1395     return vsriq(a, b, 3);
1396 #else /* POLYMORPHIC */
1397     return vsriq_n_s8(a, b, 3);
1398 #endif /* POLYMORPHIC */
1399 }
1400 
1401 // CHECK-LABEL: @test_vsriq_n_s16(
1402 // CHECK-NEXT:  entry:
1403 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 2)
1404 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1405 //
test_vsriq_n_s16(int16x8_t a,int16x8_t b)1406 int16x8_t test_vsriq_n_s16(int16x8_t a, int16x8_t b)
1407 {
1408 #ifdef POLYMORPHIC
1409     return vsriq(a, b, 2);
1410 #else /* POLYMORPHIC */
1411     return vsriq_n_s16(a, b, 2);
1412 #endif /* POLYMORPHIC */
1413 }
1414 
1415 // CHECK-LABEL: @test_vsriq_n_s32(
1416 // CHECK-NEXT:  entry:
1417 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 28)
1418 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
1419 //
test_vsriq_n_s32(int32x4_t a,int32x4_t b)1420 int32x4_t test_vsriq_n_s32(int32x4_t a, int32x4_t b)
1421 {
1422 #ifdef POLYMORPHIC
1423     return vsriq(a, b, 28);
1424 #else /* POLYMORPHIC */
1425     return vsriq_n_s32(a, b, 28);
1426 #endif /* POLYMORPHIC */
1427 }
1428 
1429 // CHECK-LABEL: @test_vsriq_n_u8(
1430 // CHECK-NEXT:  entry:
1431 // CHECK-NEXT:    [[TMP0:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.v16i8(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 3)
1432 // CHECK-NEXT:    ret <16 x i8> [[TMP0]]
1433 //
test_vsriq_n_u8(uint8x16_t a,uint8x16_t b)1434 uint8x16_t test_vsriq_n_u8(uint8x16_t a, uint8x16_t b)
1435 {
1436 #ifdef POLYMORPHIC
1437     return vsriq(a, b, 3);
1438 #else /* POLYMORPHIC */
1439     return vsriq_n_u8(a, b, 3);
1440 #endif /* POLYMORPHIC */
1441 }
1442 
1443 // CHECK-LABEL: @test_vsriq_n_u16(
1444 // CHECK-NEXT:  entry:
1445 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.v8i16(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 3)
1446 // CHECK-NEXT:    ret <8 x i16> [[TMP0]]
1447 //
test_vsriq_n_u16(uint16x8_t a,uint16x8_t b)1448 uint16x8_t test_vsriq_n_u16(uint16x8_t a, uint16x8_t b)
1449 {
1450 #ifdef POLYMORPHIC
1451     return vsriq(a, b, 3);
1452 #else /* POLYMORPHIC */
1453     return vsriq_n_u16(a, b, 3);
1454 #endif /* POLYMORPHIC */
1455 }
1456 
1457 // CHECK-LABEL: @test_vsriq_n_u32(
1458 // CHECK-NEXT:  entry:
1459 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.v4i32(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 26)
1460 // CHECK-NEXT:    ret <4 x i32> [[TMP0]]
1461 //
test_vsriq_n_u32(uint32x4_t a,uint32x4_t b)1462 uint32x4_t test_vsriq_n_u32(uint32x4_t a, uint32x4_t b)
1463 {
1464 #ifdef POLYMORPHIC
1465     return vsriq(a, b, 26);
1466 #else /* POLYMORPHIC */
1467     return vsriq_n_u32(a, b, 26);
1468 #endif /* POLYMORPHIC */
1469 }
1470 
1471 // CHECK-LABEL: @test_vsriq_m_n_s8(
1472 // CHECK-NEXT:  entry:
1473 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1474 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
1475 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 4, <16 x i1> [[TMP1]])
1476 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1477 //
test_vsriq_m_n_s8(int8x16_t a,int8x16_t b,mve_pred16_t p)1478 int8x16_t test_vsriq_m_n_s8(int8x16_t a, int8x16_t b, mve_pred16_t p)
1479 {
1480 #ifdef POLYMORPHIC
1481     return vsriq_m(a, b, 4, p);
1482 #else /* POLYMORPHIC */
1483     return vsriq_m_n_s8(a, b, 4, p);
1484 #endif /* POLYMORPHIC */
1485 }
1486 
1487 // CHECK-LABEL: @test_vsriq_m_n_s16(
1488 // CHECK-NEXT:  entry:
1489 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1490 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1491 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 1, <8 x i1> [[TMP1]])
1492 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1493 //
test_vsriq_m_n_s16(int16x8_t a,int16x8_t b,mve_pred16_t p)1494 int16x8_t test_vsriq_m_n_s16(int16x8_t a, int16x8_t b, mve_pred16_t p)
1495 {
1496 #ifdef POLYMORPHIC
1497     return vsriq_m(a, b, 1, p);
1498 #else /* POLYMORPHIC */
1499     return vsriq_m_n_s16(a, b, 1, p);
1500 #endif /* POLYMORPHIC */
1501 }
1502 
1503 // CHECK-LABEL: @test_vsriq_m_n_s32(
1504 // CHECK-NEXT:  entry:
1505 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1506 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1507 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 27, <4 x i1> [[TMP1]])
1508 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
1509 //
test_vsriq_m_n_s32(int32x4_t a,int32x4_t b,mve_pred16_t p)1510 int32x4_t test_vsriq_m_n_s32(int32x4_t a, int32x4_t b, mve_pred16_t p)
1511 {
1512 #ifdef POLYMORPHIC
1513     return vsriq_m(a, b, 27, p);
1514 #else /* POLYMORPHIC */
1515     return vsriq_m_n_s32(a, b, 27, p);
1516 #endif /* POLYMORPHIC */
1517 }
1518 
1519 // CHECK-LABEL: @test_vsriq_m_n_u8(
1520 // CHECK-NEXT:  entry:
1521 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1522 // CHECK-NEXT:    [[TMP1:%.*]] = call <16 x i1> @llvm.arm.mve.pred.i2v.v16i1(i32 [[TMP0]])
1523 // CHECK-NEXT:    [[TMP2:%.*]] = call <16 x i8> @llvm.arm.mve.vsri.predicated.v16i8.v16i1(<16 x i8> [[A:%.*]], <16 x i8> [[B:%.*]], i32 7, <16 x i1> [[TMP1]])
1524 // CHECK-NEXT:    ret <16 x i8> [[TMP2]]
1525 //
test_vsriq_m_n_u8(uint8x16_t a,uint8x16_t b,mve_pred16_t p)1526 uint8x16_t test_vsriq_m_n_u8(uint8x16_t a, uint8x16_t b, mve_pred16_t p)
1527 {
1528 #ifdef POLYMORPHIC
1529     return vsriq_m(a, b, 7, p);
1530 #else /* POLYMORPHIC */
1531     return vsriq_m_n_u8(a, b, 7, p);
1532 #endif /* POLYMORPHIC */
1533 }
1534 
1535 // CHECK-LABEL: @test_vsriq_m_n_u16(
1536 // CHECK-NEXT:  entry:
1537 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1538 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
1539 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x i16> @llvm.arm.mve.vsri.predicated.v8i16.v8i1(<8 x i16> [[A:%.*]], <8 x i16> [[B:%.*]], i32 9, <8 x i1> [[TMP1]])
1540 // CHECK-NEXT:    ret <8 x i16> [[TMP2]]
1541 //
test_vsriq_m_n_u16(uint16x8_t a,uint16x8_t b,mve_pred16_t p)1542 uint16x8_t test_vsriq_m_n_u16(uint16x8_t a, uint16x8_t b, mve_pred16_t p)
1543 {
1544 #ifdef POLYMORPHIC
1545     return vsriq_m(a, b, 9, p);
1546 #else /* POLYMORPHIC */
1547     return vsriq_m_n_u16(a, b, 9, p);
1548 #endif /* POLYMORPHIC */
1549 }
1550 
1551 // CHECK-LABEL: @test_vsriq_m_n_u32(
1552 // CHECK-NEXT:  entry:
1553 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
1554 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
1555 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x i32> @llvm.arm.mve.vsri.predicated.v4i32.v4i1(<4 x i32> [[A:%.*]], <4 x i32> [[B:%.*]], i32 13, <4 x i1> [[TMP1]])
1556 // CHECK-NEXT:    ret <4 x i32> [[TMP2]]
1557 //
test_vsriq_m_n_u32(uint32x4_t a,uint32x4_t b,mve_pred16_t p)1558 uint32x4_t test_vsriq_m_n_u32(uint32x4_t a, uint32x4_t b, mve_pred16_t p)
1559 {
1560 #ifdef POLYMORPHIC
1561     return vsriq_m(a, b, 13, p);
1562 #else /* POLYMORPHIC */
1563     return vsriq_m_n_u32(a, b, 13, p);
1564 #endif /* POLYMORPHIC */
1565 }
1566