1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v,+zfh,+zvfh \
3 ; RUN: -verify-machineinstrs -target-abi=ilp32d | FileCheck %s
4 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+zfh,+zvfh \
5 ; RUN: -verify-machineinstrs -target-abi=lp64d | FileCheck %s
6 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v,+zfh,+zvfhmin \
7 ; RUN: -verify-machineinstrs -target-abi=ilp32d | FileCheck %s
8 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+zfh,+zvfhmin \
9 ; RUN: -verify-machineinstrs -target-abi=lp64d | FileCheck %s
10 declare <vscale x 1 x half> @llvm.riscv.vfncvt.f.f.w.nxv1f16.nxv1f32(
15 define <vscale x 1 x half> @intrinsic_vfncvt_f.f.w_nxv1f16_nxv1f32(<vscale x 1 x float> %0, iXLen %1) nounwind {
16 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv1f16_nxv1f32:
17 ; CHECK: # %bb.0: # %entry
18 ; CHECK-NEXT: fsrmi a1, 0
19 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
20 ; CHECK-NEXT: vfncvt.f.f.w v9, v8
22 ; CHECK-NEXT: vmv1r.v v8, v9
25 %a = call <vscale x 1 x half> @llvm.riscv.vfncvt.f.f.w.nxv1f16.nxv1f32(
26 <vscale x 1 x half> undef,
27 <vscale x 1 x float> %0,
30 ret <vscale x 1 x half> %a
33 declare <vscale x 1 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv1f16.nxv1f32(
39 define <vscale x 1 x half> @intrinsic_vfncvt_mask_f.f.w_nxv1f16_nxv1f32(<vscale x 1 x half> %0, <vscale x 1 x float> %1, <vscale x 1 x i1> %2, iXLen %3) nounwind {
40 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv1f16_nxv1f32:
41 ; CHECK: # %bb.0: # %entry
42 ; CHECK-NEXT: fsrmi a1, 0
43 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
44 ; CHECK-NEXT: vfncvt.f.f.w v8, v9, v0.t
48 %a = call <vscale x 1 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv1f16.nxv1f32(
49 <vscale x 1 x half> %0,
50 <vscale x 1 x float> %1,
52 iXLen 0, iXLen %3, iXLen 1)
54 ret <vscale x 1 x half> %a
57 declare <vscale x 2 x half> @llvm.riscv.vfncvt.f.f.w.nxv2f16.nxv2f32(
62 define <vscale x 2 x half> @intrinsic_vfncvt_f.f.w_nxv2f16_nxv2f32(<vscale x 2 x float> %0, iXLen %1) nounwind {
63 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv2f16_nxv2f32:
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK-NEXT: fsrmi a1, 0
66 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
67 ; CHECK-NEXT: vfncvt.f.f.w v9, v8
69 ; CHECK-NEXT: vmv1r.v v8, v9
72 %a = call <vscale x 2 x half> @llvm.riscv.vfncvt.f.f.w.nxv2f16.nxv2f32(
73 <vscale x 2 x half> undef,
74 <vscale x 2 x float> %0,
77 ret <vscale x 2 x half> %a
80 declare <vscale x 2 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv2f16.nxv2f32(
86 define <vscale x 2 x half> @intrinsic_vfncvt_mask_f.f.w_nxv2f16_nxv2f32(<vscale x 2 x half> %0, <vscale x 2 x float> %1, <vscale x 2 x i1> %2, iXLen %3) nounwind {
87 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv2f16_nxv2f32:
88 ; CHECK: # %bb.0: # %entry
89 ; CHECK-NEXT: fsrmi a1, 0
90 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
91 ; CHECK-NEXT: vfncvt.f.f.w v8, v9, v0.t
95 %a = call <vscale x 2 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv2f16.nxv2f32(
96 <vscale x 2 x half> %0,
97 <vscale x 2 x float> %1,
99 iXLen 0, iXLen %3, iXLen 1)
101 ret <vscale x 2 x half> %a
104 declare <vscale x 4 x half> @llvm.riscv.vfncvt.f.f.w.nxv4f16.nxv4f32(
106 <vscale x 4 x float>,
109 define <vscale x 4 x half> @intrinsic_vfncvt_f.f.w_nxv4f16_nxv4f32(<vscale x 4 x float> %0, iXLen %1) nounwind {
110 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv4f16_nxv4f32:
111 ; CHECK: # %bb.0: # %entry
112 ; CHECK-NEXT: fsrmi a1, 0
113 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
114 ; CHECK-NEXT: vfncvt.f.f.w v10, v8
115 ; CHECK-NEXT: fsrm a1
116 ; CHECK-NEXT: vmv.v.v v8, v10
119 %a = call <vscale x 4 x half> @llvm.riscv.vfncvt.f.f.w.nxv4f16.nxv4f32(
120 <vscale x 4 x half> undef,
121 <vscale x 4 x float> %0,
124 ret <vscale x 4 x half> %a
127 declare <vscale x 4 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv4f16.nxv4f32(
129 <vscale x 4 x float>,
131 iXLen, iXLen, iXLen);
133 define <vscale x 4 x half> @intrinsic_vfncvt_mask_f.f.w_nxv4f16_nxv4f32(<vscale x 4 x half> %0, <vscale x 4 x float> %1, <vscale x 4 x i1> %2, iXLen %3) nounwind {
134 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv4f16_nxv4f32:
135 ; CHECK: # %bb.0: # %entry
136 ; CHECK-NEXT: fsrmi a1, 0
137 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
138 ; CHECK-NEXT: vfncvt.f.f.w v8, v10, v0.t
139 ; CHECK-NEXT: fsrm a1
142 %a = call <vscale x 4 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv4f16.nxv4f32(
143 <vscale x 4 x half> %0,
144 <vscale x 4 x float> %1,
145 <vscale x 4 x i1> %2,
146 iXLen 0, iXLen %3, iXLen 1)
148 ret <vscale x 4 x half> %a
151 declare <vscale x 8 x half> @llvm.riscv.vfncvt.f.f.w.nxv8f16.nxv8f32(
153 <vscale x 8 x float>,
156 define <vscale x 8 x half> @intrinsic_vfncvt_f.f.w_nxv8f16_nxv8f32(<vscale x 8 x float> %0, iXLen %1) nounwind {
157 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv8f16_nxv8f32:
158 ; CHECK: # %bb.0: # %entry
159 ; CHECK-NEXT: fsrmi a1, 0
160 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
161 ; CHECK-NEXT: vfncvt.f.f.w v12, v8
162 ; CHECK-NEXT: fsrm a1
163 ; CHECK-NEXT: vmv.v.v v8, v12
166 %a = call <vscale x 8 x half> @llvm.riscv.vfncvt.f.f.w.nxv8f16.nxv8f32(
167 <vscale x 8 x half> undef,
168 <vscale x 8 x float> %0,
171 ret <vscale x 8 x half> %a
174 declare <vscale x 8 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv8f16.nxv8f32(
176 <vscale x 8 x float>,
178 iXLen, iXLen, iXLen);
180 define <vscale x 8 x half> @intrinsic_vfncvt_mask_f.f.w_nxv8f16_nxv8f32(<vscale x 8 x half> %0, <vscale x 8 x float> %1, <vscale x 8 x i1> %2, iXLen %3) nounwind {
181 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv8f16_nxv8f32:
182 ; CHECK: # %bb.0: # %entry
183 ; CHECK-NEXT: fsrmi a1, 0
184 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
185 ; CHECK-NEXT: vfncvt.f.f.w v8, v12, v0.t
186 ; CHECK-NEXT: fsrm a1
189 %a = call <vscale x 8 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv8f16.nxv8f32(
190 <vscale x 8 x half> %0,
191 <vscale x 8 x float> %1,
192 <vscale x 8 x i1> %2,
193 iXLen 0, iXLen %3, iXLen 1)
195 ret <vscale x 8 x half> %a
198 declare <vscale x 16 x half> @llvm.riscv.vfncvt.f.f.w.nxv16f16.nxv16f32(
199 <vscale x 16 x half>,
200 <vscale x 16 x float>,
203 define <vscale x 16 x half> @intrinsic_vfncvt_f.f.w_nxv16f16_nxv16f32(<vscale x 16 x float> %0, iXLen %1) nounwind {
204 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv16f16_nxv16f32:
205 ; CHECK: # %bb.0: # %entry
206 ; CHECK-NEXT: fsrmi a1, 0
207 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
208 ; CHECK-NEXT: vfncvt.f.f.w v16, v8
209 ; CHECK-NEXT: fsrm a1
210 ; CHECK-NEXT: vmv.v.v v8, v16
213 %a = call <vscale x 16 x half> @llvm.riscv.vfncvt.f.f.w.nxv16f16.nxv16f32(
214 <vscale x 16 x half> undef,
215 <vscale x 16 x float> %0,
218 ret <vscale x 16 x half> %a
221 declare <vscale x 16 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv16f16.nxv16f32(
222 <vscale x 16 x half>,
223 <vscale x 16 x float>,
225 iXLen, iXLen, iXLen);
227 define <vscale x 16 x half> @intrinsic_vfncvt_mask_f.f.w_nxv16f16_nxv16f32(<vscale x 16 x half> %0, <vscale x 16 x float> %1, <vscale x 16 x i1> %2, iXLen %3) nounwind {
228 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv16f16_nxv16f32:
229 ; CHECK: # %bb.0: # %entry
230 ; CHECK-NEXT: fsrmi a1, 0
231 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
232 ; CHECK-NEXT: vfncvt.f.f.w v8, v16, v0.t
233 ; CHECK-NEXT: fsrm a1
236 %a = call <vscale x 16 x half> @llvm.riscv.vfncvt.f.f.w.mask.nxv16f16.nxv16f32(
237 <vscale x 16 x half> %0,
238 <vscale x 16 x float> %1,
239 <vscale x 16 x i1> %2,
240 iXLen 0, iXLen %3, iXLen 1)
242 ret <vscale x 16 x half> %a
245 declare <vscale x 1 x float> @llvm.riscv.vfncvt.f.f.w.nxv1f32.nxv1f64(
246 <vscale x 1 x float>,
247 <vscale x 1 x double>,
250 define <vscale x 1 x float> @intrinsic_vfncvt_f.f.w_nxv1f32_nxv1f64(<vscale x 1 x double> %0, iXLen %1) nounwind {
251 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv1f32_nxv1f64:
252 ; CHECK: # %bb.0: # %entry
253 ; CHECK-NEXT: fsrmi a1, 0
254 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
255 ; CHECK-NEXT: vfncvt.f.f.w v9, v8
256 ; CHECK-NEXT: fsrm a1
257 ; CHECK-NEXT: vmv1r.v v8, v9
260 %a = call <vscale x 1 x float> @llvm.riscv.vfncvt.f.f.w.nxv1f32.nxv1f64(
261 <vscale x 1 x float> undef,
262 <vscale x 1 x double> %0,
265 ret <vscale x 1 x float> %a
268 declare <vscale x 1 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv1f32.nxv1f64(
269 <vscale x 1 x float>,
270 <vscale x 1 x double>,
272 iXLen, iXLen, iXLen);
274 define <vscale x 1 x float> @intrinsic_vfncvt_mask_f.f.w_nxv1f32_nxv1f64(<vscale x 1 x float> %0, <vscale x 1 x double> %1, <vscale x 1 x i1> %2, iXLen %3) nounwind {
275 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv1f32_nxv1f64:
276 ; CHECK: # %bb.0: # %entry
277 ; CHECK-NEXT: fsrmi a1, 0
278 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
279 ; CHECK-NEXT: vfncvt.f.f.w v8, v9, v0.t
280 ; CHECK-NEXT: fsrm a1
283 %a = call <vscale x 1 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv1f32.nxv1f64(
284 <vscale x 1 x float> %0,
285 <vscale x 1 x double> %1,
286 <vscale x 1 x i1> %2,
287 iXLen 0, iXLen %3, iXLen 1)
289 ret <vscale x 1 x float> %a
292 declare <vscale x 2 x float> @llvm.riscv.vfncvt.f.f.w.nxv2f32.nxv2f64(
293 <vscale x 2 x float>,
294 <vscale x 2 x double>,
297 define <vscale x 2 x float> @intrinsic_vfncvt_f.f.w_nxv2f32_nxv2f64(<vscale x 2 x double> %0, iXLen %1) nounwind {
298 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv2f32_nxv2f64:
299 ; CHECK: # %bb.0: # %entry
300 ; CHECK-NEXT: fsrmi a1, 0
301 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
302 ; CHECK-NEXT: vfncvt.f.f.w v10, v8
303 ; CHECK-NEXT: fsrm a1
304 ; CHECK-NEXT: vmv.v.v v8, v10
307 %a = call <vscale x 2 x float> @llvm.riscv.vfncvt.f.f.w.nxv2f32.nxv2f64(
308 <vscale x 2 x float> undef,
309 <vscale x 2 x double> %0,
312 ret <vscale x 2 x float> %a
315 declare <vscale x 2 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv2f32.nxv2f64(
316 <vscale x 2 x float>,
317 <vscale x 2 x double>,
319 iXLen, iXLen, iXLen);
321 define <vscale x 2 x float> @intrinsic_vfncvt_mask_f.f.w_nxv2f32_nxv2f64(<vscale x 2 x float> %0, <vscale x 2 x double> %1, <vscale x 2 x i1> %2, iXLen %3) nounwind {
322 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv2f32_nxv2f64:
323 ; CHECK: # %bb.0: # %entry
324 ; CHECK-NEXT: fsrmi a1, 0
325 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu
326 ; CHECK-NEXT: vfncvt.f.f.w v8, v10, v0.t
327 ; CHECK-NEXT: fsrm a1
330 %a = call <vscale x 2 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv2f32.nxv2f64(
331 <vscale x 2 x float> %0,
332 <vscale x 2 x double> %1,
333 <vscale x 2 x i1> %2,
334 iXLen 0, iXLen %3, iXLen 1)
336 ret <vscale x 2 x float> %a
339 declare <vscale x 4 x float> @llvm.riscv.vfncvt.f.f.w.nxv4f32.nxv4f64(
340 <vscale x 4 x float>,
341 <vscale x 4 x double>,
344 define <vscale x 4 x float> @intrinsic_vfncvt_f.f.w_nxv4f32_nxv4f64(<vscale x 4 x double> %0, iXLen %1) nounwind {
345 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv4f32_nxv4f64:
346 ; CHECK: # %bb.0: # %entry
347 ; CHECK-NEXT: fsrmi a1, 0
348 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
349 ; CHECK-NEXT: vfncvt.f.f.w v12, v8
350 ; CHECK-NEXT: fsrm a1
351 ; CHECK-NEXT: vmv.v.v v8, v12
354 %a = call <vscale x 4 x float> @llvm.riscv.vfncvt.f.f.w.nxv4f32.nxv4f64(
355 <vscale x 4 x float> undef,
356 <vscale x 4 x double> %0,
359 ret <vscale x 4 x float> %a
362 declare <vscale x 4 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv4f32.nxv4f64(
363 <vscale x 4 x float>,
364 <vscale x 4 x double>,
366 iXLen, iXLen, iXLen);
368 define <vscale x 4 x float> @intrinsic_vfncvt_mask_f.f.w_nxv4f32_nxv4f64(<vscale x 4 x float> %0, <vscale x 4 x double> %1, <vscale x 4 x i1> %2, iXLen %3) nounwind {
369 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv4f32_nxv4f64:
370 ; CHECK: # %bb.0: # %entry
371 ; CHECK-NEXT: fsrmi a1, 0
372 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu
373 ; CHECK-NEXT: vfncvt.f.f.w v8, v12, v0.t
374 ; CHECK-NEXT: fsrm a1
377 %a = call <vscale x 4 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv4f32.nxv4f64(
378 <vscale x 4 x float> %0,
379 <vscale x 4 x double> %1,
380 <vscale x 4 x i1> %2,
381 iXLen 0, iXLen %3, iXLen 1)
383 ret <vscale x 4 x float> %a
386 declare <vscale x 8 x float> @llvm.riscv.vfncvt.f.f.w.nxv8f32.nxv8f64(
387 <vscale x 8 x float>,
388 <vscale x 8 x double>,
391 define <vscale x 8 x float> @intrinsic_vfncvt_f.f.w_nxv8f32_nxv8f64(<vscale x 8 x double> %0, iXLen %1) nounwind {
392 ; CHECK-LABEL: intrinsic_vfncvt_f.f.w_nxv8f32_nxv8f64:
393 ; CHECK: # %bb.0: # %entry
394 ; CHECK-NEXT: fsrmi a1, 0
395 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
396 ; CHECK-NEXT: vfncvt.f.f.w v16, v8
397 ; CHECK-NEXT: fsrm a1
398 ; CHECK-NEXT: vmv.v.v v8, v16
401 %a = call <vscale x 8 x float> @llvm.riscv.vfncvt.f.f.w.nxv8f32.nxv8f64(
402 <vscale x 8 x float> undef,
403 <vscale x 8 x double> %0,
406 ret <vscale x 8 x float> %a
409 declare <vscale x 8 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv8f32.nxv8f64(
410 <vscale x 8 x float>,
411 <vscale x 8 x double>,
413 iXLen, iXLen, iXLen);
415 define <vscale x 8 x float> @intrinsic_vfncvt_mask_f.f.w_nxv8f32_nxv8f64(<vscale x 8 x float> %0, <vscale x 8 x double> %1, <vscale x 8 x i1> %2, iXLen %3) nounwind {
416 ; CHECK-LABEL: intrinsic_vfncvt_mask_f.f.w_nxv8f32_nxv8f64:
417 ; CHECK: # %bb.0: # %entry
418 ; CHECK-NEXT: fsrmi a1, 0
419 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu
420 ; CHECK-NEXT: vfncvt.f.f.w v8, v16, v0.t
421 ; CHECK-NEXT: fsrm a1
424 %a = call <vscale x 8 x float> @llvm.riscv.vfncvt.f.f.w.mask.nxv8f32.nxv8f64(
425 <vscale x 8 x float> %0,
426 <vscale x 8 x double> %1,
427 <vscale x 8 x i1> %2,
428 iXLen 0, iXLen %3, iXLen 1)
430 ret <vscale x 8 x float> %a