1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare <vscale x 1 x float> @llvm.experimental.constrained.fpext.nxv1f32.nxv1f16(<vscale x 1 x half>, metadata)
8 define <vscale x 1 x float> @vfpext_nxv1f16_nxv1f32(<vscale x 1 x half> %va) strictfp {
9 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f32:
11 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
12 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
13 ; CHECK-NEXT: vmv1r.v v8, v9
15 %evec = call <vscale x 1 x float> @llvm.experimental.constrained.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %va, metadata !"fpexcept.strict")
16 ret <vscale x 1 x float> %evec
19 declare <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1f16(<vscale x 1 x half>, metadata)
20 define <vscale x 1 x double> @vfpext_nxv1f16_nxv1f64(<vscale x 1 x half> %va) strictfp {
21 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f64:
23 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
24 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
25 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
26 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
28 %evec = call <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1f16(<vscale x 1 x half> %va, metadata !"fpexcept.strict")
29 ret <vscale x 1 x double> %evec
32 declare <vscale x 2 x float> @llvm.experimental.constrained.fpext.nxv2f32.nxv2f16(<vscale x 2 x half>, metadata)
33 define <vscale x 2 x float> @vfpext_nxv2f16_nxv2f32(<vscale x 2 x half> %va) strictfp {
34 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f32:
36 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
37 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
38 ; CHECK-NEXT: vmv1r.v v8, v9
40 %evec = call <vscale x 2 x float> @llvm.experimental.constrained.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %va, metadata !"fpexcept.strict")
41 ret <vscale x 2 x float> %evec
44 declare <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2f16(<vscale x 2 x half>, metadata)
45 define <vscale x 2 x double> @vfpext_nxv2f16_nxv2f64(<vscale x 2 x half> %va) strictfp {
46 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f64:
48 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
49 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
50 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
51 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
53 %evec = call <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2f16(<vscale x 2 x half> %va, metadata !"fpexcept.strict")
54 ret <vscale x 2 x double> %evec
57 declare <vscale x 4 x float> @llvm.experimental.constrained.fpext.nxv4f32.nxv4f16(<vscale x 4 x half>, metadata)
58 define <vscale x 4 x float> @vfpext_nxv4f16_nxv4f32(<vscale x 4 x half> %va) strictfp {
59 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f32:
61 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
62 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
63 ; CHECK-NEXT: vmv2r.v v8, v10
65 %evec = call <vscale x 4 x float> @llvm.experimental.constrained.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %va, metadata !"fpexcept.strict")
66 ret <vscale x 4 x float> %evec
69 declare <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4f16(<vscale x 4 x half>, metadata)
70 define <vscale x 4 x double> @vfpext_nxv4f16_nxv4f64(<vscale x 4 x half> %va) strictfp {
71 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f64:
73 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
74 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
75 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
76 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
78 %evec = call <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4f16(<vscale x 4 x half> %va, metadata !"fpexcept.strict")
79 ret <vscale x 4 x double> %evec
82 declare <vscale x 8 x float> @llvm.experimental.constrained.fpext.nxv8f32.nxv8f16(<vscale x 8 x half>, metadata)
83 define <vscale x 8 x float> @vfpext_nxv8f16_nxv8f32(<vscale x 8 x half> %va) strictfp {
84 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f32:
86 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
87 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
88 ; CHECK-NEXT: vmv4r.v v8, v12
90 %evec = call <vscale x 8 x float> @llvm.experimental.constrained.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %va, metadata !"fpexcept.strict")
91 ret <vscale x 8 x float> %evec
94 declare <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8f16(<vscale x 8 x half>, metadata)
95 define <vscale x 8 x double> @vfpext_nxv8f16_nxv8f64(<vscale x 8 x half> %va) strictfp {
96 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f64:
98 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
99 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
100 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
101 ; CHECK-NEXT: vfwcvt.f.f.v v8, v16
103 %evec = call <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8f16(<vscale x 8 x half> %va, metadata !"fpexcept.strict")
104 ret <vscale x 8 x double> %evec
107 declare <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1f32(<vscale x 1 x float>, metadata)
108 define <vscale x 1 x double> @vfpext_nxv1f32_nxv1f64(<vscale x 1 x float> %va) strictfp {
109 ; CHECK-LABEL: vfpext_nxv1f32_nxv1f64:
111 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
112 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
113 ; CHECK-NEXT: vmv1r.v v8, v9
115 %evec = call <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1f32(<vscale x 1 x float> %va, metadata !"fpexcept.strict")
116 ret <vscale x 1 x double> %evec
119 declare <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2f32(<vscale x 2 x float>, metadata)
120 define <vscale x 2 x double> @vfpext_nxv2f32_nxv2f64(<vscale x 2 x float> %va) strictfp {
121 ; CHECK-LABEL: vfpext_nxv2f32_nxv2f64:
123 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
124 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
125 ; CHECK-NEXT: vmv2r.v v8, v10
127 %evec = call <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2f32(<vscale x 2 x float> %va, metadata !"fpexcept.strict")
128 ret <vscale x 2 x double> %evec
131 declare <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4f32(<vscale x 4 x float>, metadata)
132 define <vscale x 4 x double> @vfpext_nxv4f32_nxv4f64(<vscale x 4 x float> %va) strictfp {
133 ; CHECK-LABEL: vfpext_nxv4f32_nxv4f64:
135 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
136 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
137 ; CHECK-NEXT: vmv4r.v v8, v12
139 %evec = call <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4f32(<vscale x 4 x float> %va, metadata !"fpexcept.strict")
140 ret <vscale x 4 x double> %evec
143 declare <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8f32(<vscale x 8 x float>, metadata)
144 define <vscale x 8 x double> @vfpext_nxv8f32_nxv8f64(<vscale x 8 x float> %va) strictfp {
145 ; CHECK-LABEL: vfpext_nxv8f32_nxv8f64:
147 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
148 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
149 ; CHECK-NEXT: vmv8r.v v8, v16
151 %evec = call <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8f32(<vscale x 8 x float> %va, metadata !"fpexcept.strict")
152 ret <vscale x 8 x double> %evec