1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v,+zvfbfmin -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+zvfbfmin -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
155 declare <vscale x 1 x float> @llvm.experimental.constrained.fpext.nxv1f32.nxv1bf16(<vscale x 1 x bfloat>, metadata)
156 define <vscale x 1 x float> @vfpext_nxv1bf16_nxv1f32(<vscale x 1 x bfloat> %va) strictfp {
157 ; CHECK-LABEL: vfpext_nxv1bf16_nxv1f32:
159 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
160 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
161 ; CHECK-NEXT: vmv1r.v v8, v9
163 %evec = call <vscale x 1 x float> @llvm.experimental.constrained.fpext.nxv1f32.nxv1bf16(<vscale x 1 x bfloat> %va, metadata !"fpexcept.strict")
164 ret <vscale x 1 x float> %evec
167 declare <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1bf16(<vscale x 1 x bfloat>, metadata)
168 define <vscale x 1 x double> @vfpext_nxv1bf16_nxv1f64(<vscale x 1 x bfloat> %va) strictfp {
169 ; CHECK-LABEL: vfpext_nxv1bf16_nxv1f64:
171 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
172 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
173 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
174 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
176 %evec = call <vscale x 1 x double> @llvm.experimental.constrained.fpext.nxv1f64.nxv1bf16(<vscale x 1 x bfloat> %va, metadata !"fpexcept.strict")
177 ret <vscale x 1 x double> %evec
180 declare <vscale x 2 x float> @llvm.experimental.constrained.fpext.nxv2f32.nxv2bf16(<vscale x 2 x bfloat>, metadata)
181 define <vscale x 2 x float> @vfpext_nxv2bf16_nxv2f32(<vscale x 2 x bfloat> %va) strictfp {
182 ; CHECK-LABEL: vfpext_nxv2bf16_nxv2f32:
184 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
185 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
186 ; CHECK-NEXT: vmv1r.v v8, v9
188 %evec = call <vscale x 2 x float> @llvm.experimental.constrained.fpext.nxv2f32.nxv2bf16(<vscale x 2 x bfloat> %va, metadata !"fpexcept.strict")
189 ret <vscale x 2 x float> %evec
192 declare <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2bf16(<vscale x 2 x bfloat>, metadata)
193 define <vscale x 2 x double> @vfpext_nxv2bf16_nxv2f64(<vscale x 2 x bfloat> %va) strictfp {
194 ; CHECK-LABEL: vfpext_nxv2bf16_nxv2f64:
196 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
197 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
198 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
199 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
201 %evec = call <vscale x 2 x double> @llvm.experimental.constrained.fpext.nxv2f64.nxv2bf16(<vscale x 2 x bfloat> %va, metadata !"fpexcept.strict")
202 ret <vscale x 2 x double> %evec
205 declare <vscale x 4 x float> @llvm.experimental.constrained.fpext.nxv4f32.nxv4bf16(<vscale x 4 x bfloat>, metadata)
206 define <vscale x 4 x float> @vfpext_nxv4bf16_nxv4f32(<vscale x 4 x bfloat> %va) strictfp {
207 ; CHECK-LABEL: vfpext_nxv4bf16_nxv4f32:
209 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
210 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
211 ; CHECK-NEXT: vmv2r.v v8, v10
213 %evec = call <vscale x 4 x float> @llvm.experimental.constrained.fpext.nxv4f32.nxv4bf16(<vscale x 4 x bfloat> %va, metadata !"fpexcept.strict")
214 ret <vscale x 4 x float> %evec
217 declare <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4bf16(<vscale x 4 x bfloat>, metadata)
218 define <vscale x 4 x double> @vfpext_nxv4bf16_nxv4f64(<vscale x 4 x bfloat> %va) strictfp {
219 ; CHECK-LABEL: vfpext_nxv4bf16_nxv4f64:
221 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
222 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
223 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
224 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
226 %evec = call <vscale x 4 x double> @llvm.experimental.constrained.fpext.nxv4f64.nxv4bf16(<vscale x 4 x bfloat> %va, metadata !"fpexcept.strict")
227 ret <vscale x 4 x double> %evec
230 declare <vscale x 8 x float> @llvm.experimental.constrained.fpext.nxv8f32.nxv8bf16(<vscale x 8 x bfloat>, metadata)
231 define <vscale x 8 x float> @vfpext_nxv8bf16_nxv8f32(<vscale x 8 x bfloat> %va) strictfp {
232 ; CHECK-LABEL: vfpext_nxv8bf16_nxv8f32:
234 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
235 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
236 ; CHECK-NEXT: vmv4r.v v8, v12
238 %evec = call <vscale x 8 x float> @llvm.experimental.constrained.fpext.nxv8f32.nxv8bf16(<vscale x 8 x bfloat> %va, metadata !"fpexcept.strict")
239 ret <vscale x 8 x float> %evec
242 declare <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8bf16(<vscale x 8 x bfloat>, metadata)
243 define <vscale x 8 x double> @vfpext_nxv8bf16_nxv8f64(<vscale x 8 x bfloat> %va) strictfp {
244 ; CHECK-LABEL: vfpext_nxv8bf16_nxv8f64:
246 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
247 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
248 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
249 ; CHECK-NEXT: vfwcvt.f.f.v v8, v16
251 %evec = call <vscale x 8 x double> @llvm.experimental.constrained.fpext.nxv8f64.nxv8bf16(<vscale x 8 x bfloat> %va, metadata !"fpexcept.strict")
252 ret <vscale x 8 x double> %evec