1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zfh,+zvfh,+f,+d -riscv-v-fixed-length-vector-lmul-max=8 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX8,LMULMAX8ZVFH,LMULMAX8RV32
3 ; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zfh,+zvfh,+f,+d -riscv-v-fixed-length-vector-lmul-max=8 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX8,LMULMAX8ZVFH,LMULMAX8RV64
4 ; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zfh,+zvfh,+f,+d -riscv-v-fixed-length-vector-lmul-max=1 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX1,LMULMAX1RV32
5 ; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zfh,+zvfh,+f,+d -riscv-v-fixed-length-vector-lmul-max=1 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX1,LMULMAX1RV64
6 ; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zfh,+zvfhmin,+f,+d -riscv-v-fixed-length-vector-lmul-max=8 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX8,LMULMAX8ZVFHMIN,LMULMAX8RV32ZVFHMIN
7 ; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zfh,+zvfhmin,+f,+d -riscv-v-fixed-length-vector-lmul-max=8 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX8,LMULMAX8ZVFHMIN,LMULMAX8RV64ZVFHMIN
9 define void @si2fp_v2i32_v2f32(ptr %x, ptr %y) {
10 ; CHECK-LABEL: si2fp_v2i32_v2f32:
12 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
13 ; CHECK-NEXT: vle32.v v8, (a0)
14 ; CHECK-NEXT: vfcvt.f.x.v v8, v8
15 ; CHECK-NEXT: vse32.v v8, (a1)
17 %a = load <2 x i32>, ptr %x
18 %d = sitofp <2 x i32> %a to <2 x float>
19 store <2 x float> %d, ptr %y
23 define void @ui2fp_v2i32_v2f32(ptr %x, ptr %y) {
24 ; CHECK-LABEL: ui2fp_v2i32_v2f32:
26 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
27 ; CHECK-NEXT: vle32.v v8, (a0)
28 ; CHECK-NEXT: vfcvt.f.xu.v v8, v8
29 ; CHECK-NEXT: vse32.v v8, (a1)
31 %a = load <2 x i32>, ptr %x
32 %d = uitofp <2 x i32> %a to <2 x float>
33 store <2 x float> %d, ptr %y
37 define <2 x float> @si2fp_v2i1_v2f32(<2 x i1> %x) {
38 ; CHECK-LABEL: si2fp_v2i1_v2f32:
40 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
41 ; CHECK-NEXT: vmv.v.i v8, 0
42 ; CHECK-NEXT: vmerge.vim v9, v8, -1, v0
43 ; CHECK-NEXT: vfwcvt.f.x.v v8, v9
45 %z = sitofp <2 x i1> %x to <2 x float>
49 define <2 x float> @si2fp_v2i7_v2f32(<2 x i7> %x) {
50 ; CHECK-LABEL: si2fp_v2i7_v2f32:
52 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
53 ; CHECK-NEXT: vadd.vv v8, v8, v8
54 ; CHECK-NEXT: vsra.vi v8, v8, 1
55 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
56 ; CHECK-NEXT: vsext.vf2 v9, v8
57 ; CHECK-NEXT: vfwcvt.f.x.v v8, v9
59 %z = sitofp <2 x i7> %x to <2 x float>
63 define <2 x float> @ui2fp_v2i7_v2f32(<2 x i7> %x) {
64 ; CHECK-LABEL: ui2fp_v2i7_v2f32:
66 ; CHECK-NEXT: li a0, 127
67 ; CHECK-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
68 ; CHECK-NEXT: vand.vx v8, v8, a0
69 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
70 ; CHECK-NEXT: vzext.vf2 v9, v8
71 ; CHECK-NEXT: vfwcvt.f.xu.v v8, v9
73 %z = uitofp <2 x i7> %x to <2 x float>
77 define <2 x float> @ui2fp_v2i1_v2f32(<2 x i1> %x) {
78 ; CHECK-LABEL: ui2fp_v2i1_v2f32:
80 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
81 ; CHECK-NEXT: vmv.v.i v8, 0
82 ; CHECK-NEXT: vmerge.vim v9, v8, 1, v0
83 ; CHECK-NEXT: vfwcvt.f.xu.v v8, v9
85 %z = uitofp <2 x i1> %x to <2 x float>
89 define void @si2fp_v3i32_v3f32(ptr %x, ptr %y) {
90 ; CHECK-LABEL: si2fp_v3i32_v3f32:
92 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
93 ; CHECK-NEXT: vle32.v v8, (a0)
94 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
95 ; CHECK-NEXT: vfcvt.f.x.v v8, v8
96 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
97 ; CHECK-NEXT: vse32.v v8, (a1)
99 %a = load <3 x i32>, ptr %x
100 %d = sitofp <3 x i32> %a to <3 x float>
101 store <3 x float> %d, ptr %y
105 define void @ui2fp_v3i32_v3f32(ptr %x, ptr %y) {
106 ; CHECK-LABEL: ui2fp_v3i32_v3f32:
108 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
109 ; CHECK-NEXT: vle32.v v8, (a0)
110 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
111 ; CHECK-NEXT: vfcvt.f.xu.v v8, v8
112 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
113 ; CHECK-NEXT: vse32.v v8, (a1)
115 %a = load <3 x i32>, ptr %x
116 %d = uitofp <3 x i32> %a to <3 x float>
117 store <3 x float> %d, ptr %y
121 define <3 x float> @si2fp_v3i1_v3f32(<3 x i1> %x) {
122 ; CHECK-LABEL: si2fp_v3i1_v3f32:
124 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
125 ; CHECK-NEXT: vmv.v.i v8, 0
126 ; CHECK-NEXT: vmerge.vim v9, v8, -1, v0
127 ; CHECK-NEXT: vfwcvt.f.x.v v8, v9
129 %z = sitofp <3 x i1> %x to <3 x float>
133 ; FIXME: This gets expanded instead of widened + promoted
134 define <3 x float> @si2fp_v3i7_v3f32(<3 x i7> %x) {
135 ; LMULMAX8RV32-LABEL: si2fp_v3i7_v3f32:
136 ; LMULMAX8RV32: # %bb.0:
137 ; LMULMAX8RV32-NEXT: lw a1, 0(a0)
138 ; LMULMAX8RV32-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
139 ; LMULMAX8RV32-NEXT: lw a2, 4(a0)
140 ; LMULMAX8RV32-NEXT: lw a0, 8(a0)
141 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a1
142 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a2
143 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a0
144 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v8, 1
145 ; LMULMAX8RV32-NEXT: vadd.vv v8, v8, v8
146 ; LMULMAX8RV32-NEXT: vsra.vi v8, v8, 1
147 ; LMULMAX8RV32-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
148 ; LMULMAX8RV32-NEXT: vsext.vf2 v9, v8
149 ; LMULMAX8RV32-NEXT: vfwcvt.f.x.v v8, v9
150 ; LMULMAX8RV32-NEXT: ret
152 ; LMULMAX8RV64-LABEL: si2fp_v3i7_v3f32:
153 ; LMULMAX8RV64: # %bb.0:
154 ; LMULMAX8RV64-NEXT: ld a1, 0(a0)
155 ; LMULMAX8RV64-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
156 ; LMULMAX8RV64-NEXT: ld a2, 8(a0)
157 ; LMULMAX8RV64-NEXT: ld a0, 16(a0)
158 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a1
159 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a2
160 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a0
161 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v8, 1
162 ; LMULMAX8RV64-NEXT: vadd.vv v8, v8, v8
163 ; LMULMAX8RV64-NEXT: vsra.vi v8, v8, 1
164 ; LMULMAX8RV64-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
165 ; LMULMAX8RV64-NEXT: vsext.vf2 v9, v8
166 ; LMULMAX8RV64-NEXT: vfwcvt.f.x.v v8, v9
167 ; LMULMAX8RV64-NEXT: ret
169 ; LMULMAX1RV32-LABEL: si2fp_v3i7_v3f32:
170 ; LMULMAX1RV32: # %bb.0:
171 ; LMULMAX1RV32-NEXT: lw a1, 0(a0)
172 ; LMULMAX1RV32-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
173 ; LMULMAX1RV32-NEXT: lw a2, 4(a0)
174 ; LMULMAX1RV32-NEXT: lw a0, 8(a0)
175 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a1
176 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a2
177 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a0
178 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v8, 1
179 ; LMULMAX1RV32-NEXT: vadd.vv v8, v8, v8
180 ; LMULMAX1RV32-NEXT: vsra.vi v8, v8, 1
181 ; LMULMAX1RV32-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
182 ; LMULMAX1RV32-NEXT: vsext.vf2 v9, v8
183 ; LMULMAX1RV32-NEXT: vfwcvt.f.x.v v8, v9
184 ; LMULMAX1RV32-NEXT: ret
186 ; LMULMAX1RV64-LABEL: si2fp_v3i7_v3f32:
187 ; LMULMAX1RV64: # %bb.0:
188 ; LMULMAX1RV64-NEXT: ld a1, 0(a0)
189 ; LMULMAX1RV64-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
190 ; LMULMAX1RV64-NEXT: ld a2, 8(a0)
191 ; LMULMAX1RV64-NEXT: ld a0, 16(a0)
192 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a1
193 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a2
194 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a0
195 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v8, 1
196 ; LMULMAX1RV64-NEXT: vadd.vv v8, v8, v8
197 ; LMULMAX1RV64-NEXT: vsra.vi v8, v8, 1
198 ; LMULMAX1RV64-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
199 ; LMULMAX1RV64-NEXT: vsext.vf2 v9, v8
200 ; LMULMAX1RV64-NEXT: vfwcvt.f.x.v v8, v9
201 ; LMULMAX1RV64-NEXT: ret
203 ; LMULMAX8RV32ZVFHMIN-LABEL: si2fp_v3i7_v3f32:
204 ; LMULMAX8RV32ZVFHMIN: # %bb.0:
205 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a1, 0(a0)
206 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
207 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a2, 4(a0)
208 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a0, 8(a0)
209 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a1
210 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a2
211 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a0
212 ; LMULMAX8RV32ZVFHMIN-NEXT: vslidedown.vi v8, v8, 1
213 ; LMULMAX8RV32ZVFHMIN-NEXT: vadd.vv v8, v8, v8
214 ; LMULMAX8RV32ZVFHMIN-NEXT: vsra.vi v8, v8, 1
215 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
216 ; LMULMAX8RV32ZVFHMIN-NEXT: vsext.vf2 v9, v8
217 ; LMULMAX8RV32ZVFHMIN-NEXT: vfwcvt.f.x.v v8, v9
218 ; LMULMAX8RV32ZVFHMIN-NEXT: ret
220 ; LMULMAX8RV64ZVFHMIN-LABEL: si2fp_v3i7_v3f32:
221 ; LMULMAX8RV64ZVFHMIN: # %bb.0:
222 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a1, 0(a0)
223 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
224 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a2, 8(a0)
225 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a0, 16(a0)
226 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a1
227 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a2
228 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a0
229 ; LMULMAX8RV64ZVFHMIN-NEXT: vslidedown.vi v8, v8, 1
230 ; LMULMAX8RV64ZVFHMIN-NEXT: vadd.vv v8, v8, v8
231 ; LMULMAX8RV64ZVFHMIN-NEXT: vsra.vi v8, v8, 1
232 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
233 ; LMULMAX8RV64ZVFHMIN-NEXT: vsext.vf2 v9, v8
234 ; LMULMAX8RV64ZVFHMIN-NEXT: vfwcvt.f.x.v v8, v9
235 ; LMULMAX8RV64ZVFHMIN-NEXT: ret
236 %z = sitofp <3 x i7> %x to <3 x float>
240 ; FIXME: This gets expanded instead of widened + promoted
241 define <3 x float> @ui2fp_v3i7_v3f32(<3 x i7> %x) {
242 ; LMULMAX8RV32-LABEL: ui2fp_v3i7_v3f32:
243 ; LMULMAX8RV32: # %bb.0:
244 ; LMULMAX8RV32-NEXT: lw a1, 0(a0)
245 ; LMULMAX8RV32-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
246 ; LMULMAX8RV32-NEXT: lw a2, 4(a0)
247 ; LMULMAX8RV32-NEXT: lw a0, 8(a0)
248 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a1
249 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a2
250 ; LMULMAX8RV32-NEXT: vslide1down.vx v8, v8, a0
251 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v8, 1
252 ; LMULMAX8RV32-NEXT: li a0, 127
253 ; LMULMAX8RV32-NEXT: vand.vx v8, v8, a0
254 ; LMULMAX8RV32-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
255 ; LMULMAX8RV32-NEXT: vzext.vf2 v9, v8
256 ; LMULMAX8RV32-NEXT: vfwcvt.f.xu.v v8, v9
257 ; LMULMAX8RV32-NEXT: ret
259 ; LMULMAX8RV64-LABEL: ui2fp_v3i7_v3f32:
260 ; LMULMAX8RV64: # %bb.0:
261 ; LMULMAX8RV64-NEXT: ld a1, 0(a0)
262 ; LMULMAX8RV64-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
263 ; LMULMAX8RV64-NEXT: ld a2, 8(a0)
264 ; LMULMAX8RV64-NEXT: ld a0, 16(a0)
265 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a1
266 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a2
267 ; LMULMAX8RV64-NEXT: vslide1down.vx v8, v8, a0
268 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v8, 1
269 ; LMULMAX8RV64-NEXT: li a0, 127
270 ; LMULMAX8RV64-NEXT: vand.vx v8, v8, a0
271 ; LMULMAX8RV64-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
272 ; LMULMAX8RV64-NEXT: vzext.vf2 v9, v8
273 ; LMULMAX8RV64-NEXT: vfwcvt.f.xu.v v8, v9
274 ; LMULMAX8RV64-NEXT: ret
276 ; LMULMAX1RV32-LABEL: ui2fp_v3i7_v3f32:
277 ; LMULMAX1RV32: # %bb.0:
278 ; LMULMAX1RV32-NEXT: lw a1, 0(a0)
279 ; LMULMAX1RV32-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
280 ; LMULMAX1RV32-NEXT: lw a2, 4(a0)
281 ; LMULMAX1RV32-NEXT: lw a0, 8(a0)
282 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a1
283 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a2
284 ; LMULMAX1RV32-NEXT: vslide1down.vx v8, v8, a0
285 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v8, 1
286 ; LMULMAX1RV32-NEXT: li a0, 127
287 ; LMULMAX1RV32-NEXT: vand.vx v8, v8, a0
288 ; LMULMAX1RV32-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
289 ; LMULMAX1RV32-NEXT: vzext.vf2 v9, v8
290 ; LMULMAX1RV32-NEXT: vfwcvt.f.xu.v v8, v9
291 ; LMULMAX1RV32-NEXT: ret
293 ; LMULMAX1RV64-LABEL: ui2fp_v3i7_v3f32:
294 ; LMULMAX1RV64: # %bb.0:
295 ; LMULMAX1RV64-NEXT: ld a1, 0(a0)
296 ; LMULMAX1RV64-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
297 ; LMULMAX1RV64-NEXT: ld a2, 8(a0)
298 ; LMULMAX1RV64-NEXT: ld a0, 16(a0)
299 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a1
300 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a2
301 ; LMULMAX1RV64-NEXT: vslide1down.vx v8, v8, a0
302 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v8, 1
303 ; LMULMAX1RV64-NEXT: li a0, 127
304 ; LMULMAX1RV64-NEXT: vand.vx v8, v8, a0
305 ; LMULMAX1RV64-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
306 ; LMULMAX1RV64-NEXT: vzext.vf2 v9, v8
307 ; LMULMAX1RV64-NEXT: vfwcvt.f.xu.v v8, v9
308 ; LMULMAX1RV64-NEXT: ret
310 ; LMULMAX8RV32ZVFHMIN-LABEL: ui2fp_v3i7_v3f32:
311 ; LMULMAX8RV32ZVFHMIN: # %bb.0:
312 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a1, 0(a0)
313 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
314 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a2, 4(a0)
315 ; LMULMAX8RV32ZVFHMIN-NEXT: lw a0, 8(a0)
316 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a1
317 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a2
318 ; LMULMAX8RV32ZVFHMIN-NEXT: vslide1down.vx v8, v8, a0
319 ; LMULMAX8RV32ZVFHMIN-NEXT: vslidedown.vi v8, v8, 1
320 ; LMULMAX8RV32ZVFHMIN-NEXT: li a0, 127
321 ; LMULMAX8RV32ZVFHMIN-NEXT: vand.vx v8, v8, a0
322 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
323 ; LMULMAX8RV32ZVFHMIN-NEXT: vzext.vf2 v9, v8
324 ; LMULMAX8RV32ZVFHMIN-NEXT: vfwcvt.f.xu.v v8, v9
325 ; LMULMAX8RV32ZVFHMIN-NEXT: ret
327 ; LMULMAX8RV64ZVFHMIN-LABEL: ui2fp_v3i7_v3f32:
328 ; LMULMAX8RV64ZVFHMIN: # %bb.0:
329 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a1, 0(a0)
330 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
331 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a2, 8(a0)
332 ; LMULMAX8RV64ZVFHMIN-NEXT: ld a0, 16(a0)
333 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a1
334 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a2
335 ; LMULMAX8RV64ZVFHMIN-NEXT: vslide1down.vx v8, v8, a0
336 ; LMULMAX8RV64ZVFHMIN-NEXT: vslidedown.vi v8, v8, 1
337 ; LMULMAX8RV64ZVFHMIN-NEXT: li a0, 127
338 ; LMULMAX8RV64ZVFHMIN-NEXT: vand.vx v8, v8, a0
339 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
340 ; LMULMAX8RV64ZVFHMIN-NEXT: vzext.vf2 v9, v8
341 ; LMULMAX8RV64ZVFHMIN-NEXT: vfwcvt.f.xu.v v8, v9
342 ; LMULMAX8RV64ZVFHMIN-NEXT: ret
343 %z = uitofp <3 x i7> %x to <3 x float>
347 define <3 x float> @ui2fp_v3i1_v3f32(<3 x i1> %x) {
348 ; CHECK-LABEL: ui2fp_v3i1_v3f32:
350 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
351 ; CHECK-NEXT: vmv.v.i v8, 0
352 ; CHECK-NEXT: vmerge.vim v9, v8, 1, v0
353 ; CHECK-NEXT: vfwcvt.f.xu.v v8, v9
355 %z = uitofp <3 x i1> %x to <3 x float>
359 define void @si2fp_v8i32_v8f32(ptr %x, ptr %y) {
360 ; LMULMAX8-LABEL: si2fp_v8i32_v8f32:
362 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
363 ; LMULMAX8-NEXT: vle32.v v8, (a0)
364 ; LMULMAX8-NEXT: vfcvt.f.x.v v8, v8
365 ; LMULMAX8-NEXT: vse32.v v8, (a1)
368 ; LMULMAX1-LABEL: si2fp_v8i32_v8f32:
370 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
371 ; LMULMAX1-NEXT: addi a2, a0, 16
372 ; LMULMAX1-NEXT: vle32.v v8, (a2)
373 ; LMULMAX1-NEXT: vle32.v v9, (a0)
374 ; LMULMAX1-NEXT: vfcvt.f.x.v v8, v8
375 ; LMULMAX1-NEXT: vfcvt.f.x.v v9, v9
376 ; LMULMAX1-NEXT: vse32.v v9, (a1)
377 ; LMULMAX1-NEXT: addi a1, a1, 16
378 ; LMULMAX1-NEXT: vse32.v v8, (a1)
380 %a = load <8 x i32>, ptr %x
381 %d = sitofp <8 x i32> %a to <8 x float>
382 store <8 x float> %d, ptr %y
386 define void @ui2fp_v8i32_v8f32(ptr %x, ptr %y) {
387 ; LMULMAX8-LABEL: ui2fp_v8i32_v8f32:
389 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
390 ; LMULMAX8-NEXT: vle32.v v8, (a0)
391 ; LMULMAX8-NEXT: vfcvt.f.xu.v v8, v8
392 ; LMULMAX8-NEXT: vse32.v v8, (a1)
395 ; LMULMAX1-LABEL: ui2fp_v8i32_v8f32:
397 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
398 ; LMULMAX1-NEXT: addi a2, a0, 16
399 ; LMULMAX1-NEXT: vle32.v v8, (a2)
400 ; LMULMAX1-NEXT: vle32.v v9, (a0)
401 ; LMULMAX1-NEXT: vfcvt.f.xu.v v8, v8
402 ; LMULMAX1-NEXT: vfcvt.f.xu.v v9, v9
403 ; LMULMAX1-NEXT: vse32.v v9, (a1)
404 ; LMULMAX1-NEXT: addi a1, a1, 16
405 ; LMULMAX1-NEXT: vse32.v v8, (a1)
407 %a = load <8 x i32>, ptr %x
408 %d = uitofp <8 x i32> %a to <8 x float>
409 store <8 x float> %d, ptr %y
413 define <8 x float> @si2fp_v8i1_v8f32(<8 x i1> %x) {
414 ; LMULMAX8-LABEL: si2fp_v8i1_v8f32:
416 ; LMULMAX8-NEXT: vsetivli zero, 8, e16, m1, ta, ma
417 ; LMULMAX8-NEXT: vmv.v.i v8, 0
418 ; LMULMAX8-NEXT: vmerge.vim v10, v8, -1, v0
419 ; LMULMAX8-NEXT: vfwcvt.f.x.v v8, v10
422 ; LMULMAX1-LABEL: si2fp_v8i1_v8f32:
424 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
425 ; LMULMAX1-NEXT: vmv.v.i v9, 0
426 ; LMULMAX1-NEXT: vmerge.vim v10, v9, -1, v0
427 ; LMULMAX1-NEXT: vfwcvt.f.x.v v8, v10
428 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
429 ; LMULMAX1-NEXT: vmv.v.i v10, 0
430 ; LMULMAX1-NEXT: vmerge.vim v10, v10, 1, v0
431 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
432 ; LMULMAX1-NEXT: vslidedown.vi v10, v10, 4
433 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
434 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
435 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
436 ; LMULMAX1-NEXT: vmerge.vim v10, v9, -1, v0
437 ; LMULMAX1-NEXT: vfwcvt.f.x.v v9, v10
439 %z = sitofp <8 x i1> %x to <8 x float>
443 define <8 x float> @ui2fp_v8i1_v8f32(<8 x i1> %x) {
444 ; LMULMAX8-LABEL: ui2fp_v8i1_v8f32:
446 ; LMULMAX8-NEXT: vsetivli zero, 8, e16, m1, ta, ma
447 ; LMULMAX8-NEXT: vmv.v.i v8, 0
448 ; LMULMAX8-NEXT: vmerge.vim v10, v8, 1, v0
449 ; LMULMAX8-NEXT: vfwcvt.f.xu.v v8, v10
452 ; LMULMAX1-LABEL: ui2fp_v8i1_v8f32:
454 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
455 ; LMULMAX1-NEXT: vmv.v.i v9, 0
456 ; LMULMAX1-NEXT: vmerge.vim v10, v9, 1, v0
457 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v8, v10
458 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
459 ; LMULMAX1-NEXT: vmv.v.i v10, 0
460 ; LMULMAX1-NEXT: vmerge.vim v10, v10, 1, v0
461 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
462 ; LMULMAX1-NEXT: vslidedown.vi v10, v10, 4
463 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
464 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
465 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
466 ; LMULMAX1-NEXT: vmerge.vim v10, v9, 1, v0
467 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v9, v10
469 %z = uitofp <8 x i1> %x to <8 x float>
473 define void @si2fp_v2i16_v2f64(ptr %x, ptr %y) {
474 ; CHECK-LABEL: si2fp_v2i16_v2f64:
476 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
477 ; CHECK-NEXT: vle16.v v8, (a0)
478 ; CHECK-NEXT: vsext.vf2 v9, v8
479 ; CHECK-NEXT: vfwcvt.f.x.v v8, v9
480 ; CHECK-NEXT: vse64.v v8, (a1)
482 %a = load <2 x i16>, ptr %x
483 %d = sitofp <2 x i16> %a to <2 x double>
484 store <2 x double> %d, ptr %y
488 define void @ui2fp_v2i16_v2f64(ptr %x, ptr %y) {
489 ; CHECK-LABEL: ui2fp_v2i16_v2f64:
491 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
492 ; CHECK-NEXT: vle16.v v8, (a0)
493 ; CHECK-NEXT: vzext.vf2 v9, v8
494 ; CHECK-NEXT: vfwcvt.f.xu.v v8, v9
495 ; CHECK-NEXT: vse64.v v8, (a1)
497 %a = load <2 x i16>, ptr %x
498 %d = uitofp <2 x i16> %a to <2 x double>
499 store <2 x double> %d, ptr %y
503 define void @si2fp_v8i16_v8f64(ptr %x, ptr %y) {
504 ; LMULMAX8-LABEL: si2fp_v8i16_v8f64:
506 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
507 ; LMULMAX8-NEXT: vle16.v v8, (a0)
508 ; LMULMAX8-NEXT: vsext.vf2 v10, v8
509 ; LMULMAX8-NEXT: vfwcvt.f.x.v v12, v10
510 ; LMULMAX8-NEXT: vse64.v v12, (a1)
513 ; LMULMAX1-LABEL: si2fp_v8i16_v8f64:
515 ; LMULMAX1-NEXT: vsetivli zero, 8, e16, m1, ta, ma
516 ; LMULMAX1-NEXT: vle16.v v8, (a0)
517 ; LMULMAX1-NEXT: vsetivli zero, 2, e16, mf2, ta, ma
518 ; LMULMAX1-NEXT: vslidedown.vi v9, v8, 2
519 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
520 ; LMULMAX1-NEXT: vsext.vf2 v10, v9
521 ; LMULMAX1-NEXT: vfwcvt.f.x.v v9, v10
522 ; LMULMAX1-NEXT: vsext.vf2 v10, v8
523 ; LMULMAX1-NEXT: vfwcvt.f.x.v v11, v10
524 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, m1, ta, ma
525 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 4
526 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
527 ; LMULMAX1-NEXT: vsext.vf2 v10, v8
528 ; LMULMAX1-NEXT: vfwcvt.f.x.v v12, v10
529 ; LMULMAX1-NEXT: vsetivli zero, 2, e16, mf2, ta, ma
530 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 2
531 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
532 ; LMULMAX1-NEXT: vsext.vf2 v10, v8
533 ; LMULMAX1-NEXT: vfwcvt.f.x.v v8, v10
534 ; LMULMAX1-NEXT: addi a0, a1, 48
535 ; LMULMAX1-NEXT: vse64.v v8, (a0)
536 ; LMULMAX1-NEXT: addi a0, a1, 32
537 ; LMULMAX1-NEXT: vse64.v v12, (a0)
538 ; LMULMAX1-NEXT: vse64.v v11, (a1)
539 ; LMULMAX1-NEXT: addi a1, a1, 16
540 ; LMULMAX1-NEXT: vse64.v v9, (a1)
542 %a = load <8 x i16>, ptr %x
543 %d = sitofp <8 x i16> %a to <8 x double>
544 store <8 x double> %d, ptr %y
548 define void @ui2fp_v8i16_v8f64(ptr %x, ptr %y) {
549 ; LMULMAX8-LABEL: ui2fp_v8i16_v8f64:
551 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
552 ; LMULMAX8-NEXT: vle16.v v8, (a0)
553 ; LMULMAX8-NEXT: vzext.vf2 v10, v8
554 ; LMULMAX8-NEXT: vfwcvt.f.xu.v v12, v10
555 ; LMULMAX8-NEXT: vse64.v v12, (a1)
558 ; LMULMAX1-LABEL: ui2fp_v8i16_v8f64:
560 ; LMULMAX1-NEXT: vsetivli zero, 8, e16, m1, ta, ma
561 ; LMULMAX1-NEXT: vle16.v v8, (a0)
562 ; LMULMAX1-NEXT: vsetivli zero, 2, e16, mf2, ta, ma
563 ; LMULMAX1-NEXT: vslidedown.vi v9, v8, 2
564 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
565 ; LMULMAX1-NEXT: vzext.vf2 v10, v9
566 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v9, v10
567 ; LMULMAX1-NEXT: vzext.vf2 v10, v8
568 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v11, v10
569 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, m1, ta, ma
570 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 4
571 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
572 ; LMULMAX1-NEXT: vzext.vf2 v10, v8
573 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v12, v10
574 ; LMULMAX1-NEXT: vsetivli zero, 2, e16, mf2, ta, ma
575 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 2
576 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
577 ; LMULMAX1-NEXT: vzext.vf2 v10, v8
578 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v8, v10
579 ; LMULMAX1-NEXT: addi a0, a1, 48
580 ; LMULMAX1-NEXT: vse64.v v8, (a0)
581 ; LMULMAX1-NEXT: addi a0, a1, 32
582 ; LMULMAX1-NEXT: vse64.v v12, (a0)
583 ; LMULMAX1-NEXT: vse64.v v11, (a1)
584 ; LMULMAX1-NEXT: addi a1, a1, 16
585 ; LMULMAX1-NEXT: vse64.v v9, (a1)
587 %a = load <8 x i16>, ptr %x
588 %d = uitofp <8 x i16> %a to <8 x double>
589 store <8 x double> %d, ptr %y
593 define <8 x double> @si2fp_v8i1_v8f64(<8 x i1> %x) {
594 ; LMULMAX8-LABEL: si2fp_v8i1_v8f64:
596 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
597 ; LMULMAX8-NEXT: vmv.v.i v8, 0
598 ; LMULMAX8-NEXT: vmerge.vim v12, v8, -1, v0
599 ; LMULMAX8-NEXT: vfwcvt.f.x.v v8, v12
602 ; LMULMAX1-LABEL: si2fp_v8i1_v8f64:
604 ; LMULMAX1-NEXT: vmv1r.v v10, v0
605 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
606 ; LMULMAX1-NEXT: vmv.v.i v11, 0
607 ; LMULMAX1-NEXT: vmerge.vim v9, v11, -1, v0
608 ; LMULMAX1-NEXT: vfwcvt.f.x.v v8, v9
609 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
610 ; LMULMAX1-NEXT: vmv.v.i v12, 0
611 ; LMULMAX1-NEXT: vmerge.vim v9, v12, 1, v0
612 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
613 ; LMULMAX1-NEXT: vslidedown.vi v9, v9, 2
614 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
615 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
616 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
617 ; LMULMAX1-NEXT: vmerge.vim v13, v11, -1, v0
618 ; LMULMAX1-NEXT: vfwcvt.f.x.v v9, v13
619 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
620 ; LMULMAX1-NEXT: vmv.v.i v13, 0
621 ; LMULMAX1-NEXT: vmv1r.v v0, v10
622 ; LMULMAX1-NEXT: vmerge.vim v10, v13, 1, v0
623 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
624 ; LMULMAX1-NEXT: vslidedown.vi v10, v10, 4
625 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
626 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
627 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
628 ; LMULMAX1-NEXT: vmerge.vim v13, v11, -1, v0
629 ; LMULMAX1-NEXT: vfwcvt.f.x.v v10, v13
630 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
631 ; LMULMAX1-NEXT: vmerge.vim v12, v12, 1, v0
632 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
633 ; LMULMAX1-NEXT: vslidedown.vi v12, v12, 2
634 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
635 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
636 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
637 ; LMULMAX1-NEXT: vmerge.vim v12, v11, -1, v0
638 ; LMULMAX1-NEXT: vfwcvt.f.x.v v11, v12
640 %z = sitofp <8 x i1> %x to <8 x double>
644 define <8 x double> @ui2fp_v8i1_v8f64(<8 x i1> %x) {
645 ; LMULMAX8-LABEL: ui2fp_v8i1_v8f64:
647 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
648 ; LMULMAX8-NEXT: vmv.v.i v8, 0
649 ; LMULMAX8-NEXT: vmerge.vim v12, v8, 1, v0
650 ; LMULMAX8-NEXT: vfwcvt.f.xu.v v8, v12
653 ; LMULMAX1-LABEL: ui2fp_v8i1_v8f64:
655 ; LMULMAX1-NEXT: vmv1r.v v10, v0
656 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
657 ; LMULMAX1-NEXT: vmv.v.i v11, 0
658 ; LMULMAX1-NEXT: vmerge.vim v9, v11, 1, v0
659 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v8, v9
660 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
661 ; LMULMAX1-NEXT: vmv.v.i v12, 0
662 ; LMULMAX1-NEXT: vmerge.vim v9, v12, 1, v0
663 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
664 ; LMULMAX1-NEXT: vslidedown.vi v9, v9, 2
665 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
666 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
667 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
668 ; LMULMAX1-NEXT: vmerge.vim v13, v11, 1, v0
669 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v9, v13
670 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
671 ; LMULMAX1-NEXT: vmv.v.i v13, 0
672 ; LMULMAX1-NEXT: vmv1r.v v0, v10
673 ; LMULMAX1-NEXT: vmerge.vim v10, v13, 1, v0
674 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
675 ; LMULMAX1-NEXT: vslidedown.vi v10, v10, 4
676 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
677 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
678 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
679 ; LMULMAX1-NEXT: vmerge.vim v13, v11, 1, v0
680 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v10, v13
681 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf4, ta, ma
682 ; LMULMAX1-NEXT: vmerge.vim v12, v12, 1, v0
683 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
684 ; LMULMAX1-NEXT: vslidedown.vi v12, v12, 2
685 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
686 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
687 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
688 ; LMULMAX1-NEXT: vmerge.vim v12, v11, 1, v0
689 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v11, v12
691 %z = uitofp <8 x i1> %x to <8 x double>
695 define void @si2fp_v2i64_v2f16(ptr %x, ptr %y) {
696 ; CHECK-LABEL: si2fp_v2i64_v2f16:
698 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
699 ; CHECK-NEXT: vle64.v v8, (a0)
700 ; CHECK-NEXT: vfncvt.f.x.w v9, v8
701 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
702 ; CHECK-NEXT: vfncvt.f.f.w v8, v9
703 ; CHECK-NEXT: vse16.v v8, (a1)
705 %a = load <2 x i64>, ptr %x
706 %d = sitofp <2 x i64> %a to <2 x half>
707 store <2 x half> %d, ptr %y
711 define void @ui2fp_v2i64_v2f16(ptr %x, ptr %y) {
712 ; CHECK-LABEL: ui2fp_v2i64_v2f16:
714 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
715 ; CHECK-NEXT: vle64.v v8, (a0)
716 ; CHECK-NEXT: vfncvt.f.xu.w v9, v8
717 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
718 ; CHECK-NEXT: vfncvt.f.f.w v8, v9
719 ; CHECK-NEXT: vse16.v v8, (a1)
721 %a = load <2 x i64>, ptr %x
722 %d = uitofp <2 x i64> %a to <2 x half>
723 store <2 x half> %d, ptr %y
727 define <2 x half> @si2fp_v2i1_v2f16(<2 x i1> %x) {
728 ; LMULMAX8ZVFH-LABEL: si2fp_v2i1_v2f16:
729 ; LMULMAX8ZVFH: # %bb.0:
730 ; LMULMAX8ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
731 ; LMULMAX8ZVFH-NEXT: vmv.v.i v8, 0
732 ; LMULMAX8ZVFH-NEXT: vmerge.vim v9, v8, -1, v0
733 ; LMULMAX8ZVFH-NEXT: vfwcvt.f.x.v v8, v9
734 ; LMULMAX8ZVFH-NEXT: ret
736 ; LMULMAX1-LABEL: si2fp_v2i1_v2f16:
738 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
739 ; LMULMAX1-NEXT: vmv.v.i v8, 0
740 ; LMULMAX1-NEXT: vmerge.vim v9, v8, -1, v0
741 ; LMULMAX1-NEXT: vfwcvt.f.x.v v8, v9
744 ; LMULMAX8ZVFHMIN-LABEL: si2fp_v2i1_v2f16:
745 ; LMULMAX8ZVFHMIN: # %bb.0:
746 ; LMULMAX8ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
747 ; LMULMAX8ZVFHMIN-NEXT: vmv.v.i v8, 0
748 ; LMULMAX8ZVFHMIN-NEXT: vmerge.vim v8, v8, -1, v0
749 ; LMULMAX8ZVFHMIN-NEXT: vfwcvt.f.x.v v9, v8
750 ; LMULMAX8ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
751 ; LMULMAX8ZVFHMIN-NEXT: ret
752 %z = sitofp <2 x i1> %x to <2 x half>
756 define <2 x half> @ui2fp_v2i1_v2f16(<2 x i1> %x) {
757 ; LMULMAX8ZVFH-LABEL: ui2fp_v2i1_v2f16:
758 ; LMULMAX8ZVFH: # %bb.0:
759 ; LMULMAX8ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
760 ; LMULMAX8ZVFH-NEXT: vmv.v.i v8, 0
761 ; LMULMAX8ZVFH-NEXT: vmerge.vim v9, v8, 1, v0
762 ; LMULMAX8ZVFH-NEXT: vfwcvt.f.xu.v v8, v9
763 ; LMULMAX8ZVFH-NEXT: ret
765 ; LMULMAX1-LABEL: ui2fp_v2i1_v2f16:
767 ; LMULMAX1-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
768 ; LMULMAX1-NEXT: vmv.v.i v8, 0
769 ; LMULMAX1-NEXT: vmerge.vim v9, v8, 1, v0
770 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v8, v9
773 ; LMULMAX8ZVFHMIN-LABEL: ui2fp_v2i1_v2f16:
774 ; LMULMAX8ZVFHMIN: # %bb.0:
775 ; LMULMAX8ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
776 ; LMULMAX8ZVFHMIN-NEXT: vmv.v.i v8, 0
777 ; LMULMAX8ZVFHMIN-NEXT: vmerge.vim v8, v8, 1, v0
778 ; LMULMAX8ZVFHMIN-NEXT: vfwcvt.f.xu.v v9, v8
779 ; LMULMAX8ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
780 ; LMULMAX8ZVFHMIN-NEXT: ret
781 %z = uitofp <2 x i1> %x to <2 x half>
785 define void @si2fp_v8i64_v8f16(ptr %x, ptr %y) {
786 ; LMULMAX8-LABEL: si2fp_v8i64_v8f16:
788 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
789 ; LMULMAX8-NEXT: vle64.v v8, (a0)
790 ; LMULMAX8-NEXT: vfncvt.f.x.w v12, v8
791 ; LMULMAX8-NEXT: vsetvli zero, zero, e16, m1, ta, ma
792 ; LMULMAX8-NEXT: vfncvt.f.f.w v8, v12
793 ; LMULMAX8-NEXT: vse16.v v8, (a1)
796 ; LMULMAX1-LABEL: si2fp_v8i64_v8f16:
798 ; LMULMAX1-NEXT: addi a2, a0, 48
799 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
800 ; LMULMAX1-NEXT: vle64.v v8, (a2)
801 ; LMULMAX1-NEXT: addi a2, a0, 32
802 ; LMULMAX1-NEXT: vle64.v v9, (a0)
803 ; LMULMAX1-NEXT: vle64.v v10, (a2)
804 ; LMULMAX1-NEXT: addi a0, a0, 16
805 ; LMULMAX1-NEXT: vle64.v v11, (a0)
806 ; LMULMAX1-NEXT: vfncvt.f.x.w v12, v9
807 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
808 ; LMULMAX1-NEXT: vfncvt.f.f.w v9, v12
809 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
810 ; LMULMAX1-NEXT: vfncvt.f.x.w v12, v11
811 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
812 ; LMULMAX1-NEXT: vfncvt.f.f.w v11, v12
813 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, m1, tu, ma
814 ; LMULMAX1-NEXT: vslideup.vi v9, v11, 2
815 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
816 ; LMULMAX1-NEXT: vfncvt.f.x.w v11, v10
817 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
818 ; LMULMAX1-NEXT: vfncvt.f.f.w v10, v11
819 ; LMULMAX1-NEXT: vsetivli zero, 6, e16, m1, tu, ma
820 ; LMULMAX1-NEXT: vslideup.vi v9, v10, 4
821 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
822 ; LMULMAX1-NEXT: vfncvt.f.x.w v10, v8
823 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
824 ; LMULMAX1-NEXT: vfncvt.f.f.w v8, v10
825 ; LMULMAX1-NEXT: vsetivli zero, 8, e16, m1, ta, ma
826 ; LMULMAX1-NEXT: vslideup.vi v9, v8, 6
827 ; LMULMAX1-NEXT: vse16.v v9, (a1)
829 %a = load <8 x i64>, ptr %x
830 %d = sitofp <8 x i64> %a to <8 x half>
831 store <8 x half> %d, ptr %y
835 define void @ui2fp_v8i64_v8f16(ptr %x, ptr %y) {
836 ; LMULMAX8-LABEL: ui2fp_v8i64_v8f16:
838 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
839 ; LMULMAX8-NEXT: vle64.v v8, (a0)
840 ; LMULMAX8-NEXT: vfncvt.f.xu.w v12, v8
841 ; LMULMAX8-NEXT: vsetvli zero, zero, e16, m1, ta, ma
842 ; LMULMAX8-NEXT: vfncvt.f.f.w v8, v12
843 ; LMULMAX8-NEXT: vse16.v v8, (a1)
846 ; LMULMAX1-LABEL: ui2fp_v8i64_v8f16:
848 ; LMULMAX1-NEXT: addi a2, a0, 48
849 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
850 ; LMULMAX1-NEXT: vle64.v v8, (a2)
851 ; LMULMAX1-NEXT: addi a2, a0, 32
852 ; LMULMAX1-NEXT: vle64.v v9, (a0)
853 ; LMULMAX1-NEXT: vle64.v v10, (a2)
854 ; LMULMAX1-NEXT: addi a0, a0, 16
855 ; LMULMAX1-NEXT: vle64.v v11, (a0)
856 ; LMULMAX1-NEXT: vfncvt.f.xu.w v12, v9
857 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
858 ; LMULMAX1-NEXT: vfncvt.f.f.w v9, v12
859 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
860 ; LMULMAX1-NEXT: vfncvt.f.xu.w v12, v11
861 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
862 ; LMULMAX1-NEXT: vfncvt.f.f.w v11, v12
863 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, m1, tu, ma
864 ; LMULMAX1-NEXT: vslideup.vi v9, v11, 2
865 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
866 ; LMULMAX1-NEXT: vfncvt.f.xu.w v11, v10
867 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
868 ; LMULMAX1-NEXT: vfncvt.f.f.w v10, v11
869 ; LMULMAX1-NEXT: vsetivli zero, 6, e16, m1, tu, ma
870 ; LMULMAX1-NEXT: vslideup.vi v9, v10, 4
871 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
872 ; LMULMAX1-NEXT: vfncvt.f.xu.w v10, v8
873 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
874 ; LMULMAX1-NEXT: vfncvt.f.f.w v8, v10
875 ; LMULMAX1-NEXT: vsetivli zero, 8, e16, m1, ta, ma
876 ; LMULMAX1-NEXT: vslideup.vi v9, v8, 6
877 ; LMULMAX1-NEXT: vse16.v v9, (a1)
879 %a = load <8 x i64>, ptr %x
880 %d = uitofp <8 x i64> %a to <8 x half>
881 store <8 x half> %d, ptr %y
885 define <8 x half> @si2fp_v8i1_v8f16(<8 x i1> %x) {
886 ; LMULMAX8ZVFH-LABEL: si2fp_v8i1_v8f16:
887 ; LMULMAX8ZVFH: # %bb.0:
888 ; LMULMAX8ZVFH-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
889 ; LMULMAX8ZVFH-NEXT: vmv.v.i v8, 0
890 ; LMULMAX8ZVFH-NEXT: vmerge.vim v9, v8, -1, v0
891 ; LMULMAX8ZVFH-NEXT: vfwcvt.f.x.v v8, v9
892 ; LMULMAX8ZVFH-NEXT: ret
894 ; LMULMAX1-LABEL: si2fp_v8i1_v8f16:
896 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
897 ; LMULMAX1-NEXT: vmv.v.i v8, 0
898 ; LMULMAX1-NEXT: vmerge.vim v9, v8, -1, v0
899 ; LMULMAX1-NEXT: vfwcvt.f.x.v v8, v9
902 ; LMULMAX8ZVFHMIN-LABEL: si2fp_v8i1_v8f16:
903 ; LMULMAX8ZVFHMIN: # %bb.0:
904 ; LMULMAX8ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
905 ; LMULMAX8ZVFHMIN-NEXT: vmv.v.i v8, 0
906 ; LMULMAX8ZVFHMIN-NEXT: vmerge.vim v8, v8, -1, v0
907 ; LMULMAX8ZVFHMIN-NEXT: vfwcvt.f.x.v v10, v8
908 ; LMULMAX8ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
909 ; LMULMAX8ZVFHMIN-NEXT: ret
910 %z = sitofp <8 x i1> %x to <8 x half>
914 define <8 x half> @ui2fp_v8i1_v8f16(<8 x i1> %x) {
915 ; LMULMAX8ZVFH-LABEL: ui2fp_v8i1_v8f16:
916 ; LMULMAX8ZVFH: # %bb.0:
917 ; LMULMAX8ZVFH-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
918 ; LMULMAX8ZVFH-NEXT: vmv.v.i v8, 0
919 ; LMULMAX8ZVFH-NEXT: vmerge.vim v9, v8, 1, v0
920 ; LMULMAX8ZVFH-NEXT: vfwcvt.f.xu.v v8, v9
921 ; LMULMAX8ZVFH-NEXT: ret
923 ; LMULMAX1-LABEL: ui2fp_v8i1_v8f16:
925 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
926 ; LMULMAX1-NEXT: vmv.v.i v8, 0
927 ; LMULMAX1-NEXT: vmerge.vim v9, v8, 1, v0
928 ; LMULMAX1-NEXT: vfwcvt.f.xu.v v8, v9
931 ; LMULMAX8ZVFHMIN-LABEL: ui2fp_v8i1_v8f16:
932 ; LMULMAX8ZVFHMIN: # %bb.0:
933 ; LMULMAX8ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
934 ; LMULMAX8ZVFHMIN-NEXT: vmv.v.i v8, 0
935 ; LMULMAX8ZVFHMIN-NEXT: vmerge.vim v8, v8, 1, v0
936 ; LMULMAX8ZVFHMIN-NEXT: vfwcvt.f.xu.v v10, v8
937 ; LMULMAX8ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
938 ; LMULMAX8ZVFHMIN-NEXT: ret
939 %z = uitofp <8 x i1> %x to <8 x half>