1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --extra_scrub
2 ; RUN: llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s | FileCheck %s
6 define <vscale x 8 x half> @frintp_nxv8f16(<vscale x 8 x half> %a) {
7 ; CHECK-LABEL: frintp_nxv8f16:
9 ; CHECK-NEXT: ptrue p0.h
10 ; CHECK-NEXT: frintp z0.h, p0/m, z0.h
12 %res = call <vscale x 8 x half> @llvm.ceil.nxv8f16(<vscale x 8 x half> %a)
13 ret <vscale x 8 x half> %res
16 define <vscale x 4 x half> @frintp_nxv4f16(<vscale x 4 x half> %a) {
17 ; CHECK-LABEL: frintp_nxv4f16:
19 ; CHECK-NEXT: ptrue p0.s
20 ; CHECK-NEXT: frintp z0.h, p0/m, z0.h
22 %res = call <vscale x 4 x half> @llvm.ceil.nxv4f16(<vscale x 4 x half> %a)
23 ret <vscale x 4 x half> %res
26 define <vscale x 2 x half> @frintp_nxv2f16(<vscale x 2 x half> %a) {
27 ; CHECK-LABEL: frintp_nxv2f16:
29 ; CHECK-NEXT: ptrue p0.d
30 ; CHECK-NEXT: frintp z0.h, p0/m, z0.h
32 %res = call <vscale x 2 x half> @llvm.ceil.nxv2f16(<vscale x 2 x half> %a)
33 ret <vscale x 2 x half> %res
36 define <vscale x 4 x float> @frintp_nxv4f32(<vscale x 4 x float> %a) {
37 ; CHECK-LABEL: frintp_nxv4f32:
39 ; CHECK-NEXT: ptrue p0.s
40 ; CHECK-NEXT: frintp z0.s, p0/m, z0.s
42 %res = call <vscale x 4 x float> @llvm.ceil.nxv4f32(<vscale x 4 x float> %a)
43 ret <vscale x 4 x float> %res
46 define <vscale x 2 x float> @frintp_nxv2f32(<vscale x 2 x float> %a) {
47 ; CHECK-LABEL: frintp_nxv2f32:
49 ; CHECK-NEXT: ptrue p0.d
50 ; CHECK-NEXT: frintp z0.s, p0/m, z0.s
52 %res = call <vscale x 2 x float> @llvm.ceil.nxv2f32(<vscale x 2 x float> %a)
53 ret <vscale x 2 x float> %res
56 define <vscale x 2 x double> @frintp_nxv2f64(<vscale x 2 x double> %a) {
57 ; CHECK-LABEL: frintp_nxv2f64:
59 ; CHECK-NEXT: ptrue p0.d
60 ; CHECK-NEXT: frintp z0.d, p0/m, z0.d
62 %res = call <vscale x 2 x double> @llvm.ceil.nxv2f64(<vscale x 2 x double> %a)
63 ret <vscale x 2 x double> %res
68 define <vscale x 8 x half> @frintm_nxv8f16(<vscale x 8 x half> %a) {
69 ; CHECK-LABEL: frintm_nxv8f16:
71 ; CHECK-NEXT: ptrue p0.h
72 ; CHECK-NEXT: frintm z0.h, p0/m, z0.h
74 %res = call <vscale x 8 x half> @llvm.floor.nxv8f16(<vscale x 8 x half> %a)
75 ret <vscale x 8 x half> %res
78 define <vscale x 4 x half> @frintm_nxv4f16(<vscale x 4 x half> %a) {
79 ; CHECK-LABEL: frintm_nxv4f16:
81 ; CHECK-NEXT: ptrue p0.s
82 ; CHECK-NEXT: frintm z0.h, p0/m, z0.h
84 %res = call <vscale x 4 x half> @llvm.floor.nxv4f16(<vscale x 4 x half> %a)
85 ret <vscale x 4 x half> %res
88 define <vscale x 2 x half> @frintm_nxv2f16(<vscale x 2 x half> %a) {
89 ; CHECK-LABEL: frintm_nxv2f16:
91 ; CHECK-NEXT: ptrue p0.d
92 ; CHECK-NEXT: frintm z0.h, p0/m, z0.h
94 %res = call <vscale x 2 x half> @llvm.floor.nxv2f16(<vscale x 2 x half> %a)
95 ret <vscale x 2 x half> %res
98 define <vscale x 4 x float> @frintm_nxv4f32(<vscale x 4 x float> %a) {
99 ; CHECK-LABEL: frintm_nxv4f32:
101 ; CHECK-NEXT: ptrue p0.s
102 ; CHECK-NEXT: frintm z0.s, p0/m, z0.s
104 %res = call <vscale x 4 x float> @llvm.floor.nxv4f32(<vscale x 4 x float> %a)
105 ret <vscale x 4 x float> %res
108 define <vscale x 2 x float> @frintm_nxv2f32(<vscale x 2 x float> %a) {
109 ; CHECK-LABEL: frintm_nxv2f32:
111 ; CHECK-NEXT: ptrue p0.d
112 ; CHECK-NEXT: frintm z0.s, p0/m, z0.s
114 %res = call <vscale x 2 x float> @llvm.floor.nxv2f32(<vscale x 2 x float> %a)
115 ret <vscale x 2 x float> %res
118 define <vscale x 2 x double> @frintm_nxv2f64(<vscale x 2 x double> %a) {
119 ; CHECK-LABEL: frintm_nxv2f64:
121 ; CHECK-NEXT: ptrue p0.d
122 ; CHECK-NEXT: frintm z0.d, p0/m, z0.d
124 %res = call <vscale x 2 x double> @llvm.floor.nxv2f64(<vscale x 2 x double> %a)
125 ret <vscale x 2 x double> %res
130 define <vscale x 8 x half> @frinti_nxv8f16(<vscale x 8 x half> %a) {
131 ; CHECK-LABEL: frinti_nxv8f16:
133 ; CHECK-NEXT: ptrue p0.h
134 ; CHECK-NEXT: frinti z0.h, p0/m, z0.h
136 %res = call <vscale x 8 x half> @llvm.nearbyint.nxv8f16(<vscale x 8 x half> %a)
137 ret <vscale x 8 x half> %res
140 define <vscale x 4 x half> @frinti_nxv4f16(<vscale x 4 x half> %a) {
141 ; CHECK-LABEL: frinti_nxv4f16:
143 ; CHECK-NEXT: ptrue p0.s
144 ; CHECK-NEXT: frinti z0.h, p0/m, z0.h
146 %res = call <vscale x 4 x half> @llvm.nearbyint.nxv4f16(<vscale x 4 x half> %a)
147 ret <vscale x 4 x half> %res
150 define <vscale x 2 x half> @frinti_nxv2f16(<vscale x 2 x half> %a) {
151 ; CHECK-LABEL: frinti_nxv2f16:
153 ; CHECK-NEXT: ptrue p0.d
154 ; CHECK-NEXT: frinti z0.h, p0/m, z0.h
156 %res = call <vscale x 2 x half> @llvm.nearbyint.nxv2f16(<vscale x 2 x half> %a)
157 ret <vscale x 2 x half> %res
160 define <vscale x 4 x float> @frinti_nxv4f32(<vscale x 4 x float> %a) {
161 ; CHECK-LABEL: frinti_nxv4f32:
163 ; CHECK-NEXT: ptrue p0.s
164 ; CHECK-NEXT: frinti z0.s, p0/m, z0.s
166 %res = call <vscale x 4 x float> @llvm.nearbyint.nxv4f32(<vscale x 4 x float> %a)
167 ret <vscale x 4 x float> %res
170 define <vscale x 2 x float> @frinti_nxv2f32(<vscale x 2 x float> %a) {
171 ; CHECK-LABEL: frinti_nxv2f32:
173 ; CHECK-NEXT: ptrue p0.d
174 ; CHECK-NEXT: frinti z0.s, p0/m, z0.s
176 %res = call <vscale x 2 x float> @llvm.nearbyint.nxv2f32(<vscale x 2 x float> %a)
177 ret <vscale x 2 x float> %res
180 define <vscale x 2 x double> @frinti_nxv2f64(<vscale x 2 x double> %a) {
181 ; CHECK-LABEL: frinti_nxv2f64:
183 ; CHECK-NEXT: ptrue p0.d
184 ; CHECK-NEXT: frinti z0.d, p0/m, z0.d
186 %res = call <vscale x 2 x double> @llvm.nearbyint.nxv2f64(<vscale x 2 x double> %a)
187 ret <vscale x 2 x double> %res
192 define <vscale x 8 x half> @frintx_nxv8f16(<vscale x 8 x half> %a) {
193 ; CHECK-LABEL: frintx_nxv8f16:
195 ; CHECK-NEXT: ptrue p0.h
196 ; CHECK-NEXT: frintx z0.h, p0/m, z0.h
198 %res = call <vscale x 8 x half> @llvm.rint.nxv8f16(<vscale x 8 x half> %a)
199 ret <vscale x 8 x half> %res
202 define <vscale x 4 x half> @frintx_nxv4f16(<vscale x 4 x half> %a) {
203 ; CHECK-LABEL: frintx_nxv4f16:
205 ; CHECK-NEXT: ptrue p0.s
206 ; CHECK-NEXT: frintx z0.h, p0/m, z0.h
208 %res = call <vscale x 4 x half> @llvm.rint.nxv4f16(<vscale x 4 x half> %a)
209 ret <vscale x 4 x half> %res
212 define <vscale x 2 x half> @frintx_nxv2f16(<vscale x 2 x half> %a) {
213 ; CHECK-LABEL: frintx_nxv2f16:
215 ; CHECK-NEXT: ptrue p0.d
216 ; CHECK-NEXT: frintx z0.h, p0/m, z0.h
218 %res = call <vscale x 2 x half> @llvm.rint.nxv2f16(<vscale x 2 x half> %a)
219 ret <vscale x 2 x half> %res
222 define <vscale x 4 x float> @frintx_nxv4f32(<vscale x 4 x float> %a) {
223 ; CHECK-LABEL: frintx_nxv4f32:
225 ; CHECK-NEXT: ptrue p0.s
226 ; CHECK-NEXT: frintx z0.s, p0/m, z0.s
228 %res = call <vscale x 4 x float> @llvm.rint.nxv4f32(<vscale x 4 x float> %a)
229 ret <vscale x 4 x float> %res
232 define <vscale x 2 x float> @frintx_nxv2f32(<vscale x 2 x float> %a) {
233 ; CHECK-LABEL: frintx_nxv2f32:
235 ; CHECK-NEXT: ptrue p0.d
236 ; CHECK-NEXT: frintx z0.s, p0/m, z0.s
238 %res = call <vscale x 2 x float> @llvm.rint.nxv2f32(<vscale x 2 x float> %a)
239 ret <vscale x 2 x float> %res
242 define <vscale x 2 x double> @frintx_nxv2f64(<vscale x 2 x double> %a) {
243 ; CHECK-LABEL: frintx_nxv2f64:
245 ; CHECK-NEXT: ptrue p0.d
246 ; CHECK-NEXT: frintx z0.d, p0/m, z0.d
248 %res = call <vscale x 2 x double> @llvm.rint.nxv2f64(<vscale x 2 x double> %a)
249 ret <vscale x 2 x double> %res
254 define <vscale x 8 x half> @frinta_nxv8f16(<vscale x 8 x half> %a) {
255 ; CHECK-LABEL: frinta_nxv8f16:
257 ; CHECK-NEXT: ptrue p0.h
258 ; CHECK-NEXT: frinta z0.h, p0/m, z0.h
260 %res = call <vscale x 8 x half> @llvm.round.nxv8f16(<vscale x 8 x half> %a)
261 ret <vscale x 8 x half> %res
264 define <vscale x 4 x half> @frinta_nxv4f16(<vscale x 4 x half> %a) {
265 ; CHECK-LABEL: frinta_nxv4f16:
267 ; CHECK-NEXT: ptrue p0.s
268 ; CHECK-NEXT: frinta z0.h, p0/m, z0.h
270 %res = call <vscale x 4 x half> @llvm.round.nxv4f16(<vscale x 4 x half> %a)
271 ret <vscale x 4 x half> %res
274 define <vscale x 2 x half> @frinta_nxv2f16(<vscale x 2 x half> %a) {
275 ; CHECK-LABEL: frinta_nxv2f16:
277 ; CHECK-NEXT: ptrue p0.d
278 ; CHECK-NEXT: frinta z0.h, p0/m, z0.h
280 %res = call <vscale x 2 x half> @llvm.round.nxv2f16(<vscale x 2 x half> %a)
281 ret <vscale x 2 x half> %res
284 define <vscale x 4 x float> @frinta_nxv4f32(<vscale x 4 x float> %a) {
285 ; CHECK-LABEL: frinta_nxv4f32:
287 ; CHECK-NEXT: ptrue p0.s
288 ; CHECK-NEXT: frinta z0.s, p0/m, z0.s
290 %res = call <vscale x 4 x float> @llvm.round.nxv4f32(<vscale x 4 x float> %a)
291 ret <vscale x 4 x float> %res
294 define <vscale x 2 x float> @frinta_nxv2f32(<vscale x 2 x float> %a) {
295 ; CHECK-LABEL: frinta_nxv2f32:
297 ; CHECK-NEXT: ptrue p0.d
298 ; CHECK-NEXT: frinta z0.s, p0/m, z0.s
300 %res = call <vscale x 2 x float> @llvm.round.nxv2f32(<vscale x 2 x float> %a)
301 ret <vscale x 2 x float> %res
304 define <vscale x 2 x double> @frinta_nxv2f64(<vscale x 2 x double> %a) {
305 ; CHECK-LABEL: frinta_nxv2f64:
307 ; CHECK-NEXT: ptrue p0.d
308 ; CHECK-NEXT: frinta z0.d, p0/m, z0.d
310 %res = call <vscale x 2 x double> @llvm.round.nxv2f64(<vscale x 2 x double> %a)
311 ret <vscale x 2 x double> %res
316 define <vscale x 8 x half> @frintn_nxv8f16(<vscale x 8 x half> %a) {
317 ; CHECK-LABEL: frintn_nxv8f16:
319 ; CHECK-NEXT: ptrue p0.h
320 ; CHECK-NEXT: frintn z0.h, p0/m, z0.h
322 %res = call <vscale x 8 x half> @llvm.roundeven.nxv8f16(<vscale x 8 x half> %a)
323 ret <vscale x 8 x half> %res
326 define <vscale x 4 x half> @frintn_nxv4f16(<vscale x 4 x half> %a) {
327 ; CHECK-LABEL: frintn_nxv4f16:
329 ; CHECK-NEXT: ptrue p0.s
330 ; CHECK-NEXT: frintn z0.h, p0/m, z0.h
332 %res = call <vscale x 4 x half> @llvm.roundeven.nxv4f16(<vscale x 4 x half> %a)
333 ret <vscale x 4 x half> %res
336 define <vscale x 2 x half> @frintn_nxv2f16(<vscale x 2 x half> %a) {
337 ; CHECK-LABEL: frintn_nxv2f16:
339 ; CHECK-NEXT: ptrue p0.d
340 ; CHECK-NEXT: frintn z0.h, p0/m, z0.h
342 %res = call <vscale x 2 x half> @llvm.roundeven.nxv2f16(<vscale x 2 x half> %a)
343 ret <vscale x 2 x half> %res
346 define <vscale x 4 x float> @frintn_nxv4f32(<vscale x 4 x float> %a) {
347 ; CHECK-LABEL: frintn_nxv4f32:
349 ; CHECK-NEXT: ptrue p0.s
350 ; CHECK-NEXT: frintn z0.s, p0/m, z0.s
352 %res = call <vscale x 4 x float> @llvm.roundeven.nxv4f32(<vscale x 4 x float> %a)
353 ret <vscale x 4 x float> %res
356 define <vscale x 2 x float> @frintn_nxv2f32(<vscale x 2 x float> %a) {
357 ; CHECK-LABEL: frintn_nxv2f32:
359 ; CHECK-NEXT: ptrue p0.d
360 ; CHECK-NEXT: frintn z0.s, p0/m, z0.s
362 %res = call <vscale x 2 x float> @llvm.roundeven.nxv2f32(<vscale x 2 x float> %a)
363 ret <vscale x 2 x float> %res
366 define <vscale x 2 x double> @frintn_nxv2f64(<vscale x 2 x double> %a) {
367 ; CHECK-LABEL: frintn_nxv2f64:
369 ; CHECK-NEXT: ptrue p0.d
370 ; CHECK-NEXT: frintn z0.d, p0/m, z0.d
372 %res = call <vscale x 2 x double> @llvm.roundeven.nxv2f64(<vscale x 2 x double> %a)
373 ret <vscale x 2 x double> %res
378 define <vscale x 8 x half> @frintz_nxv8f16(<vscale x 8 x half> %a) {
379 ; CHECK-LABEL: frintz_nxv8f16:
381 ; CHECK-NEXT: ptrue p0.h
382 ; CHECK-NEXT: frintz z0.h, p0/m, z0.h
384 %res = call <vscale x 8 x half> @llvm.trunc.nxv8f16(<vscale x 8 x half> %a)
385 ret <vscale x 8 x half> %res
388 define <vscale x 4 x half> @frintz_nxv4f16(<vscale x 4 x half> %a) {
389 ; CHECK-LABEL: frintz_nxv4f16:
391 ; CHECK-NEXT: ptrue p0.s
392 ; CHECK-NEXT: frintz z0.h, p0/m, z0.h
394 %res = call <vscale x 4 x half> @llvm.trunc.nxv4f16(<vscale x 4 x half> %a)
395 ret <vscale x 4 x half> %res
398 define <vscale x 2 x half> @frintz_nxv2f16(<vscale x 2 x half> %a) {
399 ; CHECK-LABEL: frintz_nxv2f16:
401 ; CHECK-NEXT: ptrue p0.d
402 ; CHECK-NEXT: frintz z0.h, p0/m, z0.h
404 %res = call <vscale x 2 x half> @llvm.trunc.nxv2f16(<vscale x 2 x half> %a)
405 ret <vscale x 2 x half> %res
408 define <vscale x 4 x float> @frintz_nxv4f32(<vscale x 4 x float> %a) {
409 ; CHECK-LABEL: frintz_nxv4f32:
411 ; CHECK-NEXT: ptrue p0.s
412 ; CHECK-NEXT: frintz z0.s, p0/m, z0.s
414 %res = call <vscale x 4 x float> @llvm.trunc.nxv4f32(<vscale x 4 x float> %a)
415 ret <vscale x 4 x float> %res
418 define <vscale x 2 x float> @frintz_nxv2f32(<vscale x 2 x float> %a) {
419 ; CHECK-LABEL: frintz_nxv2f32:
421 ; CHECK-NEXT: ptrue p0.d
422 ; CHECK-NEXT: frintz z0.s, p0/m, z0.s
424 %res = call <vscale x 2 x float> @llvm.trunc.nxv2f32(<vscale x 2 x float> %a)
425 ret <vscale x 2 x float> %res
428 define <vscale x 2 x double> @frintz_nxv2f64(<vscale x 2 x double> %a) {
429 ; CHECK-LABEL: frintz_nxv2f64:
431 ; CHECK-NEXT: ptrue p0.d
432 ; CHECK-NEXT: frintz z0.d, p0/m, z0.d
434 %res = call <vscale x 2 x double> @llvm.trunc.nxv2f64(<vscale x 2 x double> %a)
435 ret <vscale x 2 x double> %res
438 declare <vscale x 8 x half> @llvm.ceil.nxv8f16( <vscale x 8 x half>)
439 declare <vscale x 4 x half> @llvm.ceil.nxv4f16( <vscale x 4 x half>)
440 declare <vscale x 2 x half> @llvm.ceil.nxv2f16( <vscale x 2 x half>)
441 declare <vscale x 4 x float> @llvm.ceil.nxv4f32(<vscale x 4 x float>)
442 declare <vscale x 2 x float> @llvm.ceil.nxv2f32(<vscale x 2 x float>)
443 declare <vscale x 2 x double> @llvm.ceil.nxv2f64(<vscale x 2 x double>)
445 declare <vscale x 8 x half> @llvm.floor.nxv8f16( <vscale x 8 x half>)
446 declare <vscale x 4 x half> @llvm.floor.nxv4f16( <vscale x 4 x half>)
447 declare <vscale x 2 x half> @llvm.floor.nxv2f16( <vscale x 2 x half>)
448 declare <vscale x 4 x float> @llvm.floor.nxv4f32(<vscale x 4 x float>)
449 declare <vscale x 2 x float> @llvm.floor.nxv2f32(<vscale x 2 x float>)
450 declare <vscale x 2 x double> @llvm.floor.nxv2f64(<vscale x 2 x double>)
452 declare <vscale x 8 x half> @llvm.nearbyint.nxv8f16( <vscale x 8 x half>)
453 declare <vscale x 4 x half> @llvm.nearbyint.nxv4f16( <vscale x 4 x half>)
454 declare <vscale x 2 x half> @llvm.nearbyint.nxv2f16( <vscale x 2 x half>)
455 declare <vscale x 4 x float> @llvm.nearbyint.nxv4f32(<vscale x 4 x float>)
456 declare <vscale x 2 x float> @llvm.nearbyint.nxv2f32(<vscale x 2 x float>)
457 declare <vscale x 2 x double> @llvm.nearbyint.nxv2f64(<vscale x 2 x double>)
459 declare <vscale x 8 x half> @llvm.rint.nxv8f16( <vscale x 8 x half>)
460 declare <vscale x 4 x half> @llvm.rint.nxv4f16( <vscale x 4 x half>)
461 declare <vscale x 2 x half> @llvm.rint.nxv2f16( <vscale x 2 x half>)
462 declare <vscale x 4 x float> @llvm.rint.nxv4f32(<vscale x 4 x float>)
463 declare <vscale x 2 x float> @llvm.rint.nxv2f32(<vscale x 2 x float>)
464 declare <vscale x 2 x double> @llvm.rint.nxv2f64(<vscale x 2 x double>)
466 declare <vscale x 8 x half> @llvm.round.nxv8f16( <vscale x 8 x half>)
467 declare <vscale x 4 x half> @llvm.round.nxv4f16( <vscale x 4 x half>)
468 declare <vscale x 2 x half> @llvm.round.nxv2f16( <vscale x 2 x half>)
469 declare <vscale x 4 x float> @llvm.round.nxv4f32(<vscale x 4 x float>)
470 declare <vscale x 2 x float> @llvm.round.nxv2f32(<vscale x 2 x float>)
471 declare <vscale x 2 x double> @llvm.round.nxv2f64(<vscale x 2 x double>)
473 declare <vscale x 8 x half> @llvm.roundeven.nxv8f16( <vscale x 8 x half>)
474 declare <vscale x 4 x half> @llvm.roundeven.nxv4f16( <vscale x 4 x half>)
475 declare <vscale x 2 x half> @llvm.roundeven.nxv2f16( <vscale x 2 x half>)
476 declare <vscale x 4 x float> @llvm.roundeven.nxv4f32(<vscale x 4 x float>)
477 declare <vscale x 2 x float> @llvm.roundeven.nxv2f32(<vscale x 2 x float>)
478 declare <vscale x 2 x double> @llvm.roundeven.nxv2f64(<vscale x 2 x double>)
480 declare <vscale x 8 x half> @llvm.trunc.nxv8f16( <vscale x 8 x half>)
481 declare <vscale x 4 x half> @llvm.trunc.nxv4f16( <vscale x 4 x half>)
482 declare <vscale x 2 x half> @llvm.trunc.nxv2f16( <vscale x 2 x half>)
483 declare <vscale x 4 x float> @llvm.trunc.nxv4f32(<vscale x 4 x float>)
484 declare <vscale x 2 x float> @llvm.trunc.nxv2f32(<vscale x 2 x float>)
485 declare <vscale x 2 x double> @llvm.trunc.nxv2f64(<vscale x 2 x double>)