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
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v,+zvfbfmin -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v,+zvfbfmin -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s
11 define <vscale x 1 x float> @vfpext_nxv1f16_nxv1f32(<vscale x 1 x half> %va) {
13 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f32:
15 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
17 ; CHECK-NEXT: vmv1r.v v8, v9
19 %evec = fpext <vscale x 1 x half> %va to <vscale x 1 x float>
20 ret <vscale x 1 x float> %evec
23 define <vscale x 1 x double> @vfpext_nxv1f16_nxv1f64(<vscale x 1 x half> %va) {
25 ; CHECK-LABEL: vfpext_nxv1f16_nxv1f64:
27 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
28 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
29 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
30 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
32 %evec = fpext <vscale x 1 x half> %va to <vscale x 1 x double>
33 ret <vscale x 1 x double> %evec
36 define <vscale x 2 x float> @vfpext_nxv2f16_nxv2f32(<vscale x 2 x half> %va) {
38 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f32:
40 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
41 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
42 ; CHECK-NEXT: vmv1r.v v8, v9
44 %evec = fpext <vscale x 2 x half> %va to <vscale x 2 x float>
45 ret <vscale x 2 x float> %evec
48 define <vscale x 2 x double> @vfpext_nxv2f16_nxv2f64(<vscale x 2 x half> %va) {
50 ; CHECK-LABEL: vfpext_nxv2f16_nxv2f64:
52 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
53 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
54 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
55 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
57 %evec = fpext <vscale x 2 x half> %va to <vscale x 2 x double>
58 ret <vscale x 2 x double> %evec
61 define <vscale x 4 x float> @vfpext_nxv4f16_nxv4f32(<vscale x 4 x half> %va) {
63 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f32:
65 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
66 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
67 ; CHECK-NEXT: vmv2r.v v8, v10
69 %evec = fpext <vscale x 4 x half> %va to <vscale x 4 x float>
70 ret <vscale x 4 x float> %evec
73 define <vscale x 4 x double> @vfpext_nxv4f16_nxv4f64(<vscale x 4 x half> %va) {
75 ; CHECK-LABEL: vfpext_nxv4f16_nxv4f64:
77 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
78 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
79 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
80 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
82 %evec = fpext <vscale x 4 x half> %va to <vscale x 4 x double>
83 ret <vscale x 4 x double> %evec
86 define <vscale x 8 x float> @vfpext_nxv8f16_nxv8f32(<vscale x 8 x half> %va) {
88 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f32:
90 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
91 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
92 ; CHECK-NEXT: vmv4r.v v8, v12
94 %evec = fpext <vscale x 8 x half> %va to <vscale x 8 x float>
95 ret <vscale x 8 x float> %evec
98 define <vscale x 8 x double> @vfpext_nxv8f16_nxv8f64(<vscale x 8 x half> %va) {
100 ; CHECK-LABEL: vfpext_nxv8f16_nxv8f64:
102 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
103 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
104 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
105 ; CHECK-NEXT: vfwcvt.f.f.v v8, v16
107 %evec = fpext <vscale x 8 x half> %va to <vscale x 8 x double>
108 ret <vscale x 8 x double> %evec
111 define <vscale x 16 x float> @vfpext_nxv16f16_nxv16f32(<vscale x 16 x half> %va) {
113 ; CHECK-LABEL: vfpext_nxv16f16_nxv16f32:
115 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
116 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
117 ; CHECK-NEXT: vmv8r.v v8, v16
119 %evec = fpext <vscale x 16 x half> %va to <vscale x 16 x float>
120 ret <vscale x 16 x float> %evec
123 define <vscale x 1 x double> @vfpext_nxv1f32_nxv1f64(<vscale x 1 x float> %va) {
125 ; CHECK-LABEL: vfpext_nxv1f32_nxv1f64:
127 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
128 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
129 ; CHECK-NEXT: vmv1r.v v8, v9
131 %evec = fpext <vscale x 1 x float> %va to <vscale x 1 x double>
132 ret <vscale x 1 x double> %evec
135 define <vscale x 2 x double> @vfpext_nxv2f32_nxv2f64(<vscale x 2 x float> %va) {
137 ; CHECK-LABEL: vfpext_nxv2f32_nxv2f64:
139 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
140 ; CHECK-NEXT: vfwcvt.f.f.v v10, v8
141 ; CHECK-NEXT: vmv2r.v v8, v10
143 %evec = fpext <vscale x 2 x float> %va to <vscale x 2 x double>
144 ret <vscale x 2 x double> %evec
147 define <vscale x 4 x double> @vfpext_nxv4f32_nxv4f64(<vscale x 4 x float> %va) {
149 ; CHECK-LABEL: vfpext_nxv4f32_nxv4f64:
151 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
152 ; CHECK-NEXT: vfwcvt.f.f.v v12, v8
153 ; CHECK-NEXT: vmv4r.v v8, v12
155 %evec = fpext <vscale x 4 x float> %va to <vscale x 4 x double>
156 ret <vscale x 4 x double> %evec
159 define <vscale x 8 x double> @vfpext_nxv8f32_nxv8f64(<vscale x 8 x float> %va) {
161 ; CHECK-LABEL: vfpext_nxv8f32_nxv8f64:
163 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
164 ; CHECK-NEXT: vfwcvt.f.f.v v16, v8
165 ; CHECK-NEXT: vmv8r.v v8, v16
167 %evec = fpext <vscale x 8 x float> %va to <vscale x 8 x double>
168 ret <vscale x 8 x double> %evec
171 define <vscale x 1 x float> @vfpext_nxv1bf16_nxv1f32(<vscale x 1 x bfloat> %va) {
173 ; CHECK-LABEL: vfpext_nxv1bf16_nxv1f32:
175 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
176 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
177 ; CHECK-NEXT: vmv1r.v v8, v9
179 %evec = fpext <vscale x 1 x bfloat> %va to <vscale x 1 x float>
180 ret <vscale x 1 x float> %evec
183 define <vscale x 1 x double> @vfpext_nxv1bf16_nxv1f64(<vscale x 1 x bfloat> %va) {
185 ; CHECK-LABEL: vfpext_nxv1bf16_nxv1f64:
187 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
188 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
189 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
190 ; CHECK-NEXT: vfwcvt.f.f.v v8, v9
192 %evec = fpext <vscale x 1 x bfloat> %va to <vscale x 1 x double>
193 ret <vscale x 1 x double> %evec
196 define <vscale x 2 x float> @vfpext_nxv2bf16_nxv2f32(<vscale x 2 x bfloat> %va) {
198 ; CHECK-LABEL: vfpext_nxv2bf16_nxv2f32:
200 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
201 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
202 ; CHECK-NEXT: vmv1r.v v8, v9
204 %evec = fpext <vscale x 2 x bfloat> %va to <vscale x 2 x float>
205 ret <vscale x 2 x float> %evec
208 define <vscale x 2 x double> @vfpext_nxv2bf16_nxv2f64(<vscale x 2 x bfloat> %va) {
210 ; CHECK-LABEL: vfpext_nxv2bf16_nxv2f64:
212 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
213 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
214 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
215 ; CHECK-NEXT: vfwcvt.f.f.v v8, v10
217 %evec = fpext <vscale x 2 x bfloat> %va to <vscale x 2 x double>
218 ret <vscale x 2 x double> %evec
221 define <vscale x 4 x float> @vfpext_nxv4bf16_nxv4f32(<vscale x 4 x bfloat> %va) {
223 ; CHECK-LABEL: vfpext_nxv4bf16_nxv4f32:
225 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
226 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
227 ; CHECK-NEXT: vmv2r.v v8, v10
229 %evec = fpext <vscale x 4 x bfloat> %va to <vscale x 4 x float>
230 ret <vscale x 4 x float> %evec
233 define <vscale x 4 x double> @vfpext_nxv4bf16_nxv4f64(<vscale x 4 x bfloat> %va) {
235 ; CHECK-LABEL: vfpext_nxv4bf16_nxv4f64:
237 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
238 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
239 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
240 ; CHECK-NEXT: vfwcvt.f.f.v v8, v12
242 %evec = fpext <vscale x 4 x bfloat> %va to <vscale x 4 x double>
243 ret <vscale x 4 x double> %evec
246 define <vscale x 8 x float> @vfpext_nxv8bf16_nxv8f32(<vscale x 8 x bfloat> %va) {
248 ; CHECK-LABEL: vfpext_nxv8bf16_nxv8f32:
250 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
251 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
252 ; CHECK-NEXT: vmv4r.v v8, v12
254 %evec = fpext <vscale x 8 x bfloat> %va to <vscale x 8 x float>
255 ret <vscale x 8 x float> %evec
258 define <vscale x 8 x double> @vfpext_nxv8bf16_nxv8f64(<vscale x 8 x bfloat> %va) {
260 ; CHECK-LABEL: vfpext_nxv8bf16_nxv8f64:
262 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
263 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
264 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
265 ; CHECK-NEXT: vfwcvt.f.f.v v8, v16
267 %evec = fpext <vscale x 8 x bfloat> %va to <vscale x 8 x double>
268 ret <vscale x 8 x double> %evec
271 define <vscale x 16 x float> @vfpext_nxv16bf16_nxv16f32(<vscale x 16 x bfloat> %va) {
273 ; CHECK-LABEL: vfpext_nxv16bf16_nxv16f32:
275 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
276 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
277 ; CHECK-NEXT: vmv8r.v v8, v16
279 %evec = fpext <vscale x 16 x bfloat> %va to <vscale x 16 x float>
280 ret <vscale x 16 x float> %evec