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
7 declare <vscale x 1 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv1f16.nxv1f32(
12 define <vscale x 1 x half> @intrinsic_vfncvt_rod.f.f.w_nxv1f16_nxv1f32(<vscale x 1 x float> %0, iXLen %1) nounwind {
13 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv1f16_nxv1f32:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfncvt.rod.f.f.w v9, v8
17 ; CHECK-NEXT: vmv1r.v v8, v9
20 %a = call <vscale x 1 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv1f16.nxv1f32(
21 <vscale x 1 x half> undef,
22 <vscale x 1 x float> %0,
25 ret <vscale x 1 x half> %a
28 declare <vscale x 1 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv1f16.nxv1f32(
35 define <vscale x 1 x half> @intrinsic_vfncvt_mask_rod.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 {
36 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv1f16_nxv1f32:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
39 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v9, v0.t
42 %a = call <vscale x 1 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv1f16.nxv1f32(
43 <vscale x 1 x half> %0,
44 <vscale x 1 x float> %1,
48 ret <vscale x 1 x half> %a
51 declare <vscale x 2 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv2f16.nxv2f32(
56 define <vscale x 2 x half> @intrinsic_vfncvt_rod.f.f.w_nxv2f16_nxv2f32(<vscale x 2 x float> %0, iXLen %1) nounwind {
57 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv2f16_nxv2f32:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
60 ; CHECK-NEXT: vfncvt.rod.f.f.w v9, v8
61 ; CHECK-NEXT: vmv1r.v v8, v9
64 %a = call <vscale x 2 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv2f16.nxv2f32(
65 <vscale x 2 x half> undef,
66 <vscale x 2 x float> %0,
69 ret <vscale x 2 x half> %a
72 declare <vscale x 2 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv2f16.nxv2f32(
79 define <vscale x 2 x half> @intrinsic_vfncvt_mask_rod.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 {
80 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv2f16_nxv2f32:
81 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
83 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v9, v0.t
86 %a = call <vscale x 2 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv2f16.nxv2f32(
87 <vscale x 2 x half> %0,
88 <vscale x 2 x float> %1,
92 ret <vscale x 2 x half> %a
95 declare <vscale x 4 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv4f16.nxv4f32(
100 define <vscale x 4 x half> @intrinsic_vfncvt_rod.f.f.w_nxv4f16_nxv4f32(<vscale x 4 x float> %0, iXLen %1) nounwind {
101 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv4f16_nxv4f32:
102 ; CHECK: # %bb.0: # %entry
103 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
104 ; CHECK-NEXT: vfncvt.rod.f.f.w v10, v8
105 ; CHECK-NEXT: vmv.v.v v8, v10
108 %a = call <vscale x 4 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv4f16.nxv4f32(
109 <vscale x 4 x half> undef,
110 <vscale x 4 x float> %0,
113 ret <vscale x 4 x half> %a
116 declare <vscale x 4 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv4f16.nxv4f32(
118 <vscale x 4 x float>,
123 define <vscale x 4 x half> @intrinsic_vfncvt_mask_rod.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 {
124 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv4f16_nxv4f32:
125 ; CHECK: # %bb.0: # %entry
126 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
127 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v10, v0.t
130 %a = call <vscale x 4 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv4f16.nxv4f32(
131 <vscale x 4 x half> %0,
132 <vscale x 4 x float> %1,
133 <vscale x 4 x i1> %2,
136 ret <vscale x 4 x half> %a
139 declare <vscale x 8 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv8f16.nxv8f32(
141 <vscale x 8 x float>,
144 define <vscale x 8 x half> @intrinsic_vfncvt_rod.f.f.w_nxv8f16_nxv8f32(<vscale x 8 x float> %0, iXLen %1) nounwind {
145 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv8f16_nxv8f32:
146 ; CHECK: # %bb.0: # %entry
147 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
148 ; CHECK-NEXT: vfncvt.rod.f.f.w v12, v8
149 ; CHECK-NEXT: vmv.v.v v8, v12
152 %a = call <vscale x 8 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv8f16.nxv8f32(
153 <vscale x 8 x half> undef,
154 <vscale x 8 x float> %0,
157 ret <vscale x 8 x half> %a
160 declare <vscale x 8 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv8f16.nxv8f32(
162 <vscale x 8 x float>,
167 define <vscale x 8 x half> @intrinsic_vfncvt_mask_rod.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 {
168 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv8f16_nxv8f32:
169 ; CHECK: # %bb.0: # %entry
170 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
171 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v12, v0.t
174 %a = call <vscale x 8 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv8f16.nxv8f32(
175 <vscale x 8 x half> %0,
176 <vscale x 8 x float> %1,
177 <vscale x 8 x i1> %2,
180 ret <vscale x 8 x half> %a
183 declare <vscale x 16 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv16f16.nxv16f32(
184 <vscale x 16 x half>,
185 <vscale x 16 x float>,
188 define <vscale x 16 x half> @intrinsic_vfncvt_rod.f.f.w_nxv16f16_nxv16f32(<vscale x 16 x float> %0, iXLen %1) nounwind {
189 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv16f16_nxv16f32:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
192 ; CHECK-NEXT: vfncvt.rod.f.f.w v16, v8
193 ; CHECK-NEXT: vmv.v.v v8, v16
196 %a = call <vscale x 16 x half> @llvm.riscv.vfncvt.rod.f.f.w.nxv16f16.nxv16f32(
197 <vscale x 16 x half> undef,
198 <vscale x 16 x float> %0,
201 ret <vscale x 16 x half> %a
204 declare <vscale x 16 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv16f16.nxv16f32(
205 <vscale x 16 x half>,
206 <vscale x 16 x float>,
211 define <vscale x 16 x half> @intrinsic_vfncvt_mask_rod.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 {
212 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv16f16_nxv16f32:
213 ; CHECK: # %bb.0: # %entry
214 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
215 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v16, v0.t
218 %a = call <vscale x 16 x half> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv16f16.nxv16f32(
219 <vscale x 16 x half> %0,
220 <vscale x 16 x float> %1,
221 <vscale x 16 x i1> %2,
224 ret <vscale x 16 x half> %a
227 declare <vscale x 1 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv1f32.nxv1f64(
228 <vscale x 1 x float>,
229 <vscale x 1 x double>,
232 define <vscale x 1 x float> @intrinsic_vfncvt_rod.f.f.w_nxv1f32_nxv1f64(<vscale x 1 x double> %0, iXLen %1) nounwind {
233 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv1f32_nxv1f64:
234 ; CHECK: # %bb.0: # %entry
235 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
236 ; CHECK-NEXT: vfncvt.rod.f.f.w v9, v8
237 ; CHECK-NEXT: vmv1r.v v8, v9
240 %a = call <vscale x 1 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv1f32.nxv1f64(
241 <vscale x 1 x float> undef,
242 <vscale x 1 x double> %0,
245 ret <vscale x 1 x float> %a
248 declare <vscale x 1 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv1f32.nxv1f64(
249 <vscale x 1 x float>,
250 <vscale x 1 x double>,
255 define <vscale x 1 x float> @intrinsic_vfncvt_mask_rod.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 {
256 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv1f32_nxv1f64:
257 ; CHECK: # %bb.0: # %entry
258 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
259 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v9, v0.t
262 %a = call <vscale x 1 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv1f32.nxv1f64(
263 <vscale x 1 x float> %0,
264 <vscale x 1 x double> %1,
265 <vscale x 1 x i1> %2,
268 ret <vscale x 1 x float> %a
271 declare <vscale x 2 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv2f32.nxv2f64(
272 <vscale x 2 x float>,
273 <vscale x 2 x double>,
276 define <vscale x 2 x float> @intrinsic_vfncvt_rod.f.f.w_nxv2f32_nxv2f64(<vscale x 2 x double> %0, iXLen %1) nounwind {
277 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv2f32_nxv2f64:
278 ; CHECK: # %bb.0: # %entry
279 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
280 ; CHECK-NEXT: vfncvt.rod.f.f.w v10, v8
281 ; CHECK-NEXT: vmv.v.v v8, v10
284 %a = call <vscale x 2 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv2f32.nxv2f64(
285 <vscale x 2 x float> undef,
286 <vscale x 2 x double> %0,
289 ret <vscale x 2 x float> %a
292 declare <vscale x 2 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv2f32.nxv2f64(
293 <vscale x 2 x float>,
294 <vscale x 2 x double>,
299 define <vscale x 2 x float> @intrinsic_vfncvt_mask_rod.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 {
300 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv2f32_nxv2f64:
301 ; CHECK: # %bb.0: # %entry
302 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu
303 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v10, v0.t
306 %a = call <vscale x 2 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv2f32.nxv2f64(
307 <vscale x 2 x float> %0,
308 <vscale x 2 x double> %1,
309 <vscale x 2 x i1> %2,
312 ret <vscale x 2 x float> %a
315 declare <vscale x 4 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv4f32.nxv4f64(
316 <vscale x 4 x float>,
317 <vscale x 4 x double>,
320 define <vscale x 4 x float> @intrinsic_vfncvt_rod.f.f.w_nxv4f32_nxv4f64(<vscale x 4 x double> %0, iXLen %1) nounwind {
321 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv4f32_nxv4f64:
322 ; CHECK: # %bb.0: # %entry
323 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
324 ; CHECK-NEXT: vfncvt.rod.f.f.w v12, v8
325 ; CHECK-NEXT: vmv.v.v v8, v12
328 %a = call <vscale x 4 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv4f32.nxv4f64(
329 <vscale x 4 x float> undef,
330 <vscale x 4 x double> %0,
333 ret <vscale x 4 x float> %a
336 declare <vscale x 4 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv4f32.nxv4f64(
337 <vscale x 4 x float>,
338 <vscale x 4 x double>,
343 define <vscale x 4 x float> @intrinsic_vfncvt_mask_rod.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 {
344 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv4f32_nxv4f64:
345 ; CHECK: # %bb.0: # %entry
346 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu
347 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v12, v0.t
350 %a = call <vscale x 4 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv4f32.nxv4f64(
351 <vscale x 4 x float> %0,
352 <vscale x 4 x double> %1,
353 <vscale x 4 x i1> %2,
356 ret <vscale x 4 x float> %a
359 declare <vscale x 8 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv8f32.nxv8f64(
360 <vscale x 8 x float>,
361 <vscale x 8 x double>,
364 define <vscale x 8 x float> @intrinsic_vfncvt_rod.f.f.w_nxv8f32_nxv8f64(<vscale x 8 x double> %0, iXLen %1) nounwind {
365 ; CHECK-LABEL: intrinsic_vfncvt_rod.f.f.w_nxv8f32_nxv8f64:
366 ; CHECK: # %bb.0: # %entry
367 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
368 ; CHECK-NEXT: vfncvt.rod.f.f.w v16, v8
369 ; CHECK-NEXT: vmv.v.v v8, v16
372 %a = call <vscale x 8 x float> @llvm.riscv.vfncvt.rod.f.f.w.nxv8f32.nxv8f64(
373 <vscale x 8 x float> undef,
374 <vscale x 8 x double> %0,
377 ret <vscale x 8 x float> %a
380 declare <vscale x 8 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv8f32.nxv8f64(
381 <vscale x 8 x float>,
382 <vscale x 8 x double>,
387 define <vscale x 8 x float> @intrinsic_vfncvt_mask_rod.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 {
388 ; CHECK-LABEL: intrinsic_vfncvt_mask_rod.f.f.w_nxv8f32_nxv8f64:
389 ; CHECK: # %bb.0: # %entry
390 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu
391 ; CHECK-NEXT: vfncvt.rod.f.f.w v8, v16, v0.t
394 %a = call <vscale x 8 x float> @llvm.riscv.vfncvt.rod.f.f.w.mask.nxv8f32.nxv8f64(
395 <vscale x 8 x float> %0,
396 <vscale x 8 x double> %1,
397 <vscale x 8 x i1> %2,
400 ret <vscale x 8 x float> %a