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_vrndaq_f16(
8 // CHECK-NEXT:  entry:
9 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.round.v8f16(<8 x half> [[A:%.*]])
10 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
11 //
test_vrndaq_f16(float16x8_t a)12 float16x8_t test_vrndaq_f16(float16x8_t a)
13 {
14 #ifdef POLYMORPHIC
15     return vrndaq(a);
16 #else /* POLYMORPHIC */
17     return vrndaq_f16(a);
18 #endif /* POLYMORPHIC */
19 }
20 
21 // CHECK-LABEL: @test_vrndaq_f32(
22 // CHECK-NEXT:  entry:
23 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.round.v4f32(<4 x float> [[A:%.*]])
24 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
25 //
test_vrndaq_f32(float32x4_t a)26 float32x4_t test_vrndaq_f32(float32x4_t a)
27 {
28 #ifdef POLYMORPHIC
29     return vrndaq(a);
30 #else /* POLYMORPHIC */
31     return vrndaq_f32(a);
32 #endif /* POLYMORPHIC */
33 }
34 
35 // CHECK-LABEL: @test_vrndmq_f16(
36 // CHECK-NEXT:  entry:
37 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.floor.v8f16(<8 x half> [[A:%.*]])
38 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
39 //
test_vrndmq_f16(float16x8_t a)40 float16x8_t test_vrndmq_f16(float16x8_t a)
41 {
42 #ifdef POLYMORPHIC
43     return vrndmq(a);
44 #else /* POLYMORPHIC */
45     return vrndmq_f16(a);
46 #endif /* POLYMORPHIC */
47 }
48 
49 // CHECK-LABEL: @test_vrndmq_f32(
50 // CHECK-NEXT:  entry:
51 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.floor.v4f32(<4 x float> [[A:%.*]])
52 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
53 //
test_vrndmq_f32(float32x4_t a)54 float32x4_t test_vrndmq_f32(float32x4_t a)
55 {
56 #ifdef POLYMORPHIC
57     return vrndmq(a);
58 #else /* POLYMORPHIC */
59     return vrndmq_f32(a);
60 #endif /* POLYMORPHIC */
61 }
62 
63 // CHECK-LABEL: @test_vrndpq_f16(
64 // CHECK-NEXT:  entry:
65 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.ceil.v8f16(<8 x half> [[A:%.*]])
66 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
67 //
test_vrndpq_f16(float16x8_t a)68 float16x8_t test_vrndpq_f16(float16x8_t a)
69 {
70 #ifdef POLYMORPHIC
71     return vrndpq(a);
72 #else /* POLYMORPHIC */
73     return vrndpq_f16(a);
74 #endif /* POLYMORPHIC */
75 }
76 
77 // CHECK-LABEL: @test_vrndpq_f32(
78 // CHECK-NEXT:  entry:
79 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.ceil.v4f32(<4 x float> [[A:%.*]])
80 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
81 //
test_vrndpq_f32(float32x4_t a)82 float32x4_t test_vrndpq_f32(float32x4_t a)
83 {
84 #ifdef POLYMORPHIC
85     return vrndpq(a);
86 #else /* POLYMORPHIC */
87     return vrndpq_f32(a);
88 #endif /* POLYMORPHIC */
89 }
90 
91 // CHECK-LABEL: @test_vrndq_f16(
92 // CHECK-NEXT:  entry:
93 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.trunc.v8f16(<8 x half> [[A:%.*]])
94 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
95 //
test_vrndq_f16(float16x8_t a)96 float16x8_t test_vrndq_f16(float16x8_t a)
97 {
98 #ifdef POLYMORPHIC
99     return vrndq(a);
100 #else /* POLYMORPHIC */
101     return vrndq_f16(a);
102 #endif /* POLYMORPHIC */
103 }
104 
105 // CHECK-LABEL: @test_vrndq_f32(
106 // CHECK-NEXT:  entry:
107 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.trunc.v4f32(<4 x float> [[A:%.*]])
108 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
109 //
test_vrndq_f32(float32x4_t a)110 float32x4_t test_vrndq_f32(float32x4_t a)
111 {
112 #ifdef POLYMORPHIC
113     return vrndq(a);
114 #else /* POLYMORPHIC */
115     return vrndq_f32(a);
116 #endif /* POLYMORPHIC */
117 }
118 
119 // CHECK-LABEL: @test_vrndxq_f16(
120 // CHECK-NEXT:  entry:
121 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.rint.v8f16(<8 x half> [[A:%.*]])
122 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
123 //
test_vrndxq_f16(float16x8_t a)124 float16x8_t test_vrndxq_f16(float16x8_t a)
125 {
126 #ifdef POLYMORPHIC
127     return vrndxq(a);
128 #else /* POLYMORPHIC */
129     return vrndxq_f16(a);
130 #endif /* POLYMORPHIC */
131 }
132 
133 // CHECK-LABEL: @test_vrndxq_f32(
134 // CHECK-NEXT:  entry:
135 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.rint.v4f32(<4 x float> [[A:%.*]])
136 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
137 //
test_vrndxq_f32(float32x4_t a)138 float32x4_t test_vrndxq_f32(float32x4_t a)
139 {
140 #ifdef POLYMORPHIC
141     return vrndxq(a);
142 #else /* POLYMORPHIC */
143     return vrndxq_f32(a);
144 #endif /* POLYMORPHIC */
145 }
146 
147 // CHECK-LABEL: @test_vrndnq_f16(
148 // CHECK-NEXT:  entry:
149 // CHECK-NEXT:    [[TMP0:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.v8f16(<8 x half> [[A:%.*]])
150 // CHECK-NEXT:    ret <8 x half> [[TMP0]]
151 //
test_vrndnq_f16(float16x8_t a)152 float16x8_t test_vrndnq_f16(float16x8_t a)
153 {
154 #ifdef POLYMORPHIC
155     return vrndnq(a);
156 #else /* POLYMORPHIC */
157     return vrndnq_f16(a);
158 #endif /* POLYMORPHIC */
159 }
160 
161 // CHECK-LABEL: @test_vrndnq_f32(
162 // CHECK-NEXT:  entry:
163 // CHECK-NEXT:    [[TMP0:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.v4f32(<4 x float> [[A:%.*]])
164 // CHECK-NEXT:    ret <4 x float> [[TMP0]]
165 //
test_vrndnq_f32(float32x4_t a)166 float32x4_t test_vrndnq_f32(float32x4_t a)
167 {
168 #ifdef POLYMORPHIC
169     return vrndnq(a);
170 #else /* POLYMORPHIC */
171     return vrndnq_f32(a);
172 #endif /* POLYMORPHIC */
173 }
174 
175 // CHECK-LABEL: @test_vrndaq_m_f16(
176 // CHECK-NEXT:  entry:
177 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
178 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
179 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
180 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
181 //
test_vrndaq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)182 float16x8_t test_vrndaq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
183 {
184 #ifdef POLYMORPHIC
185     return vrndaq_m(inactive, a, p);
186 #else /* POLYMORPHIC */
187     return vrndaq_m_f16(inactive, a, p);
188 #endif /* POLYMORPHIC */
189 }
190 
191 // CHECK-LABEL: @test_vrndaq_m_f32(
192 // CHECK-NEXT:  entry:
193 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
194 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
195 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
196 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
197 //
test_vrndaq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)198 float32x4_t test_vrndaq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
199 {
200 #ifdef POLYMORPHIC
201     return vrndaq_m(inactive, a, p);
202 #else /* POLYMORPHIC */
203     return vrndaq_m_f32(inactive, a, p);
204 #endif /* POLYMORPHIC */
205 }
206 
207 // CHECK-LABEL: @test_vrndmq_m_f16(
208 // CHECK-NEXT:  entry:
209 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
210 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
211 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
212 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
213 //
test_vrndmq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)214 float16x8_t test_vrndmq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
215 {
216 #ifdef POLYMORPHIC
217     return vrndmq_m(inactive, a, p);
218 #else /* POLYMORPHIC */
219     return vrndmq_m_f16(inactive, a, p);
220 #endif /* POLYMORPHIC */
221 }
222 
223 // CHECK-LABEL: @test_vrndmq_m_f32(
224 // CHECK-NEXT:  entry:
225 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
226 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
227 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
228 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
229 //
test_vrndmq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)230 float32x4_t test_vrndmq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
231 {
232 #ifdef POLYMORPHIC
233     return vrndmq_m(inactive, a, p);
234 #else /* POLYMORPHIC */
235     return vrndmq_m_f32(inactive, a, p);
236 #endif /* POLYMORPHIC */
237 }
238 
239 // CHECK-LABEL: @test_vrndnq_m_f16(
240 // CHECK-NEXT:  entry:
241 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
242 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
243 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
244 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
245 //
test_vrndnq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)246 float16x8_t test_vrndnq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
247 {
248 #ifdef POLYMORPHIC
249     return vrndnq_m(inactive, a, p);
250 #else /* POLYMORPHIC */
251     return vrndnq_m_f16(inactive, a, p);
252 #endif /* POLYMORPHIC */
253 }
254 
255 // CHECK-LABEL: @test_vrndnq_m_f32(
256 // CHECK-NEXT:  entry:
257 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
258 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
259 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
260 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
261 //
test_vrndnq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)262 float32x4_t test_vrndnq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
263 {
264 #ifdef POLYMORPHIC
265     return vrndnq_m(inactive, a, p);
266 #else /* POLYMORPHIC */
267     return vrndnq_m_f32(inactive, a, p);
268 #endif /* POLYMORPHIC */
269 }
270 
271 // CHECK-LABEL: @test_vrndpq_m_f16(
272 // CHECK-NEXT:  entry:
273 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
274 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
275 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
276 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
277 //
test_vrndpq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)278 float16x8_t test_vrndpq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
279 {
280 #ifdef POLYMORPHIC
281     return vrndpq_m(inactive, a, p);
282 #else /* POLYMORPHIC */
283     return vrndpq_m_f16(inactive, a, p);
284 #endif /* POLYMORPHIC */
285 }
286 
287 // CHECK-LABEL: @test_vrndpq_m_f32(
288 // CHECK-NEXT:  entry:
289 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
290 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
291 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
292 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
293 //
test_vrndpq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)294 float32x4_t test_vrndpq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
295 {
296 #ifdef POLYMORPHIC
297     return vrndpq_m(inactive, a, p);
298 #else /* POLYMORPHIC */
299     return vrndpq_m_f32(inactive, a, p);
300 #endif /* POLYMORPHIC */
301 }
302 
303 // CHECK-LABEL: @test_vrndq_m_f16(
304 // CHECK-NEXT:  entry:
305 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
306 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
307 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
308 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
309 //
test_vrndq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)310 float16x8_t test_vrndq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
311 {
312 #ifdef POLYMORPHIC
313     return vrndq_m(inactive, a, p);
314 #else /* POLYMORPHIC */
315     return vrndq_m_f16(inactive, a, p);
316 #endif /* POLYMORPHIC */
317 }
318 
319 // CHECK-LABEL: @test_vrndq_m_f32(
320 // CHECK-NEXT:  entry:
321 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
322 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
323 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
324 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
325 //
test_vrndq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)326 float32x4_t test_vrndq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
327 {
328 #ifdef POLYMORPHIC
329     return vrndq_m(inactive, a, p);
330 #else /* POLYMORPHIC */
331     return vrndq_m_f32(inactive, a, p);
332 #endif /* POLYMORPHIC */
333 }
334 
335 // CHECK-LABEL: @test_vrndxq_m_f16(
336 // CHECK-NEXT:  entry:
337 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
338 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
339 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> [[INACTIVE:%.*]])
340 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
341 //
test_vrndxq_m_f16(float16x8_t inactive,float16x8_t a,mve_pred16_t p)342 float16x8_t test_vrndxq_m_f16(float16x8_t inactive, float16x8_t a, mve_pred16_t p)
343 {
344 #ifdef POLYMORPHIC
345     return vrndxq_m(inactive, a, p);
346 #else /* POLYMORPHIC */
347     return vrndxq_m_f16(inactive, a, p);
348 #endif /* POLYMORPHIC */
349 }
350 
351 // CHECK-LABEL: @test_vrndxq_m_f32(
352 // CHECK-NEXT:  entry:
353 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
354 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
355 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> [[INACTIVE:%.*]])
356 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
357 //
test_vrndxq_m_f32(float32x4_t inactive,float32x4_t a,mve_pred16_t p)358 float32x4_t test_vrndxq_m_f32(float32x4_t inactive, float32x4_t a, mve_pred16_t p)
359 {
360 #ifdef POLYMORPHIC
361     return vrndxq_m(inactive, a, p);
362 #else /* POLYMORPHIC */
363     return vrndxq_m_f32(inactive, a, p);
364 #endif /* POLYMORPHIC */
365 }
366 
367 // CHECK-LABEL: @test_vrndaq_x_f16(
368 // CHECK-NEXT:  entry:
369 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
370 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
371 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrinta.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
372 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
373 //
test_vrndaq_x_f16(float16x8_t a,mve_pred16_t p)374 float16x8_t test_vrndaq_x_f16(float16x8_t a, mve_pred16_t p)
375 {
376 #ifdef POLYMORPHIC
377     return vrndaq_x(a, p);
378 #else /* POLYMORPHIC */
379     return vrndaq_x_f16(a, p);
380 #endif /* POLYMORPHIC */
381 }
382 
383 // CHECK-LABEL: @test_vrndaq_x_f32(
384 // CHECK-NEXT:  entry:
385 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
386 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
387 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrinta.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
388 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
389 //
test_vrndaq_x_f32(float32x4_t a,mve_pred16_t p)390 float32x4_t test_vrndaq_x_f32(float32x4_t a, mve_pred16_t p)
391 {
392 #ifdef POLYMORPHIC
393     return vrndaq_x(a, p);
394 #else /* POLYMORPHIC */
395     return vrndaq_x_f32(a, p);
396 #endif /* POLYMORPHIC */
397 }
398 
399 // CHECK-LABEL: @test_vrndmq_x_f16(
400 // CHECK-NEXT:  entry:
401 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
402 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
403 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintm.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
404 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
405 //
test_vrndmq_x_f16(float16x8_t a,mve_pred16_t p)406 float16x8_t test_vrndmq_x_f16(float16x8_t a, mve_pred16_t p)
407 {
408 #ifdef POLYMORPHIC
409     return vrndmq_x(a, p);
410 #else /* POLYMORPHIC */
411     return vrndmq_x_f16(a, p);
412 #endif /* POLYMORPHIC */
413 }
414 
415 // CHECK-LABEL: @test_vrndmq_x_f32(
416 // CHECK-NEXT:  entry:
417 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
418 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
419 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintm.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
420 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
421 //
test_vrndmq_x_f32(float32x4_t a,mve_pred16_t p)422 float32x4_t test_vrndmq_x_f32(float32x4_t a, mve_pred16_t p)
423 {
424 #ifdef POLYMORPHIC
425     return vrndmq_x(a, p);
426 #else /* POLYMORPHIC */
427     return vrndmq_x_f32(a, p);
428 #endif /* POLYMORPHIC */
429 }
430 
431 // CHECK-LABEL: @test_vrndnq_x_f16(
432 // CHECK-NEXT:  entry:
433 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
434 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
435 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintn.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
436 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
437 //
test_vrndnq_x_f16(float16x8_t a,mve_pred16_t p)438 float16x8_t test_vrndnq_x_f16(float16x8_t a, mve_pred16_t p)
439 {
440 #ifdef POLYMORPHIC
441     return vrndnq_x(a, p);
442 #else /* POLYMORPHIC */
443     return vrndnq_x_f16(a, p);
444 #endif /* POLYMORPHIC */
445 }
446 
447 // CHECK-LABEL: @test_vrndnq_x_f32(
448 // CHECK-NEXT:  entry:
449 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
450 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
451 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintn.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
452 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
453 //
test_vrndnq_x_f32(float32x4_t a,mve_pred16_t p)454 float32x4_t test_vrndnq_x_f32(float32x4_t a, mve_pred16_t p)
455 {
456 #ifdef POLYMORPHIC
457     return vrndnq_x(a, p);
458 #else /* POLYMORPHIC */
459     return vrndnq_x_f32(a, p);
460 #endif /* POLYMORPHIC */
461 }
462 
463 // CHECK-LABEL: @test_vrndpq_x_f16(
464 // CHECK-NEXT:  entry:
465 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
466 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
467 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintp.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
468 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
469 //
test_vrndpq_x_f16(float16x8_t a,mve_pred16_t p)470 float16x8_t test_vrndpq_x_f16(float16x8_t a, mve_pred16_t p)
471 {
472 #ifdef POLYMORPHIC
473     return vrndpq_x(a, p);
474 #else /* POLYMORPHIC */
475     return vrndpq_x_f16(a, p);
476 #endif /* POLYMORPHIC */
477 }
478 
479 // CHECK-LABEL: @test_vrndpq_x_f32(
480 // CHECK-NEXT:  entry:
481 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
482 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
483 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintp.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
484 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
485 //
test_vrndpq_x_f32(float32x4_t a,mve_pred16_t p)486 float32x4_t test_vrndpq_x_f32(float32x4_t a, mve_pred16_t p)
487 {
488 #ifdef POLYMORPHIC
489     return vrndpq_x(a, p);
490 #else /* POLYMORPHIC */
491     return vrndpq_x_f32(a, p);
492 #endif /* POLYMORPHIC */
493 }
494 
495 // CHECK-LABEL: @test_vrndq_x_f16(
496 // CHECK-NEXT:  entry:
497 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
498 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
499 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintz.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
500 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
501 //
test_vrndq_x_f16(float16x8_t a,mve_pred16_t p)502 float16x8_t test_vrndq_x_f16(float16x8_t a, mve_pred16_t p)
503 {
504 #ifdef POLYMORPHIC
505     return vrndq_x(a, p);
506 #else /* POLYMORPHIC */
507     return vrndq_x_f16(a, p);
508 #endif /* POLYMORPHIC */
509 }
510 
511 // CHECK-LABEL: @test_vrndq_x_f32(
512 // CHECK-NEXT:  entry:
513 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
514 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
515 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintz.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
516 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
517 //
test_vrndq_x_f32(float32x4_t a,mve_pred16_t p)518 float32x4_t test_vrndq_x_f32(float32x4_t a, mve_pred16_t p)
519 {
520 #ifdef POLYMORPHIC
521     return vrndq_x(a, p);
522 #else /* POLYMORPHIC */
523     return vrndq_x_f32(a, p);
524 #endif /* POLYMORPHIC */
525 }
526 
527 // CHECK-LABEL: @test_vrndxq_x_f16(
528 // CHECK-NEXT:  entry:
529 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
530 // CHECK-NEXT:    [[TMP1:%.*]] = call <8 x i1> @llvm.arm.mve.pred.i2v.v8i1(i32 [[TMP0]])
531 // CHECK-NEXT:    [[TMP2:%.*]] = call <8 x half> @llvm.arm.mve.vrintx.predicated.v8f16.v8i1(<8 x half> [[A:%.*]], <8 x i1> [[TMP1]], <8 x half> undef)
532 // CHECK-NEXT:    ret <8 x half> [[TMP2]]
533 //
test_vrndxq_x_f16(float16x8_t a,mve_pred16_t p)534 float16x8_t test_vrndxq_x_f16(float16x8_t a, mve_pred16_t p)
535 {
536 #ifdef POLYMORPHIC
537     return vrndxq_x(a, p);
538 #else /* POLYMORPHIC */
539     return vrndxq_x_f16(a, p);
540 #endif /* POLYMORPHIC */
541 }
542 
543 // CHECK-LABEL: @test_vrndxq_x_f32(
544 // CHECK-NEXT:  entry:
545 // CHECK-NEXT:    [[TMP0:%.*]] = zext i16 [[P:%.*]] to i32
546 // CHECK-NEXT:    [[TMP1:%.*]] = call <4 x i1> @llvm.arm.mve.pred.i2v.v4i1(i32 [[TMP0]])
547 // CHECK-NEXT:    [[TMP2:%.*]] = call <4 x float> @llvm.arm.mve.vrintx.predicated.v4f32.v4i1(<4 x float> [[A:%.*]], <4 x i1> [[TMP1]], <4 x float> undef)
548 // CHECK-NEXT:    ret <4 x float> [[TMP2]]
549 //
test_vrndxq_x_f32(float32x4_t a,mve_pred16_t p)550 float32x4_t test_vrndxq_x_f32(float32x4_t a, mve_pred16_t p)
551 {
552 #ifdef POLYMORPHIC
553     return vrndxq_x(a, p);
554 #else /* POLYMORPHIC */
555     return vrndxq_x_f32(a, p);
556 #endif /* POLYMORPHIC */
557 }
558 
559