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,LMULMAX8RV32,LMULMAX8RV32ZVFH
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,LMULMAX8RV64,LMULMAX8RV64ZVFH
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,LMULMAX1RV32ZVFH
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,LMULMAX1RV64ZVFH
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,LMULMAX8RV32,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,LMULMAX8RV64,LMULMAX8RV64ZVFHMIN
8 ; RUN: llc -mtriple=riscv32 -target-abi=ilp32d -mattr=+v,+zfh,+zvfhmin,+f,+d -riscv-v-fixed-length-vector-lmul-max=1 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX1,LMULMAX1RV32,LMULMAX1RV32ZVFHMIN
9 ; RUN: llc -mtriple=riscv64 -target-abi=lp64d -mattr=+v,+zfh,+zvfhmin,+f,+d -riscv-v-fixed-length-vector-lmul-max=1 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,LMULMAX1,LMULMAX1RV64,LMULMAX1RV64ZVFHMIN
11 define void @fp2si_v2f32_v2i32(ptr %x, ptr %y) {
12 ; CHECK-LABEL: fp2si_v2f32_v2i32:
14 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
15 ; CHECK-NEXT: vle32.v v8, (a0)
16 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
17 ; CHECK-NEXT: vse32.v v8, (a1)
19 %a = load <2 x float>, ptr %x
20 %d = fptosi <2 x float> %a to <2 x i32>
21 store <2 x i32> %d, ptr %y
25 define void @fp2ui_v2f32_v2i32(ptr %x, ptr %y) {
26 ; CHECK-LABEL: fp2ui_v2f32_v2i32:
28 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
29 ; CHECK-NEXT: vle32.v v8, (a0)
30 ; CHECK-NEXT: vfcvt.rtz.xu.f.v v8, v8
31 ; CHECK-NEXT: vse32.v v8, (a1)
33 %a = load <2 x float>, ptr %x
34 %d = fptoui <2 x float> %a to <2 x i32>
35 store <2 x i32> %d, ptr %y
39 define <2 x i1> @fp2si_v2f32_v2i1(<2 x float> %x) {
40 ; CHECK-LABEL: fp2si_v2f32_v2i1:
42 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
43 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
44 ; CHECK-NEXT: vand.vi v8, v9, 1
45 ; CHECK-NEXT: vmsne.vi v0, v8, 0
47 %z = fptosi <2 x float> %x to <2 x i1>
51 define <2 x i15> @fp2si_v2f32_v2i15(<2 x float> %x) {
52 ; CHECK-LABEL: fp2si_v2f32_v2i15:
54 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
55 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
56 ; CHECK-NEXT: vmv1r.v v8, v9
58 %z = fptosi <2 x float> %x to <2 x i15>
62 define <2 x i15> @fp2ui_v2f32_v2i15(<2 x float> %x) {
63 ; CHECK-LABEL: fp2ui_v2f32_v2i15:
65 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
66 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
67 ; CHECK-NEXT: vmv1r.v v8, v9
69 %z = fptoui <2 x float> %x to <2 x i15>
73 define <2 x i1> @fp2ui_v2f32_v2i1(<2 x float> %x) {
74 ; CHECK-LABEL: fp2ui_v2f32_v2i1:
76 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
77 ; CHECK-NEXT: vfncvt.rtz.xu.f.w v9, v8
78 ; CHECK-NEXT: vand.vi v8, v9, 1
79 ; CHECK-NEXT: vmsne.vi v0, v8, 0
81 %z = fptoui <2 x float> %x to <2 x i1>
85 define void @fp2si_v3f32_v3i32(ptr %x, ptr %y) {
86 ; CHECK-LABEL: fp2si_v3f32_v3i32:
88 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
89 ; CHECK-NEXT: vle32.v v8, (a0)
90 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
91 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
92 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
93 ; CHECK-NEXT: vse32.v v8, (a1)
95 %a = load <3 x float>, ptr %x
96 %d = fptosi <3 x float> %a to <3 x i32>
97 store <3 x i32> %d, ptr %y
101 define void @fp2ui_v3f32_v3i32(ptr %x, ptr %y) {
102 ; CHECK-LABEL: fp2ui_v3f32_v3i32:
104 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
105 ; CHECK-NEXT: vle32.v v8, (a0)
106 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
107 ; CHECK-NEXT: vfcvt.rtz.xu.f.v v8, v8
108 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, ta, ma
109 ; CHECK-NEXT: vse32.v v8, (a1)
111 %a = load <3 x float>, ptr %x
112 %d = fptoui <3 x float> %a to <3 x i32>
113 store <3 x i32> %d, ptr %y
117 define <3 x i1> @fp2si_v3f32_v3i1(<3 x float> %x) {
118 ; CHECK-LABEL: fp2si_v3f32_v3i1:
120 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
121 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
122 ; CHECK-NEXT: vand.vi v8, v9, 1
123 ; CHECK-NEXT: vmsne.vi v0, v8, 0
125 %z = fptosi <3 x float> %x to <3 x i1>
129 ; FIXME: This is expanded when they could be widened + promoted
130 define <3 x i15> @fp2si_v3f32_v3i15(<3 x float> %x) {
131 ; LMULMAX8RV32-LABEL: fp2si_v3f32_v3i15:
132 ; LMULMAX8RV32: # %bb.0:
133 ; LMULMAX8RV32-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
134 ; LMULMAX8RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
135 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v9, 2
136 ; LMULMAX8RV32-NEXT: vmv.x.s a1, v8
137 ; LMULMAX8RV32-NEXT: slli a2, a1, 17
138 ; LMULMAX8RV32-NEXT: srli a2, a2, 19
139 ; LMULMAX8RV32-NEXT: sh a2, 4(a0)
140 ; LMULMAX8RV32-NEXT: vmv.x.s a2, v9
141 ; LMULMAX8RV32-NEXT: lui a3, 8
142 ; LMULMAX8RV32-NEXT: addi a3, a3, -1
143 ; LMULMAX8RV32-NEXT: and a2, a2, a3
144 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v9, 1
145 ; LMULMAX8RV32-NEXT: vmv.x.s a4, v8
146 ; LMULMAX8RV32-NEXT: and a3, a4, a3
147 ; LMULMAX8RV32-NEXT: slli a3, a3, 15
148 ; LMULMAX8RV32-NEXT: slli a1, a1, 30
149 ; LMULMAX8RV32-NEXT: or a1, a2, a1
150 ; LMULMAX8RV32-NEXT: or a1, a1, a3
151 ; LMULMAX8RV32-NEXT: sw a1, 0(a0)
152 ; LMULMAX8RV32-NEXT: ret
154 ; LMULMAX8RV64-LABEL: fp2si_v3f32_v3i15:
155 ; LMULMAX8RV64: # %bb.0:
156 ; LMULMAX8RV64-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
157 ; LMULMAX8RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
158 ; LMULMAX8RV64-NEXT: vmv.x.s a1, v9
159 ; LMULMAX8RV64-NEXT: lui a2, 8
160 ; LMULMAX8RV64-NEXT: addiw a2, a2, -1
161 ; LMULMAX8RV64-NEXT: and a1, a1, a2
162 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v9, 1
163 ; LMULMAX8RV64-NEXT: vmv.x.s a3, v8
164 ; LMULMAX8RV64-NEXT: and a2, a3, a2
165 ; LMULMAX8RV64-NEXT: slli a2, a2, 15
166 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v9, 2
167 ; LMULMAX8RV64-NEXT: vmv.x.s a3, v8
168 ; LMULMAX8RV64-NEXT: slli a3, a3, 30
169 ; LMULMAX8RV64-NEXT: or a1, a1, a3
170 ; LMULMAX8RV64-NEXT: or a1, a1, a2
171 ; LMULMAX8RV64-NEXT: sw a1, 0(a0)
172 ; LMULMAX8RV64-NEXT: slli a1, a1, 19
173 ; LMULMAX8RV64-NEXT: srli a1, a1, 51
174 ; LMULMAX8RV64-NEXT: sh a1, 4(a0)
175 ; LMULMAX8RV64-NEXT: ret
177 ; LMULMAX1RV32-LABEL: fp2si_v3f32_v3i15:
178 ; LMULMAX1RV32: # %bb.0:
179 ; LMULMAX1RV32-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
180 ; LMULMAX1RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
181 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v9, 2
182 ; LMULMAX1RV32-NEXT: vmv.x.s a1, v8
183 ; LMULMAX1RV32-NEXT: slli a2, a1, 17
184 ; LMULMAX1RV32-NEXT: srli a2, a2, 19
185 ; LMULMAX1RV32-NEXT: sh a2, 4(a0)
186 ; LMULMAX1RV32-NEXT: vmv.x.s a2, v9
187 ; LMULMAX1RV32-NEXT: lui a3, 8
188 ; LMULMAX1RV32-NEXT: addi a3, a3, -1
189 ; LMULMAX1RV32-NEXT: and a2, a2, a3
190 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v9, 1
191 ; LMULMAX1RV32-NEXT: vmv.x.s a4, v8
192 ; LMULMAX1RV32-NEXT: and a3, a4, a3
193 ; LMULMAX1RV32-NEXT: slli a3, a3, 15
194 ; LMULMAX1RV32-NEXT: slli a1, a1, 30
195 ; LMULMAX1RV32-NEXT: or a1, a2, a1
196 ; LMULMAX1RV32-NEXT: or a1, a1, a3
197 ; LMULMAX1RV32-NEXT: sw a1, 0(a0)
198 ; LMULMAX1RV32-NEXT: ret
200 ; LMULMAX1RV64-LABEL: fp2si_v3f32_v3i15:
201 ; LMULMAX1RV64: # %bb.0:
202 ; LMULMAX1RV64-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
203 ; LMULMAX1RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
204 ; LMULMAX1RV64-NEXT: vmv.x.s a1, v9
205 ; LMULMAX1RV64-NEXT: lui a2, 8
206 ; LMULMAX1RV64-NEXT: addiw a2, a2, -1
207 ; LMULMAX1RV64-NEXT: and a1, a1, a2
208 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v9, 1
209 ; LMULMAX1RV64-NEXT: vmv.x.s a3, v8
210 ; LMULMAX1RV64-NEXT: and a2, a3, a2
211 ; LMULMAX1RV64-NEXT: slli a2, a2, 15
212 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v9, 2
213 ; LMULMAX1RV64-NEXT: vmv.x.s a3, v8
214 ; LMULMAX1RV64-NEXT: slli a3, a3, 30
215 ; LMULMAX1RV64-NEXT: or a1, a1, a3
216 ; LMULMAX1RV64-NEXT: or a1, a1, a2
217 ; LMULMAX1RV64-NEXT: sw a1, 0(a0)
218 ; LMULMAX1RV64-NEXT: slli a1, a1, 19
219 ; LMULMAX1RV64-NEXT: srli a1, a1, 51
220 ; LMULMAX1RV64-NEXT: sh a1, 4(a0)
221 ; LMULMAX1RV64-NEXT: ret
222 %z = fptosi <3 x float> %x to <3 x i15>
226 ; FIXME: This is expanded when they could be widened + promoted
227 define <3 x i15> @fp2ui_v3f32_v3i15(<3 x float> %x) {
228 ; LMULMAX8RV32-LABEL: fp2ui_v3f32_v3i15:
229 ; LMULMAX8RV32: # %bb.0:
230 ; LMULMAX8RV32-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
231 ; LMULMAX8RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
232 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v9, 2
233 ; LMULMAX8RV32-NEXT: vmv.x.s a1, v8
234 ; LMULMAX8RV32-NEXT: slli a2, a1, 17
235 ; LMULMAX8RV32-NEXT: srli a2, a2, 19
236 ; LMULMAX8RV32-NEXT: sh a2, 4(a0)
237 ; LMULMAX8RV32-NEXT: vmv.x.s a2, v9
238 ; LMULMAX8RV32-NEXT: lui a3, 16
239 ; LMULMAX8RV32-NEXT: addi a3, a3, -1
240 ; LMULMAX8RV32-NEXT: and a2, a2, a3
241 ; LMULMAX8RV32-NEXT: vslidedown.vi v8, v9, 1
242 ; LMULMAX8RV32-NEXT: vmv.x.s a4, v8
243 ; LMULMAX8RV32-NEXT: and a3, a4, a3
244 ; LMULMAX8RV32-NEXT: slli a3, a3, 15
245 ; LMULMAX8RV32-NEXT: slli a1, a1, 30
246 ; LMULMAX8RV32-NEXT: or a1, a2, a1
247 ; LMULMAX8RV32-NEXT: or a1, a1, a3
248 ; LMULMAX8RV32-NEXT: sw a1, 0(a0)
249 ; LMULMAX8RV32-NEXT: ret
251 ; LMULMAX8RV64-LABEL: fp2ui_v3f32_v3i15:
252 ; LMULMAX8RV64: # %bb.0:
253 ; LMULMAX8RV64-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
254 ; LMULMAX8RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
255 ; LMULMAX8RV64-NEXT: vmv.x.s a1, v9
256 ; LMULMAX8RV64-NEXT: lui a2, 16
257 ; LMULMAX8RV64-NEXT: addiw a2, a2, -1
258 ; LMULMAX8RV64-NEXT: and a1, a1, a2
259 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v9, 1
260 ; LMULMAX8RV64-NEXT: vmv.x.s a3, v8
261 ; LMULMAX8RV64-NEXT: and a2, a3, a2
262 ; LMULMAX8RV64-NEXT: slli a2, a2, 15
263 ; LMULMAX8RV64-NEXT: vslidedown.vi v8, v9, 2
264 ; LMULMAX8RV64-NEXT: vmv.x.s a3, v8
265 ; LMULMAX8RV64-NEXT: slli a3, a3, 30
266 ; LMULMAX8RV64-NEXT: or a1, a1, a3
267 ; LMULMAX8RV64-NEXT: or a1, a1, a2
268 ; LMULMAX8RV64-NEXT: sw a1, 0(a0)
269 ; LMULMAX8RV64-NEXT: slli a1, a1, 19
270 ; LMULMAX8RV64-NEXT: srli a1, a1, 51
271 ; LMULMAX8RV64-NEXT: sh a1, 4(a0)
272 ; LMULMAX8RV64-NEXT: ret
274 ; LMULMAX1RV32-LABEL: fp2ui_v3f32_v3i15:
275 ; LMULMAX1RV32: # %bb.0:
276 ; LMULMAX1RV32-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
277 ; LMULMAX1RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
278 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v9, 2
279 ; LMULMAX1RV32-NEXT: vmv.x.s a1, v8
280 ; LMULMAX1RV32-NEXT: slli a2, a1, 17
281 ; LMULMAX1RV32-NEXT: srli a2, a2, 19
282 ; LMULMAX1RV32-NEXT: sh a2, 4(a0)
283 ; LMULMAX1RV32-NEXT: vmv.x.s a2, v9
284 ; LMULMAX1RV32-NEXT: lui a3, 16
285 ; LMULMAX1RV32-NEXT: addi a3, a3, -1
286 ; LMULMAX1RV32-NEXT: and a2, a2, a3
287 ; LMULMAX1RV32-NEXT: vslidedown.vi v8, v9, 1
288 ; LMULMAX1RV32-NEXT: vmv.x.s a4, v8
289 ; LMULMAX1RV32-NEXT: and a3, a4, a3
290 ; LMULMAX1RV32-NEXT: slli a3, a3, 15
291 ; LMULMAX1RV32-NEXT: slli a1, a1, 30
292 ; LMULMAX1RV32-NEXT: or a1, a2, a1
293 ; LMULMAX1RV32-NEXT: or a1, a1, a3
294 ; LMULMAX1RV32-NEXT: sw a1, 0(a0)
295 ; LMULMAX1RV32-NEXT: ret
297 ; LMULMAX1RV64-LABEL: fp2ui_v3f32_v3i15:
298 ; LMULMAX1RV64: # %bb.0:
299 ; LMULMAX1RV64-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
300 ; LMULMAX1RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
301 ; LMULMAX1RV64-NEXT: vmv.x.s a1, v9
302 ; LMULMAX1RV64-NEXT: lui a2, 16
303 ; LMULMAX1RV64-NEXT: addiw a2, a2, -1
304 ; LMULMAX1RV64-NEXT: and a1, a1, a2
305 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v9, 1
306 ; LMULMAX1RV64-NEXT: vmv.x.s a3, v8
307 ; LMULMAX1RV64-NEXT: and a2, a3, a2
308 ; LMULMAX1RV64-NEXT: slli a2, a2, 15
309 ; LMULMAX1RV64-NEXT: vslidedown.vi v8, v9, 2
310 ; LMULMAX1RV64-NEXT: vmv.x.s a3, v8
311 ; LMULMAX1RV64-NEXT: slli a3, a3, 30
312 ; LMULMAX1RV64-NEXT: or a1, a1, a3
313 ; LMULMAX1RV64-NEXT: or a1, a1, a2
314 ; LMULMAX1RV64-NEXT: sw a1, 0(a0)
315 ; LMULMAX1RV64-NEXT: slli a1, a1, 19
316 ; LMULMAX1RV64-NEXT: srli a1, a1, 51
317 ; LMULMAX1RV64-NEXT: sh a1, 4(a0)
318 ; LMULMAX1RV64-NEXT: ret
319 %z = fptoui <3 x float> %x to <3 x i15>
323 define <3 x i1> @fp2ui_v3f32_v3i1(<3 x float> %x) {
324 ; CHECK-LABEL: fp2ui_v3f32_v3i1:
326 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
327 ; CHECK-NEXT: vfncvt.rtz.xu.f.w v9, v8
328 ; CHECK-NEXT: vand.vi v8, v9, 1
329 ; CHECK-NEXT: vmsne.vi v0, v8, 0
331 %z = fptoui <3 x float> %x to <3 x i1>
335 define void @fp2si_v8f32_v8i32(ptr %x, ptr %y) {
336 ; LMULMAX8-LABEL: fp2si_v8f32_v8i32:
338 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
339 ; LMULMAX8-NEXT: vle32.v v8, (a0)
340 ; LMULMAX8-NEXT: vfcvt.rtz.x.f.v v8, v8
341 ; LMULMAX8-NEXT: vse32.v v8, (a1)
344 ; LMULMAX1-LABEL: fp2si_v8f32_v8i32:
346 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
347 ; LMULMAX1-NEXT: addi a2, a0, 16
348 ; LMULMAX1-NEXT: vle32.v v8, (a2)
349 ; LMULMAX1-NEXT: vle32.v v9, (a0)
350 ; LMULMAX1-NEXT: vfcvt.rtz.x.f.v v8, v8
351 ; LMULMAX1-NEXT: vfcvt.rtz.x.f.v v9, v9
352 ; LMULMAX1-NEXT: vse32.v v9, (a1)
353 ; LMULMAX1-NEXT: addi a1, a1, 16
354 ; LMULMAX1-NEXT: vse32.v v8, (a1)
356 %a = load <8 x float>, ptr %x
357 %d = fptosi <8 x float> %a to <8 x i32>
358 store <8 x i32> %d, ptr %y
362 define void @fp2ui_v8f32_v8i32(ptr %x, ptr %y) {
363 ; LMULMAX8-LABEL: fp2ui_v8f32_v8i32:
365 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
366 ; LMULMAX8-NEXT: vle32.v v8, (a0)
367 ; LMULMAX8-NEXT: vfcvt.rtz.xu.f.v v8, v8
368 ; LMULMAX8-NEXT: vse32.v v8, (a1)
371 ; LMULMAX1-LABEL: fp2ui_v8f32_v8i32:
373 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
374 ; LMULMAX1-NEXT: addi a2, a0, 16
375 ; LMULMAX1-NEXT: vle32.v v8, (a2)
376 ; LMULMAX1-NEXT: vle32.v v9, (a0)
377 ; LMULMAX1-NEXT: vfcvt.rtz.xu.f.v v8, v8
378 ; LMULMAX1-NEXT: vfcvt.rtz.xu.f.v v9, v9
379 ; LMULMAX1-NEXT: vse32.v v9, (a1)
380 ; LMULMAX1-NEXT: addi a1, a1, 16
381 ; LMULMAX1-NEXT: vse32.v v8, (a1)
383 %a = load <8 x float>, ptr %x
384 %d = fptoui <8 x float> %a to <8 x i32>
385 store <8 x i32> %d, ptr %y
389 define <8 x i1> @fp2si_v8f32_v8i1(<8 x float> %x) {
390 ; LMULMAX8-LABEL: fp2si_v8f32_v8i1:
392 ; LMULMAX8-NEXT: vsetivli zero, 8, e16, m1, ta, ma
393 ; LMULMAX8-NEXT: vfncvt.rtz.x.f.w v10, v8
394 ; LMULMAX8-NEXT: vand.vi v8, v10, 1
395 ; LMULMAX8-NEXT: vmsne.vi v0, v8, 0
398 ; LMULMAX1-LABEL: fp2si_v8f32_v8i1:
400 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
401 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v10, v8
402 ; LMULMAX1-NEXT: vand.vi v8, v10, 1
403 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
404 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
405 ; LMULMAX1-NEXT: vmv.v.i v8, 0
406 ; LMULMAX1-NEXT: vmerge.vim v8, v8, 1, v0
407 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
408 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v10, v9
409 ; LMULMAX1-NEXT: vand.vi v9, v10, 1
410 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
411 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
412 ; LMULMAX1-NEXT: vmv.v.i v9, 0
413 ; LMULMAX1-NEXT: vmerge.vim v9, v9, 1, v0
414 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
415 ; LMULMAX1-NEXT: vslideup.vi v8, v9, 4
416 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
418 %z = fptosi <8 x float> %x to <8 x i1>
422 define <8 x i1> @fp2ui_v8f32_v8i1(<8 x float> %x) {
423 ; LMULMAX8-LABEL: fp2ui_v8f32_v8i1:
425 ; LMULMAX8-NEXT: vsetivli zero, 8, e16, m1, ta, ma
426 ; LMULMAX8-NEXT: vfncvt.rtz.xu.f.w v10, v8
427 ; LMULMAX8-NEXT: vand.vi v8, v10, 1
428 ; LMULMAX8-NEXT: vmsne.vi v0, v8, 0
431 ; LMULMAX1-LABEL: fp2ui_v8f32_v8i1:
433 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
434 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v10, v8
435 ; LMULMAX1-NEXT: vand.vi v8, v10, 1
436 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
437 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
438 ; LMULMAX1-NEXT: vmv.v.i v8, 0
439 ; LMULMAX1-NEXT: vmerge.vim v8, v8, 1, v0
440 ; LMULMAX1-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
441 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v10, v9
442 ; LMULMAX1-NEXT: vand.vi v9, v10, 1
443 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
444 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
445 ; LMULMAX1-NEXT: vmv.v.i v9, 0
446 ; LMULMAX1-NEXT: vmerge.vim v9, v9, 1, v0
447 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
448 ; LMULMAX1-NEXT: vslideup.vi v8, v9, 4
449 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
451 %z = fptoui <8 x float> %x to <8 x i1>
455 define void @fp2si_v2f32_v2i64(ptr %x, ptr %y) {
456 ; CHECK-LABEL: fp2si_v2f32_v2i64:
458 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
459 ; CHECK-NEXT: vle32.v v8, (a0)
460 ; CHECK-NEXT: vfwcvt.rtz.x.f.v v9, v8
461 ; CHECK-NEXT: vse64.v v9, (a1)
463 %a = load <2 x float>, ptr %x
464 %d = fptosi <2 x float> %a to <2 x i64>
465 store <2 x i64> %d, ptr %y
469 define void @fp2ui_v2f32_v2i64(ptr %x, ptr %y) {
470 ; CHECK-LABEL: fp2ui_v2f32_v2i64:
472 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
473 ; CHECK-NEXT: vle32.v v8, (a0)
474 ; CHECK-NEXT: vfwcvt.rtz.xu.f.v v9, v8
475 ; CHECK-NEXT: vse64.v v9, (a1)
477 %a = load <2 x float>, ptr %x
478 %d = fptoui <2 x float> %a to <2 x i64>
479 store <2 x i64> %d, ptr %y
483 define void @fp2si_v8f32_v8i64(ptr %x, ptr %y) {
484 ; LMULMAX8-LABEL: fp2si_v8f32_v8i64:
486 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
487 ; LMULMAX8-NEXT: vle32.v v8, (a0)
488 ; LMULMAX8-NEXT: vfwcvt.rtz.x.f.v v12, v8
489 ; LMULMAX8-NEXT: vse64.v v12, (a1)
492 ; LMULMAX1-LABEL: fp2si_v8f32_v8i64:
494 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
495 ; LMULMAX1-NEXT: addi a2, a0, 16
496 ; LMULMAX1-NEXT: vle32.v v8, (a2)
497 ; LMULMAX1-NEXT: vle32.v v9, (a0)
498 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
499 ; LMULMAX1-NEXT: vfwcvt.rtz.x.f.v v10, v8
500 ; LMULMAX1-NEXT: vfwcvt.rtz.x.f.v v11, v9
501 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, m1, ta, ma
502 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 2
503 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
504 ; LMULMAX1-NEXT: vfwcvt.rtz.x.f.v v12, v8
505 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, m1, ta, ma
506 ; LMULMAX1-NEXT: vslidedown.vi v8, v9, 2
507 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
508 ; LMULMAX1-NEXT: vfwcvt.rtz.x.f.v v9, v8
509 ; LMULMAX1-NEXT: addi a0, a1, 16
510 ; LMULMAX1-NEXT: vse64.v v9, (a0)
511 ; LMULMAX1-NEXT: addi a0, a1, 48
512 ; LMULMAX1-NEXT: vse64.v v12, (a0)
513 ; LMULMAX1-NEXT: vse64.v v11, (a1)
514 ; LMULMAX1-NEXT: addi a0, a1, 32
515 ; LMULMAX1-NEXT: vse64.v v10, (a0)
517 %a = load <8 x float>, ptr %x
518 %d = fptosi <8 x float> %a to <8 x i64>
519 store <8 x i64> %d, ptr %y
523 define void @fp2ui_v8f32_v8i64(ptr %x, ptr %y) {
524 ; LMULMAX8-LABEL: fp2ui_v8f32_v8i64:
526 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
527 ; LMULMAX8-NEXT: vle32.v v8, (a0)
528 ; LMULMAX8-NEXT: vfwcvt.rtz.xu.f.v v12, v8
529 ; LMULMAX8-NEXT: vse64.v v12, (a1)
532 ; LMULMAX1-LABEL: fp2ui_v8f32_v8i64:
534 ; LMULMAX1-NEXT: vsetivli zero, 4, e32, m1, ta, ma
535 ; LMULMAX1-NEXT: addi a2, a0, 16
536 ; LMULMAX1-NEXT: vle32.v v8, (a2)
537 ; LMULMAX1-NEXT: vle32.v v9, (a0)
538 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
539 ; LMULMAX1-NEXT: vfwcvt.rtz.xu.f.v v10, v8
540 ; LMULMAX1-NEXT: vfwcvt.rtz.xu.f.v v11, v9
541 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, m1, ta, ma
542 ; LMULMAX1-NEXT: vslidedown.vi v8, v8, 2
543 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
544 ; LMULMAX1-NEXT: vfwcvt.rtz.xu.f.v v12, v8
545 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, m1, ta, ma
546 ; LMULMAX1-NEXT: vslidedown.vi v8, v9, 2
547 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
548 ; LMULMAX1-NEXT: vfwcvt.rtz.xu.f.v v9, v8
549 ; LMULMAX1-NEXT: addi a0, a1, 16
550 ; LMULMAX1-NEXT: vse64.v v9, (a0)
551 ; LMULMAX1-NEXT: addi a0, a1, 48
552 ; LMULMAX1-NEXT: vse64.v v12, (a0)
553 ; LMULMAX1-NEXT: vse64.v v11, (a1)
554 ; LMULMAX1-NEXT: addi a0, a1, 32
555 ; LMULMAX1-NEXT: vse64.v v10, (a0)
557 %a = load <8 x float>, ptr %x
558 %d = fptoui <8 x float> %a to <8 x i64>
559 store <8 x i64> %d, ptr %y
563 define void @fp2si_v2f16_v2i64(ptr %x, ptr %y) {
564 ; CHECK-LABEL: fp2si_v2f16_v2i64:
566 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
567 ; CHECK-NEXT: vle16.v v8, (a0)
568 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
569 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
570 ; CHECK-NEXT: vfwcvt.rtz.x.f.v v8, v9
571 ; CHECK-NEXT: vse64.v v8, (a1)
573 %a = load <2 x half>, ptr %x
574 %d = fptosi <2 x half> %a to <2 x i64>
575 store <2 x i64> %d, ptr %y
579 define void @fp2ui_v2f16_v2i64(ptr %x, ptr %y) {
580 ; CHECK-LABEL: fp2ui_v2f16_v2i64:
582 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
583 ; CHECK-NEXT: vle16.v v8, (a0)
584 ; CHECK-NEXT: vfwcvt.f.f.v v9, v8
585 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
586 ; CHECK-NEXT: vfwcvt.rtz.xu.f.v v8, v9
587 ; CHECK-NEXT: vse64.v v8, (a1)
589 %a = load <2 x half>, ptr %x
590 %d = fptoui <2 x half> %a to <2 x i64>
591 store <2 x i64> %d, ptr %y
595 define <2 x i1> @fp2si_v2f16_v2i1(<2 x half> %x) {
596 ; LMULMAX8RV32ZVFH-LABEL: fp2si_v2f16_v2i1:
597 ; LMULMAX8RV32ZVFH: # %bb.0:
598 ; LMULMAX8RV32ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
599 ; LMULMAX8RV32ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8
600 ; LMULMAX8RV32ZVFH-NEXT: vand.vi v8, v9, 1
601 ; LMULMAX8RV32ZVFH-NEXT: vmsne.vi v0, v8, 0
602 ; LMULMAX8RV32ZVFH-NEXT: ret
604 ; LMULMAX8RV64ZVFH-LABEL: fp2si_v2f16_v2i1:
605 ; LMULMAX8RV64ZVFH: # %bb.0:
606 ; LMULMAX8RV64ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
607 ; LMULMAX8RV64ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8
608 ; LMULMAX8RV64ZVFH-NEXT: vand.vi v8, v9, 1
609 ; LMULMAX8RV64ZVFH-NEXT: vmsne.vi v0, v8, 0
610 ; LMULMAX8RV64ZVFH-NEXT: ret
612 ; LMULMAX1RV32ZVFH-LABEL: fp2si_v2f16_v2i1:
613 ; LMULMAX1RV32ZVFH: # %bb.0:
614 ; LMULMAX1RV32ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
615 ; LMULMAX1RV32ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8
616 ; LMULMAX1RV32ZVFH-NEXT: vand.vi v8, v9, 1
617 ; LMULMAX1RV32ZVFH-NEXT: vmsne.vi v0, v8, 0
618 ; LMULMAX1RV32ZVFH-NEXT: ret
620 ; LMULMAX1RV64ZVFH-LABEL: fp2si_v2f16_v2i1:
621 ; LMULMAX1RV64ZVFH: # %bb.0:
622 ; LMULMAX1RV64ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
623 ; LMULMAX1RV64ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8
624 ; LMULMAX1RV64ZVFH-NEXT: vand.vi v8, v9, 1
625 ; LMULMAX1RV64ZVFH-NEXT: vmsne.vi v0, v8, 0
626 ; LMULMAX1RV64ZVFH-NEXT: ret
628 ; LMULMAX8RV32ZVFHMIN-LABEL: fp2si_v2f16_v2i1:
629 ; LMULMAX8RV32ZVFHMIN: # %bb.0:
630 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
631 ; LMULMAX8RV32ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
632 ; LMULMAX8RV32ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
633 ; LMULMAX8RV32ZVFHMIN-NEXT: vand.vi v8, v8, 1
634 ; LMULMAX8RV32ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
635 ; LMULMAX8RV32ZVFHMIN-NEXT: ret
637 ; LMULMAX8RV64ZVFHMIN-LABEL: fp2si_v2f16_v2i1:
638 ; LMULMAX8RV64ZVFHMIN: # %bb.0:
639 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
640 ; LMULMAX8RV64ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
641 ; LMULMAX8RV64ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
642 ; LMULMAX8RV64ZVFHMIN-NEXT: vand.vi v8, v8, 1
643 ; LMULMAX8RV64ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
644 ; LMULMAX8RV64ZVFHMIN-NEXT: ret
646 ; LMULMAX1RV32ZVFHMIN-LABEL: fp2si_v2f16_v2i1:
647 ; LMULMAX1RV32ZVFHMIN: # %bb.0:
648 ; LMULMAX1RV32ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
649 ; LMULMAX1RV32ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
650 ; LMULMAX1RV32ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
651 ; LMULMAX1RV32ZVFHMIN-NEXT: vand.vi v8, v8, 1
652 ; LMULMAX1RV32ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
653 ; LMULMAX1RV32ZVFHMIN-NEXT: ret
655 ; LMULMAX1RV64ZVFHMIN-LABEL: fp2si_v2f16_v2i1:
656 ; LMULMAX1RV64ZVFHMIN: # %bb.0:
657 ; LMULMAX1RV64ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
658 ; LMULMAX1RV64ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
659 ; LMULMAX1RV64ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
660 ; LMULMAX1RV64ZVFHMIN-NEXT: vand.vi v8, v8, 1
661 ; LMULMAX1RV64ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
662 ; LMULMAX1RV64ZVFHMIN-NEXT: ret
663 %z = fptosi <2 x half> %x to <2 x i1>
667 define <2 x i1> @fp2ui_v2f16_v2i1(<2 x half> %x) {
668 ; LMULMAX8RV32ZVFH-LABEL: fp2ui_v2f16_v2i1:
669 ; LMULMAX8RV32ZVFH: # %bb.0:
670 ; LMULMAX8RV32ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
671 ; LMULMAX8RV32ZVFH-NEXT: vfncvt.rtz.xu.f.w v9, v8
672 ; LMULMAX8RV32ZVFH-NEXT: vand.vi v8, v9, 1
673 ; LMULMAX8RV32ZVFH-NEXT: vmsne.vi v0, v8, 0
674 ; LMULMAX8RV32ZVFH-NEXT: ret
676 ; LMULMAX8RV64ZVFH-LABEL: fp2ui_v2f16_v2i1:
677 ; LMULMAX8RV64ZVFH: # %bb.0:
678 ; LMULMAX8RV64ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
679 ; LMULMAX8RV64ZVFH-NEXT: vfncvt.rtz.xu.f.w v9, v8
680 ; LMULMAX8RV64ZVFH-NEXT: vand.vi v8, v9, 1
681 ; LMULMAX8RV64ZVFH-NEXT: vmsne.vi v0, v8, 0
682 ; LMULMAX8RV64ZVFH-NEXT: ret
684 ; LMULMAX1RV32ZVFH-LABEL: fp2ui_v2f16_v2i1:
685 ; LMULMAX1RV32ZVFH: # %bb.0:
686 ; LMULMAX1RV32ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
687 ; LMULMAX1RV32ZVFH-NEXT: vfncvt.rtz.xu.f.w v9, v8
688 ; LMULMAX1RV32ZVFH-NEXT: vand.vi v8, v9, 1
689 ; LMULMAX1RV32ZVFH-NEXT: vmsne.vi v0, v8, 0
690 ; LMULMAX1RV32ZVFH-NEXT: ret
692 ; LMULMAX1RV64ZVFH-LABEL: fp2ui_v2f16_v2i1:
693 ; LMULMAX1RV64ZVFH: # %bb.0:
694 ; LMULMAX1RV64ZVFH-NEXT: vsetivli zero, 2, e8, mf8, ta, ma
695 ; LMULMAX1RV64ZVFH-NEXT: vfncvt.rtz.xu.f.w v9, v8
696 ; LMULMAX1RV64ZVFH-NEXT: vand.vi v8, v9, 1
697 ; LMULMAX1RV64ZVFH-NEXT: vmsne.vi v0, v8, 0
698 ; LMULMAX1RV64ZVFH-NEXT: ret
700 ; LMULMAX8RV32ZVFHMIN-LABEL: fp2ui_v2f16_v2i1:
701 ; LMULMAX8RV32ZVFHMIN: # %bb.0:
702 ; LMULMAX8RV32ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
703 ; LMULMAX8RV32ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
704 ; LMULMAX8RV32ZVFHMIN-NEXT: vfncvt.rtz.xu.f.w v8, v9
705 ; LMULMAX8RV32ZVFHMIN-NEXT: vand.vi v8, v8, 1
706 ; LMULMAX8RV32ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
707 ; LMULMAX8RV32ZVFHMIN-NEXT: ret
709 ; LMULMAX8RV64ZVFHMIN-LABEL: fp2ui_v2f16_v2i1:
710 ; LMULMAX8RV64ZVFHMIN: # %bb.0:
711 ; LMULMAX8RV64ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
712 ; LMULMAX8RV64ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
713 ; LMULMAX8RV64ZVFHMIN-NEXT: vfncvt.rtz.xu.f.w v8, v9
714 ; LMULMAX8RV64ZVFHMIN-NEXT: vand.vi v8, v8, 1
715 ; LMULMAX8RV64ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
716 ; LMULMAX8RV64ZVFHMIN-NEXT: ret
718 ; LMULMAX1RV32ZVFHMIN-LABEL: fp2ui_v2f16_v2i1:
719 ; LMULMAX1RV32ZVFHMIN: # %bb.0:
720 ; LMULMAX1RV32ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
721 ; LMULMAX1RV32ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
722 ; LMULMAX1RV32ZVFHMIN-NEXT: vfncvt.rtz.xu.f.w v8, v9
723 ; LMULMAX1RV32ZVFHMIN-NEXT: vand.vi v8, v8, 1
724 ; LMULMAX1RV32ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
725 ; LMULMAX1RV32ZVFHMIN-NEXT: ret
727 ; LMULMAX1RV64ZVFHMIN-LABEL: fp2ui_v2f16_v2i1:
728 ; LMULMAX1RV64ZVFHMIN: # %bb.0:
729 ; LMULMAX1RV64ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
730 ; LMULMAX1RV64ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
731 ; LMULMAX1RV64ZVFHMIN-NEXT: vfncvt.rtz.xu.f.w v8, v9
732 ; LMULMAX1RV64ZVFHMIN-NEXT: vand.vi v8, v8, 1
733 ; LMULMAX1RV64ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
734 ; LMULMAX1RV64ZVFHMIN-NEXT: ret
735 %z = fptoui <2 x half> %x to <2 x i1>
739 define void @fp2si_v2f64_v2i8(ptr %x, ptr %y) {
740 ; CHECK-LABEL: fp2si_v2f64_v2i8:
742 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
743 ; CHECK-NEXT: vle64.v v8, (a0)
744 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
745 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
746 ; CHECK-NEXT: vnsrl.wi v8, v9, 0
747 ; CHECK-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
748 ; CHECK-NEXT: vnsrl.wi v8, v8, 0
749 ; CHECK-NEXT: vse8.v v8, (a1)
751 %a = load <2 x double>, ptr %x
752 %d = fptosi <2 x double> %a to <2 x i8>
753 store <2 x i8> %d, ptr %y
757 define void @fp2ui_v2f64_v2i8(ptr %x, ptr %y) {
758 ; CHECK-LABEL: fp2ui_v2f64_v2i8:
760 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
761 ; CHECK-NEXT: vle64.v v8, (a0)
762 ; CHECK-NEXT: vfncvt.rtz.xu.f.w v9, v8
763 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
764 ; CHECK-NEXT: vnsrl.wi v8, v9, 0
765 ; CHECK-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
766 ; CHECK-NEXT: vnsrl.wi v8, v8, 0
767 ; CHECK-NEXT: vse8.v v8, (a1)
769 %a = load <2 x double>, ptr %x
770 %d = fptoui <2 x double> %a to <2 x i8>
771 store <2 x i8> %d, ptr %y
775 define <2 x i1> @fp2si_v2f64_v2i1(<2 x double> %x) {
776 ; CHECK-LABEL: fp2si_v2f64_v2i1:
778 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
779 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
780 ; CHECK-NEXT: vand.vi v8, v9, 1
781 ; CHECK-NEXT: vmsne.vi v0, v8, 0
783 %z = fptosi <2 x double> %x to <2 x i1>
787 define <2 x i1> @fp2ui_v2f64_v2i1(<2 x double> %x) {
788 ; CHECK-LABEL: fp2ui_v2f64_v2i1:
790 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
791 ; CHECK-NEXT: vfncvt.rtz.xu.f.w v9, v8
792 ; CHECK-NEXT: vand.vi v8, v9, 1
793 ; CHECK-NEXT: vmsne.vi v0, v8, 0
795 %z = fptoui <2 x double> %x to <2 x i1>
799 define void @fp2si_v8f64_v8i8(ptr %x, ptr %y) {
800 ; LMULMAX8-LABEL: fp2si_v8f64_v8i8:
802 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
803 ; LMULMAX8-NEXT: vle64.v v8, (a0)
804 ; LMULMAX8-NEXT: vfncvt.rtz.x.f.w v12, v8
805 ; LMULMAX8-NEXT: vsetvli zero, zero, e16, m1, ta, ma
806 ; LMULMAX8-NEXT: vnsrl.wi v8, v12, 0
807 ; LMULMAX8-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
808 ; LMULMAX8-NEXT: vnsrl.wi v8, v8, 0
809 ; LMULMAX8-NEXT: vse8.v v8, (a1)
812 ; LMULMAX1-LABEL: fp2si_v8f64_v8i8:
814 ; LMULMAX1-NEXT: addi a2, a0, 48
815 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
816 ; LMULMAX1-NEXT: vle64.v v8, (a2)
817 ; LMULMAX1-NEXT: addi a2, a0, 32
818 ; LMULMAX1-NEXT: vle64.v v9, (a0)
819 ; LMULMAX1-NEXT: vle64.v v10, (a2)
820 ; LMULMAX1-NEXT: addi a0, a0, 16
821 ; LMULMAX1-NEXT: vle64.v v11, (a0)
822 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v12, v9
823 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
824 ; LMULMAX1-NEXT: vnsrl.wi v9, v12, 0
825 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
826 ; LMULMAX1-NEXT: vnsrl.wi v9, v9, 0
827 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
828 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v12, v11
829 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
830 ; LMULMAX1-NEXT: vnsrl.wi v11, v12, 0
831 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
832 ; LMULMAX1-NEXT: vnsrl.wi v11, v11, 0
833 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, tu, ma
834 ; LMULMAX1-NEXT: vslideup.vi v9, v11, 2
835 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
836 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v11, v10
837 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
838 ; LMULMAX1-NEXT: vnsrl.wi v10, v11, 0
839 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
840 ; LMULMAX1-NEXT: vnsrl.wi v10, v10, 0
841 ; LMULMAX1-NEXT: vsetivli zero, 6, e8, mf2, tu, ma
842 ; LMULMAX1-NEXT: vslideup.vi v9, v10, 4
843 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
844 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v10, v8
845 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
846 ; LMULMAX1-NEXT: vnsrl.wi v8, v10, 0
847 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
848 ; LMULMAX1-NEXT: vnsrl.wi v8, v8, 0
849 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
850 ; LMULMAX1-NEXT: vslideup.vi v9, v8, 6
851 ; LMULMAX1-NEXT: vse8.v v9, (a1)
853 %a = load <8 x double>, ptr %x
854 %d = fptosi <8 x double> %a to <8 x i8>
855 store <8 x i8> %d, ptr %y
859 define void @fp2ui_v8f64_v8i8(ptr %x, ptr %y) {
860 ; LMULMAX8-LABEL: fp2ui_v8f64_v8i8:
862 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
863 ; LMULMAX8-NEXT: vle64.v v8, (a0)
864 ; LMULMAX8-NEXT: vfncvt.rtz.xu.f.w v12, v8
865 ; LMULMAX8-NEXT: vsetvli zero, zero, e16, m1, ta, ma
866 ; LMULMAX8-NEXT: vnsrl.wi v8, v12, 0
867 ; LMULMAX8-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
868 ; LMULMAX8-NEXT: vnsrl.wi v8, v8, 0
869 ; LMULMAX8-NEXT: vse8.v v8, (a1)
872 ; LMULMAX1-LABEL: fp2ui_v8f64_v8i8:
874 ; LMULMAX1-NEXT: addi a2, a0, 48
875 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
876 ; LMULMAX1-NEXT: vle64.v v8, (a2)
877 ; LMULMAX1-NEXT: addi a2, a0, 32
878 ; LMULMAX1-NEXT: vle64.v v9, (a0)
879 ; LMULMAX1-NEXT: vle64.v v10, (a2)
880 ; LMULMAX1-NEXT: addi a0, a0, 16
881 ; LMULMAX1-NEXT: vle64.v v11, (a0)
882 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v12, v9
883 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
884 ; LMULMAX1-NEXT: vnsrl.wi v9, v12, 0
885 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
886 ; LMULMAX1-NEXT: vnsrl.wi v9, v9, 0
887 ; LMULMAX1-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
888 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v12, v11
889 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
890 ; LMULMAX1-NEXT: vnsrl.wi v11, v12, 0
891 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
892 ; LMULMAX1-NEXT: vnsrl.wi v11, v11, 0
893 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, tu, ma
894 ; LMULMAX1-NEXT: vslideup.vi v9, v11, 2
895 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
896 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v11, v10
897 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
898 ; LMULMAX1-NEXT: vnsrl.wi v10, v11, 0
899 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
900 ; LMULMAX1-NEXT: vnsrl.wi v10, v10, 0
901 ; LMULMAX1-NEXT: vsetivli zero, 6, e8, mf2, tu, ma
902 ; LMULMAX1-NEXT: vslideup.vi v9, v10, 4
903 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
904 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v10, v8
905 ; LMULMAX1-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
906 ; LMULMAX1-NEXT: vnsrl.wi v8, v10, 0
907 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
908 ; LMULMAX1-NEXT: vnsrl.wi v8, v8, 0
909 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
910 ; LMULMAX1-NEXT: vslideup.vi v9, v8, 6
911 ; LMULMAX1-NEXT: vse8.v v9, (a1)
913 %a = load <8 x double>, ptr %x
914 %d = fptoui <8 x double> %a to <8 x i8>
915 store <8 x i8> %d, ptr %y
919 define <8 x i1> @fp2si_v8f64_v8i1(<8 x double> %x) {
920 ; LMULMAX8-LABEL: fp2si_v8f64_v8i1:
922 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
923 ; LMULMAX8-NEXT: vfncvt.rtz.x.f.w v12, v8
924 ; LMULMAX8-NEXT: vand.vi v8, v12, 1
925 ; LMULMAX8-NEXT: vmsne.vi v0, v8, 0
928 ; LMULMAX1-LABEL: fp2si_v8f64_v8i1:
930 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
931 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v12, v8
932 ; LMULMAX1-NEXT: vand.vi v8, v12, 1
933 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
934 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
935 ; LMULMAX1-NEXT: vmv.v.i v8, 0
936 ; LMULMAX1-NEXT: vmerge.vim v12, v8, 1, v0
937 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
938 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v13, v9
939 ; LMULMAX1-NEXT: vand.vi v9, v13, 1
940 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
941 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
942 ; LMULMAX1-NEXT: vmv.v.i v9, 0
943 ; LMULMAX1-NEXT: vmerge.vim v13, v9, 1, v0
944 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, tu, ma
945 ; LMULMAX1-NEXT: vslideup.vi v12, v13, 2
946 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
947 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
948 ; LMULMAX1-NEXT: vmerge.vim v12, v8, 1, v0
949 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
950 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v13, v10
951 ; LMULMAX1-NEXT: vand.vi v10, v13, 1
952 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
953 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
954 ; LMULMAX1-NEXT: vmerge.vim v10, v9, 1, v0
955 ; LMULMAX1-NEXT: vsetivli zero, 6, e8, mf2, tu, ma
956 ; LMULMAX1-NEXT: vslideup.vi v12, v10, 4
957 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
958 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
959 ; LMULMAX1-NEXT: vmerge.vim v8, v8, 1, v0
960 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
961 ; LMULMAX1-NEXT: vfncvt.rtz.x.f.w v10, v11
962 ; LMULMAX1-NEXT: vand.vi v10, v10, 1
963 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
964 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
965 ; LMULMAX1-NEXT: vmerge.vim v9, v9, 1, v0
966 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
967 ; LMULMAX1-NEXT: vslideup.vi v8, v9, 6
968 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
970 %z = fptosi <8 x double> %x to <8 x i1>
974 define <8 x i1> @fp2ui_v8f64_v8i1(<8 x double> %x) {
975 ; LMULMAX8-LABEL: fp2ui_v8f64_v8i1:
977 ; LMULMAX8-NEXT: vsetivli zero, 8, e32, m2, ta, ma
978 ; LMULMAX8-NEXT: vfncvt.rtz.xu.f.w v12, v8
979 ; LMULMAX8-NEXT: vand.vi v8, v12, 1
980 ; LMULMAX8-NEXT: vmsne.vi v0, v8, 0
983 ; LMULMAX1-LABEL: fp2ui_v8f64_v8i1:
985 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
986 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v12, v8
987 ; LMULMAX1-NEXT: vand.vi v8, v12, 1
988 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
989 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
990 ; LMULMAX1-NEXT: vmv.v.i v8, 0
991 ; LMULMAX1-NEXT: vmerge.vim v12, v8, 1, v0
992 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
993 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v13, v9
994 ; LMULMAX1-NEXT: vand.vi v9, v13, 1
995 ; LMULMAX1-NEXT: vmsne.vi v0, v9, 0
996 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
997 ; LMULMAX1-NEXT: vmv.v.i v9, 0
998 ; LMULMAX1-NEXT: vmerge.vim v13, v9, 1, v0
999 ; LMULMAX1-NEXT: vsetivli zero, 4, e8, mf2, tu, ma
1000 ; LMULMAX1-NEXT: vslideup.vi v12, v13, 2
1001 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
1002 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
1003 ; LMULMAX1-NEXT: vmerge.vim v12, v8, 1, v0
1004 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
1005 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v13, v10
1006 ; LMULMAX1-NEXT: vand.vi v10, v13, 1
1007 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
1008 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1009 ; LMULMAX1-NEXT: vmerge.vim v10, v9, 1, v0
1010 ; LMULMAX1-NEXT: vsetivli zero, 6, e8, mf2, tu, ma
1011 ; LMULMAX1-NEXT: vslideup.vi v12, v10, 4
1012 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
1013 ; LMULMAX1-NEXT: vmsne.vi v0, v12, 0
1014 ; LMULMAX1-NEXT: vmerge.vim v8, v8, 1, v0
1015 ; LMULMAX1-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
1016 ; LMULMAX1-NEXT: vfncvt.rtz.xu.f.w v10, v11
1017 ; LMULMAX1-NEXT: vand.vi v10, v10, 1
1018 ; LMULMAX1-NEXT: vmsne.vi v0, v10, 0
1019 ; LMULMAX1-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1020 ; LMULMAX1-NEXT: vmerge.vim v9, v9, 1, v0
1021 ; LMULMAX1-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
1022 ; LMULMAX1-NEXT: vslideup.vi v8, v9, 6
1023 ; LMULMAX1-NEXT: vmsne.vi v0, v8, 0
1024 ; LMULMAX1-NEXT: ret
1025 %z = fptoui <8 x double> %x to <8 x i1>