1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv64 -mattr=+v,+d,+zfh,+experimental-zvfh -target-abi=lp64 \
3 ; RUN: -verify-machineinstrs < %s \
6 declare half @llvm.riscv.vfmv.f.s.nxv1f16(<vscale x 1 x half>)
7 declare float @llvm.riscv.vfmv.f.s.nxv1f32(<vscale x 1 x float>)
8 declare double @llvm.riscv.vfmv.f.s.nxv1f64(<vscale x 1 x double>)
10 declare <vscale x 1 x half> @llvm.riscv.vfmv.v.f.nxv1f16(<vscale x 1 x half>, half, i64);
11 declare <vscale x 1 x float> @llvm.riscv.vfmv.v.f.nxv1f32(<vscale x 1 x float>, float, i64);
12 declare <vscale x 1 x double> @llvm.riscv.vfmv.v.f.nxv1f64(<vscale x 1 x double>, double, i64);
14 define <vscale x 1 x half> @intrinsic_vfmv.f.s_s_nxv1f16(<vscale x 1 x half> %0, i64 %1) nounwind {
15 ; CHECK-LABEL: intrinsic_vfmv.f.s_s_nxv1f16:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: addi sp, sp, -16
18 ; CHECK-NEXT: vsetivli zero, 0, e16, mf4, ta, mu
19 ; CHECK-NEXT: vfmv.f.s ft0, v8
20 ; CHECK-NEXT: fsh ft0, 14(sp) # 2-byte Folded Spill
23 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
24 ; CHECK-NEXT: flh ft0, 14(sp) # 2-byte Folded Reload
25 ; CHECK-NEXT: vfmv.v.f v8, ft0
26 ; CHECK-NEXT: addi sp, sp, 16
29 %a = call half @llvm.riscv.vfmv.f.s.nxv1f16(<vscale x 1 x half> %0)
30 tail call void asm sideeffect "", "~{f0_d},~{f1_d},~{f2_d},~{f3_d},~{f4_d},~{f5_d},~{f6_d},~{f7_d},~{f8_d},~{f9_d},~{f10_d},~{f11_d},~{f12_d},~{f13_d},~{f14_d},~{f15_d},~{f16_d},~{f17_d},~{f18_d},~{f19_d},~{f20_d},~{f21_d},~{f22_d},~{f23_d},~{f24_d},~{f25_d},~{f26_d},~{f27_d},~{f28_d},~{f29_d},~{f30_d},~{f31_d}"()
31 %b = call <vscale x 1 x half> @llvm.riscv.vfmv.v.f.nxv1f16(<vscale x 1 x half> undef, half %a, i64 %1)
32 ret <vscale x 1 x half> %b
35 define <vscale x 1 x float> @intrinsic_vfmv.f.s_s_nxv1f32(<vscale x 1 x float> %0, i64 %1) nounwind {
36 ; CHECK-LABEL: intrinsic_vfmv.f.s_s_nxv1f32:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: addi sp, sp, -16
39 ; CHECK-NEXT: vsetivli zero, 0, e32, mf2, ta, mu
40 ; CHECK-NEXT: vfmv.f.s ft0, v8
41 ; CHECK-NEXT: fsw ft0, 12(sp) # 4-byte Folded Spill
44 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
45 ; CHECK-NEXT: flw ft0, 12(sp) # 4-byte Folded Reload
46 ; CHECK-NEXT: vfmv.v.f v8, ft0
47 ; CHECK-NEXT: addi sp, sp, 16
50 %a = call float @llvm.riscv.vfmv.f.s.nxv1f32(<vscale x 1 x float> %0)
51 tail call void asm sideeffect "", "~{f0_d},~{f1_d},~{f2_d},~{f3_d},~{f4_d},~{f5_d},~{f6_d},~{f7_d},~{f8_d},~{f9_d},~{f10_d},~{f11_d},~{f12_d},~{f13_d},~{f14_d},~{f15_d},~{f16_d},~{f17_d},~{f18_d},~{f19_d},~{f20_d},~{f21_d},~{f22_d},~{f23_d},~{f24_d},~{f25_d},~{f26_d},~{f27_d},~{f28_d},~{f29_d},~{f30_d},~{f31_d}"()
52 %b = call <vscale x 1 x float> @llvm.riscv.vfmv.v.f.nxv1f32(<vscale x 1 x float> undef, float %a, i64 %1)
53 ret <vscale x 1 x float> %b
56 define <vscale x 1 x double> @intrinsic_vfmv.f.s_s_nxv1f64(<vscale x 1 x double> %0, i64 %1) nounwind {
57 ; CHECK-LABEL: intrinsic_vfmv.f.s_s_nxv1f64:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: addi sp, sp, -16
60 ; CHECK-NEXT: vsetivli zero, 0, e64, m1, ta, mu
61 ; CHECK-NEXT: vfmv.f.s ft0, v8
62 ; CHECK-NEXT: fsd ft0, 8(sp) # 8-byte Folded Spill
65 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
66 ; CHECK-NEXT: fld ft0, 8(sp) # 8-byte Folded Reload
67 ; CHECK-NEXT: vfmv.v.f v8, ft0
68 ; CHECK-NEXT: addi sp, sp, 16
71 %a = call double @llvm.riscv.vfmv.f.s.nxv1f64(<vscale x 1 x double> %0)
72 tail call void asm sideeffect "", "~{f0_d},~{f1_d},~{f2_d},~{f3_d},~{f4_d},~{f5_d},~{f6_d},~{f7_d},~{f8_d},~{f9_d},~{f10_d},~{f11_d},~{f12_d},~{f13_d},~{f14_d},~{f15_d},~{f16_d},~{f17_d},~{f18_d},~{f19_d},~{f20_d},~{f21_d},~{f22_d},~{f23_d},~{f24_d},~{f25_d},~{f26_d},~{f27_d},~{f28_d},~{f29_d},~{f30_d},~{f31_d}"()
73 %b = call <vscale x 1 x double> @llvm.riscv.vfmv.v.f.nxv1f64(<vscale x 1 x double> undef, double %a, i64 %1)
74 ret <vscale x 1 x double> %b