1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v,+f,+d \
3 ; RUN: -target-abi=ilp32d -verify-machineinstrs | FileCheck %s --check-prefix=RV32
4 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv64 -mattr=+v,+f,+d \
5 ; RUN: -target-abi=lp64d -verify-machineinstrs | FileCheck %s --check-prefix=RV64-i32
6 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+f,+d \
7 ; RUN: -target-abi=lp64d -verify-machineinstrs | FileCheck %s --check-prefix=RV64-i64
9 define <1 x iXLen> @lrint_v1f32(<1 x float> %x) {
10 ; RV32-LABEL: lrint_v1f32:
12 ; RV32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
13 ; RV32-NEXT: vfmv.f.s fa5, v8
14 ; RV32-NEXT: fcvt.w.s a0, fa5
15 ; RV32-NEXT: vmv.s.x v8, a0
18 ; RV64-i32-LABEL: lrint_v1f32:
20 ; RV64-i32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
21 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
22 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
23 ; RV64-i32-NEXT: vmv.s.x v8, a0
26 ; RV64-i64-LABEL: lrint_v1f32:
28 ; RV64-i64-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
29 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
30 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
31 ; RV64-i64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
32 ; RV64-i64-NEXT: vmv.s.x v8, a0
34 %a = call <1 x iXLen> @llvm.lrint.v1iXLen.v1f32(<1 x float> %x)
37 declare <1 x iXLen> @llvm.lrint.v1iXLen.v1f32(<1 x float>)
39 define <2 x iXLen> @lrint_v2f32(<2 x float> %x) {
40 ; RV32-LABEL: lrint_v2f32:
42 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
43 ; RV32-NEXT: vslidedown.vi v9, v8, 1
44 ; RV32-NEXT: vfmv.f.s fa5, v9
45 ; RV32-NEXT: fcvt.w.s a0, fa5
46 ; RV32-NEXT: vfmv.f.s fa5, v8
47 ; RV32-NEXT: fcvt.w.s a1, fa5
48 ; RV32-NEXT: vmv.v.x v8, a1
49 ; RV32-NEXT: vslide1down.vx v8, v8, a0
52 ; RV64-i32-LABEL: lrint_v2f32:
54 ; RV64-i32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
55 ; RV64-i32-NEXT: vslidedown.vi v9, v8, 1
56 ; RV64-i32-NEXT: vfmv.f.s fa5, v9
57 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
58 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
59 ; RV64-i32-NEXT: fcvt.l.s a1, fa5
60 ; RV64-i32-NEXT: vmv.v.x v8, a1
61 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a0
64 ; RV64-i64-LABEL: lrint_v2f32:
66 ; RV64-i64-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
67 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 1
68 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
69 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
70 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
71 ; RV64-i64-NEXT: fcvt.l.s a1, fa5
72 ; RV64-i64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
73 ; RV64-i64-NEXT: vmv.v.x v8, a1
74 ; RV64-i64-NEXT: vslide1down.vx v8, v8, a0
76 %a = call <2 x iXLen> @llvm.lrint.v2iXLen.v2f32(<2 x float> %x)
79 declare <2 x iXLen> @llvm.lrint.v2iXLen.v2f32(<2 x float>)
81 define <3 x iXLen> @lrint_v3f32(<3 x float> %x) {
82 ; RV32-LABEL: lrint_v3f32:
84 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
85 ; RV32-NEXT: vslidedown.vi v9, v8, 1
86 ; RV32-NEXT: vfmv.f.s fa5, v9
87 ; RV32-NEXT: fcvt.w.s a0, fa5
88 ; RV32-NEXT: vfmv.f.s fa5, v8
89 ; RV32-NEXT: fcvt.w.s a1, fa5
90 ; RV32-NEXT: vmv.v.x v9, a1
91 ; RV32-NEXT: vslide1down.vx v9, v9, a0
92 ; RV32-NEXT: vslidedown.vi v10, v8, 2
93 ; RV32-NEXT: vfmv.f.s fa5, v10
94 ; RV32-NEXT: fcvt.w.s a0, fa5
95 ; RV32-NEXT: vslide1down.vx v9, v9, a0
96 ; RV32-NEXT: vslidedown.vi v8, v8, 3
97 ; RV32-NEXT: vfmv.f.s fa5, v8
98 ; RV32-NEXT: fcvt.w.s a0, fa5
99 ; RV32-NEXT: vslide1down.vx v8, v9, a0
102 ; RV64-i32-LABEL: lrint_v3f32:
104 ; RV64-i32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
105 ; RV64-i32-NEXT: vslidedown.vi v9, v8, 1
106 ; RV64-i32-NEXT: vfmv.f.s fa5, v9
107 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
108 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
109 ; RV64-i32-NEXT: fcvt.l.s a1, fa5
110 ; RV64-i32-NEXT: vmv.v.x v9, a1
111 ; RV64-i32-NEXT: vslide1down.vx v9, v9, a0
112 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 2
113 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
114 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
115 ; RV64-i32-NEXT: vslide1down.vx v9, v9, a0
116 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 3
117 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
118 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
119 ; RV64-i32-NEXT: vslide1down.vx v8, v9, a0
122 ; RV64-i64-LABEL: lrint_v3f32:
124 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
125 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 1
126 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
127 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
128 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
129 ; RV64-i64-NEXT: fcvt.l.s a1, fa5
130 ; RV64-i64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
131 ; RV64-i64-NEXT: vmv.v.x v10, a1
132 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
133 ; RV64-i64-NEXT: vsetvli zero, zero, e32, m1, ta, ma
134 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 2
135 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
136 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
137 ; RV64-i64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
138 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
139 ; RV64-i64-NEXT: vsetvli zero, zero, e32, m1, ta, ma
140 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 3
141 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
142 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
143 ; RV64-i64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
144 ; RV64-i64-NEXT: vslide1down.vx v8, v10, a0
146 %a = call <3 x iXLen> @llvm.lrint.v3iXLen.v3f32(<3 x float> %x)
149 declare <3 x iXLen> @llvm.lrint.v3iXLen.v3f32(<3 x float>)
151 define <4 x iXLen> @lrint_v4f32(<4 x float> %x) {
152 ; RV32-LABEL: lrint_v4f32:
154 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
155 ; RV32-NEXT: vslidedown.vi v9, v8, 1
156 ; RV32-NEXT: vfmv.f.s fa5, v9
157 ; RV32-NEXT: fcvt.w.s a0, fa5
158 ; RV32-NEXT: vfmv.f.s fa5, v8
159 ; RV32-NEXT: fcvt.w.s a1, fa5
160 ; RV32-NEXT: vmv.v.x v9, a1
161 ; RV32-NEXT: vslide1down.vx v9, v9, a0
162 ; RV32-NEXT: vslidedown.vi v10, v8, 2
163 ; RV32-NEXT: vfmv.f.s fa5, v10
164 ; RV32-NEXT: fcvt.w.s a0, fa5
165 ; RV32-NEXT: vslide1down.vx v9, v9, a0
166 ; RV32-NEXT: vslidedown.vi v8, v8, 3
167 ; RV32-NEXT: vfmv.f.s fa5, v8
168 ; RV32-NEXT: fcvt.w.s a0, fa5
169 ; RV32-NEXT: vslide1down.vx v8, v9, a0
172 ; RV64-i32-LABEL: lrint_v4f32:
174 ; RV64-i32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
175 ; RV64-i32-NEXT: vslidedown.vi v9, v8, 1
176 ; RV64-i32-NEXT: vfmv.f.s fa5, v9
177 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
178 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
179 ; RV64-i32-NEXT: fcvt.l.s a1, fa5
180 ; RV64-i32-NEXT: vmv.v.x v9, a1
181 ; RV64-i32-NEXT: vslide1down.vx v9, v9, a0
182 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 2
183 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
184 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
185 ; RV64-i32-NEXT: vslide1down.vx v9, v9, a0
186 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 3
187 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
188 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
189 ; RV64-i32-NEXT: vslide1down.vx v8, v9, a0
192 ; RV64-i64-LABEL: lrint_v4f32:
194 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
195 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 1
196 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
197 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
198 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
199 ; RV64-i64-NEXT: fcvt.l.s a1, fa5
200 ; RV64-i64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
201 ; RV64-i64-NEXT: vmv.v.x v10, a1
202 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
203 ; RV64-i64-NEXT: vsetvli zero, zero, e32, m1, ta, ma
204 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 2
205 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
206 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
207 ; RV64-i64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
208 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
209 ; RV64-i64-NEXT: vsetvli zero, zero, e32, m1, ta, ma
210 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 3
211 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
212 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
213 ; RV64-i64-NEXT: vsetvli zero, zero, e64, m2, ta, ma
214 ; RV64-i64-NEXT: vslide1down.vx v8, v10, a0
216 %a = call <4 x iXLen> @llvm.lrint.v4iXLen.v4f32(<4 x float> %x)
219 declare <4 x iXLen> @llvm.lrint.v4iXLen.v4f32(<4 x float>)
221 define <8 x iXLen> @lrint_v8f32(<8 x float> %x) {
222 ; RV32-LABEL: lrint_v8f32:
224 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
225 ; RV32-NEXT: vslidedown.vi v10, v8, 1
226 ; RV32-NEXT: vfmv.f.s fa5, v10
227 ; RV32-NEXT: fcvt.w.s a0, fa5
228 ; RV32-NEXT: vfmv.f.s fa5, v8
229 ; RV32-NEXT: fcvt.w.s a1, fa5
230 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
231 ; RV32-NEXT: vmv.v.x v10, a1
232 ; RV32-NEXT: vslide1down.vx v10, v10, a0
233 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
234 ; RV32-NEXT: vslidedown.vi v12, v8, 2
235 ; RV32-NEXT: vfmv.f.s fa5, v12
236 ; RV32-NEXT: fcvt.w.s a0, fa5
237 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
238 ; RV32-NEXT: vslide1down.vx v10, v10, a0
239 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
240 ; RV32-NEXT: vslidedown.vi v12, v8, 3
241 ; RV32-NEXT: vfmv.f.s fa5, v12
242 ; RV32-NEXT: fcvt.w.s a0, fa5
243 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
244 ; RV32-NEXT: vslide1down.vx v10, v10, a0
245 ; RV32-NEXT: vslidedown.vi v12, v8, 4
246 ; RV32-NEXT: vfmv.f.s fa5, v12
247 ; RV32-NEXT: fcvt.w.s a0, fa5
248 ; RV32-NEXT: vslide1down.vx v10, v10, a0
249 ; RV32-NEXT: vslidedown.vi v12, v8, 5
250 ; RV32-NEXT: vfmv.f.s fa5, v12
251 ; RV32-NEXT: fcvt.w.s a0, fa5
252 ; RV32-NEXT: vslide1down.vx v10, v10, a0
253 ; RV32-NEXT: vslidedown.vi v12, v8, 6
254 ; RV32-NEXT: vfmv.f.s fa5, v12
255 ; RV32-NEXT: fcvt.w.s a0, fa5
256 ; RV32-NEXT: vslide1down.vx v10, v10, a0
257 ; RV32-NEXT: vslidedown.vi v8, v8, 7
258 ; RV32-NEXT: vfmv.f.s fa5, v8
259 ; RV32-NEXT: fcvt.w.s a0, fa5
260 ; RV32-NEXT: vslide1down.vx v8, v10, a0
263 ; RV64-i32-LABEL: lrint_v8f32:
265 ; RV64-i32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
266 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 1
267 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
268 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
269 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
270 ; RV64-i32-NEXT: fcvt.l.s a1, fa5
271 ; RV64-i32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
272 ; RV64-i32-NEXT: vmv.v.x v10, a1
273 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
274 ; RV64-i32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
275 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 2
276 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
277 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
278 ; RV64-i32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
279 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
280 ; RV64-i32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
281 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 3
282 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
283 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
284 ; RV64-i32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
285 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
286 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 4
287 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
288 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
289 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
290 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 5
291 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
292 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
293 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
294 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 6
295 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
296 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
297 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
298 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 7
299 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
300 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
301 ; RV64-i32-NEXT: vslide1down.vx v8, v10, a0
304 ; RV64-i64-LABEL: lrint_v8f32:
306 ; RV64-i64-NEXT: addi sp, sp, -128
307 ; RV64-i64-NEXT: .cfi_def_cfa_offset 128
308 ; RV64-i64-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
309 ; RV64-i64-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
310 ; RV64-i64-NEXT: .cfi_offset ra, -8
311 ; RV64-i64-NEXT: .cfi_offset s0, -16
312 ; RV64-i64-NEXT: addi s0, sp, 128
313 ; RV64-i64-NEXT: .cfi_def_cfa s0, 0
314 ; RV64-i64-NEXT: andi sp, sp, -64
315 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m2, ta, ma
316 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
317 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
318 ; RV64-i64-NEXT: sd a0, 0(sp)
319 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 7
320 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
321 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
322 ; RV64-i64-NEXT: sd a0, 56(sp)
323 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 6
324 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
325 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
326 ; RV64-i64-NEXT: sd a0, 48(sp)
327 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 5
328 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
329 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
330 ; RV64-i64-NEXT: sd a0, 40(sp)
331 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 4
332 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
333 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
334 ; RV64-i64-NEXT: sd a0, 32(sp)
335 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
336 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 3
337 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
338 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
339 ; RV64-i64-NEXT: sd a0, 24(sp)
340 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 2
341 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
342 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
343 ; RV64-i64-NEXT: sd a0, 16(sp)
344 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 1
345 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
346 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
347 ; RV64-i64-NEXT: sd a0, 8(sp)
348 ; RV64-i64-NEXT: mv a0, sp
349 ; RV64-i64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
350 ; RV64-i64-NEXT: vle64.v v8, (a0)
351 ; RV64-i64-NEXT: addi sp, s0, -128
352 ; RV64-i64-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
353 ; RV64-i64-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
354 ; RV64-i64-NEXT: addi sp, sp, 128
356 %a = call <8 x iXLen> @llvm.lrint.v8iXLen.v8f32(<8 x float> %x)
359 declare <8 x iXLen> @llvm.lrint.v8iXLen.v8f32(<8 x float>)
361 define <16 x iXLen> @lrint_v16f32(<16 x float> %x) {
362 ; RV32-LABEL: lrint_v16f32:
364 ; RV32-NEXT: addi sp, sp, -192
365 ; RV32-NEXT: .cfi_def_cfa_offset 192
366 ; RV32-NEXT: sw ra, 188(sp) # 4-byte Folded Spill
367 ; RV32-NEXT: sw s0, 184(sp) # 4-byte Folded Spill
368 ; RV32-NEXT: .cfi_offset ra, -4
369 ; RV32-NEXT: .cfi_offset s0, -8
370 ; RV32-NEXT: addi s0, sp, 192
371 ; RV32-NEXT: .cfi_def_cfa s0, 0
372 ; RV32-NEXT: andi sp, sp, -64
373 ; RV32-NEXT: mv a0, sp
374 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
375 ; RV32-NEXT: vse32.v v8, (a0)
376 ; RV32-NEXT: flw fa5, 60(sp)
377 ; RV32-NEXT: fcvt.w.s a0, fa5
378 ; RV32-NEXT: sw a0, 124(sp)
379 ; RV32-NEXT: flw fa5, 56(sp)
380 ; RV32-NEXT: fcvt.w.s a0, fa5
381 ; RV32-NEXT: sw a0, 120(sp)
382 ; RV32-NEXT: flw fa5, 52(sp)
383 ; RV32-NEXT: fcvt.w.s a0, fa5
384 ; RV32-NEXT: sw a0, 116(sp)
385 ; RV32-NEXT: flw fa5, 48(sp)
386 ; RV32-NEXT: fcvt.w.s a0, fa5
387 ; RV32-NEXT: sw a0, 112(sp)
388 ; RV32-NEXT: flw fa5, 44(sp)
389 ; RV32-NEXT: fcvt.w.s a0, fa5
390 ; RV32-NEXT: sw a0, 108(sp)
391 ; RV32-NEXT: flw fa5, 40(sp)
392 ; RV32-NEXT: fcvt.w.s a0, fa5
393 ; RV32-NEXT: sw a0, 104(sp)
394 ; RV32-NEXT: flw fa5, 36(sp)
395 ; RV32-NEXT: fcvt.w.s a0, fa5
396 ; RV32-NEXT: sw a0, 100(sp)
397 ; RV32-NEXT: flw fa5, 32(sp)
398 ; RV32-NEXT: fcvt.w.s a0, fa5
399 ; RV32-NEXT: sw a0, 96(sp)
400 ; RV32-NEXT: vfmv.f.s fa5, v8
401 ; RV32-NEXT: fcvt.w.s a0, fa5
402 ; RV32-NEXT: sw a0, 64(sp)
403 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
404 ; RV32-NEXT: vslidedown.vi v10, v8, 3
405 ; RV32-NEXT: vfmv.f.s fa5, v10
406 ; RV32-NEXT: fcvt.w.s a0, fa5
407 ; RV32-NEXT: sw a0, 76(sp)
408 ; RV32-NEXT: vslidedown.vi v10, v8, 2
409 ; RV32-NEXT: vfmv.f.s fa5, v10
410 ; RV32-NEXT: fcvt.w.s a0, fa5
411 ; RV32-NEXT: sw a0, 72(sp)
412 ; RV32-NEXT: vslidedown.vi v10, v8, 1
413 ; RV32-NEXT: vfmv.f.s fa5, v10
414 ; RV32-NEXT: fcvt.w.s a0, fa5
415 ; RV32-NEXT: sw a0, 68(sp)
416 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
417 ; RV32-NEXT: vslidedown.vi v10, v8, 7
418 ; RV32-NEXT: vfmv.f.s fa5, v10
419 ; RV32-NEXT: fcvt.w.s a0, fa5
420 ; RV32-NEXT: sw a0, 92(sp)
421 ; RV32-NEXT: vslidedown.vi v10, v8, 6
422 ; RV32-NEXT: vfmv.f.s fa5, v10
423 ; RV32-NEXT: fcvt.w.s a0, fa5
424 ; RV32-NEXT: sw a0, 88(sp)
425 ; RV32-NEXT: vslidedown.vi v10, v8, 5
426 ; RV32-NEXT: vfmv.f.s fa5, v10
427 ; RV32-NEXT: fcvt.w.s a0, fa5
428 ; RV32-NEXT: sw a0, 84(sp)
429 ; RV32-NEXT: vslidedown.vi v8, v8, 4
430 ; RV32-NEXT: vfmv.f.s fa5, v8
431 ; RV32-NEXT: fcvt.w.s a0, fa5
432 ; RV32-NEXT: sw a0, 80(sp)
433 ; RV32-NEXT: addi a0, sp, 64
434 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
435 ; RV32-NEXT: vle32.v v8, (a0)
436 ; RV32-NEXT: addi sp, s0, -192
437 ; RV32-NEXT: lw ra, 188(sp) # 4-byte Folded Reload
438 ; RV32-NEXT: lw s0, 184(sp) # 4-byte Folded Reload
439 ; RV32-NEXT: addi sp, sp, 192
442 ; RV64-i32-LABEL: lrint_v16f32:
444 ; RV64-i32-NEXT: addi sp, sp, -192
445 ; RV64-i32-NEXT: .cfi_def_cfa_offset 192
446 ; RV64-i32-NEXT: sd ra, 184(sp) # 8-byte Folded Spill
447 ; RV64-i32-NEXT: sd s0, 176(sp) # 8-byte Folded Spill
448 ; RV64-i32-NEXT: .cfi_offset ra, -8
449 ; RV64-i32-NEXT: .cfi_offset s0, -16
450 ; RV64-i32-NEXT: addi s0, sp, 192
451 ; RV64-i32-NEXT: .cfi_def_cfa s0, 0
452 ; RV64-i32-NEXT: andi sp, sp, -64
453 ; RV64-i32-NEXT: mv a0, sp
454 ; RV64-i32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
455 ; RV64-i32-NEXT: vse32.v v8, (a0)
456 ; RV64-i32-NEXT: flw fa5, 60(sp)
457 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
458 ; RV64-i32-NEXT: sw a0, 124(sp)
459 ; RV64-i32-NEXT: flw fa5, 56(sp)
460 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
461 ; RV64-i32-NEXT: sw a0, 120(sp)
462 ; RV64-i32-NEXT: flw fa5, 52(sp)
463 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
464 ; RV64-i32-NEXT: sw a0, 116(sp)
465 ; RV64-i32-NEXT: flw fa5, 48(sp)
466 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
467 ; RV64-i32-NEXT: sw a0, 112(sp)
468 ; RV64-i32-NEXT: flw fa5, 44(sp)
469 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
470 ; RV64-i32-NEXT: sw a0, 108(sp)
471 ; RV64-i32-NEXT: flw fa5, 40(sp)
472 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
473 ; RV64-i32-NEXT: sw a0, 104(sp)
474 ; RV64-i32-NEXT: flw fa5, 36(sp)
475 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
476 ; RV64-i32-NEXT: sw a0, 100(sp)
477 ; RV64-i32-NEXT: flw fa5, 32(sp)
478 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
479 ; RV64-i32-NEXT: sw a0, 96(sp)
480 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
481 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
482 ; RV64-i32-NEXT: sw a0, 64(sp)
483 ; RV64-i32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
484 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 3
485 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
486 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
487 ; RV64-i32-NEXT: sw a0, 76(sp)
488 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 2
489 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
490 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
491 ; RV64-i32-NEXT: sw a0, 72(sp)
492 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 1
493 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
494 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
495 ; RV64-i32-NEXT: sw a0, 68(sp)
496 ; RV64-i32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
497 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 7
498 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
499 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
500 ; RV64-i32-NEXT: sw a0, 92(sp)
501 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 6
502 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
503 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
504 ; RV64-i32-NEXT: sw a0, 88(sp)
505 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 5
506 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
507 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
508 ; RV64-i32-NEXT: sw a0, 84(sp)
509 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 4
510 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
511 ; RV64-i32-NEXT: fcvt.l.s a0, fa5
512 ; RV64-i32-NEXT: sw a0, 80(sp)
513 ; RV64-i32-NEXT: addi a0, sp, 64
514 ; RV64-i32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
515 ; RV64-i32-NEXT: vle32.v v8, (a0)
516 ; RV64-i32-NEXT: addi sp, s0, -192
517 ; RV64-i32-NEXT: ld ra, 184(sp) # 8-byte Folded Reload
518 ; RV64-i32-NEXT: ld s0, 176(sp) # 8-byte Folded Reload
519 ; RV64-i32-NEXT: addi sp, sp, 192
522 ; RV64-i64-LABEL: lrint_v16f32:
524 ; RV64-i64-NEXT: addi sp, sp, -384
525 ; RV64-i64-NEXT: .cfi_def_cfa_offset 384
526 ; RV64-i64-NEXT: sd ra, 376(sp) # 8-byte Folded Spill
527 ; RV64-i64-NEXT: sd s0, 368(sp) # 8-byte Folded Spill
528 ; RV64-i64-NEXT: .cfi_offset ra, -8
529 ; RV64-i64-NEXT: .cfi_offset s0, -16
530 ; RV64-i64-NEXT: addi s0, sp, 384
531 ; RV64-i64-NEXT: .cfi_def_cfa s0, 0
532 ; RV64-i64-NEXT: andi sp, sp, -128
533 ; RV64-i64-NEXT: addi a0, sp, 64
534 ; RV64-i64-NEXT: vsetivli zero, 16, e32, m4, ta, ma
535 ; RV64-i64-NEXT: vse32.v v8, (a0)
536 ; RV64-i64-NEXT: flw fa5, 124(sp)
537 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
538 ; RV64-i64-NEXT: sd a0, 248(sp)
539 ; RV64-i64-NEXT: flw fa5, 120(sp)
540 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
541 ; RV64-i64-NEXT: sd a0, 240(sp)
542 ; RV64-i64-NEXT: flw fa5, 116(sp)
543 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
544 ; RV64-i64-NEXT: sd a0, 232(sp)
545 ; RV64-i64-NEXT: flw fa5, 112(sp)
546 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
547 ; RV64-i64-NEXT: sd a0, 224(sp)
548 ; RV64-i64-NEXT: flw fa5, 108(sp)
549 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
550 ; RV64-i64-NEXT: sd a0, 216(sp)
551 ; RV64-i64-NEXT: flw fa5, 104(sp)
552 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
553 ; RV64-i64-NEXT: sd a0, 208(sp)
554 ; RV64-i64-NEXT: flw fa5, 100(sp)
555 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
556 ; RV64-i64-NEXT: sd a0, 200(sp)
557 ; RV64-i64-NEXT: flw fa5, 96(sp)
558 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
559 ; RV64-i64-NEXT: sd a0, 192(sp)
560 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
561 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
562 ; RV64-i64-NEXT: sd a0, 128(sp)
563 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
564 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 3
565 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
566 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
567 ; RV64-i64-NEXT: sd a0, 152(sp)
568 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 2
569 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
570 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
571 ; RV64-i64-NEXT: sd a0, 144(sp)
572 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 1
573 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
574 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
575 ; RV64-i64-NEXT: sd a0, 136(sp)
576 ; RV64-i64-NEXT: vsetivli zero, 1, e32, m2, ta, ma
577 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 7
578 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
579 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
580 ; RV64-i64-NEXT: sd a0, 184(sp)
581 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 6
582 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
583 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
584 ; RV64-i64-NEXT: sd a0, 176(sp)
585 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 5
586 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
587 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
588 ; RV64-i64-NEXT: sd a0, 168(sp)
589 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 4
590 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
591 ; RV64-i64-NEXT: fcvt.l.s a0, fa5
592 ; RV64-i64-NEXT: sd a0, 160(sp)
593 ; RV64-i64-NEXT: addi a0, sp, 128
594 ; RV64-i64-NEXT: vsetivli zero, 16, e64, m8, ta, ma
595 ; RV64-i64-NEXT: vle64.v v8, (a0)
596 ; RV64-i64-NEXT: addi sp, s0, -384
597 ; RV64-i64-NEXT: ld ra, 376(sp) # 8-byte Folded Reload
598 ; RV64-i64-NEXT: ld s0, 368(sp) # 8-byte Folded Reload
599 ; RV64-i64-NEXT: addi sp, sp, 384
601 %a = call <16 x iXLen> @llvm.lrint.v16iXLen.v16f32(<16 x float> %x)
604 declare <16 x iXLen> @llvm.lrint.v16iXLen.v16f32(<16 x float>)
606 define <1 x iXLen> @lrint_v1f64(<1 x double> %x) {
607 ; RV32-LABEL: lrint_v1f64:
609 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
610 ; RV32-NEXT: vfmv.f.s fa5, v8
611 ; RV32-NEXT: fcvt.w.d a0, fa5
612 ; RV32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
613 ; RV32-NEXT: vmv.s.x v8, a0
616 ; RV64-i32-LABEL: lrint_v1f64:
618 ; RV64-i32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
619 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
620 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
621 ; RV64-i32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
622 ; RV64-i32-NEXT: vmv.s.x v8, a0
625 ; RV64-i64-LABEL: lrint_v1f64:
627 ; RV64-i64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
628 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
629 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
630 ; RV64-i64-NEXT: vmv.s.x v8, a0
632 %a = call <1 x iXLen> @llvm.lrint.v1iXLen.v1f64(<1 x double> %x)
635 declare <1 x iXLen> @llvm.lrint.v1iXLen.v1f64(<1 x double>)
637 define <2 x iXLen> @lrint_v2f64(<2 x double> %x) {
638 ; RV32-LABEL: lrint_v2f64:
640 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
641 ; RV32-NEXT: vslidedown.vi v9, v8, 1
642 ; RV32-NEXT: vfmv.f.s fa5, v9
643 ; RV32-NEXT: fcvt.w.d a0, fa5
644 ; RV32-NEXT: vfmv.f.s fa5, v8
645 ; RV32-NEXT: fcvt.w.d a1, fa5
646 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
647 ; RV32-NEXT: vmv.v.x v8, a1
648 ; RV32-NEXT: vslide1down.vx v8, v8, a0
651 ; RV64-i32-LABEL: lrint_v2f64:
653 ; RV64-i32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
654 ; RV64-i32-NEXT: vslidedown.vi v9, v8, 1
655 ; RV64-i32-NEXT: vfmv.f.s fa5, v9
656 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
657 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
658 ; RV64-i32-NEXT: fcvt.l.d a1, fa5
659 ; RV64-i32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
660 ; RV64-i32-NEXT: vmv.v.x v8, a1
661 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a0
664 ; RV64-i64-LABEL: lrint_v2f64:
666 ; RV64-i64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
667 ; RV64-i64-NEXT: vslidedown.vi v9, v8, 1
668 ; RV64-i64-NEXT: vfmv.f.s fa5, v9
669 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
670 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
671 ; RV64-i64-NEXT: fcvt.l.d a1, fa5
672 ; RV64-i64-NEXT: vmv.v.x v8, a1
673 ; RV64-i64-NEXT: vslide1down.vx v8, v8, a0
675 %a = call <2 x iXLen> @llvm.lrint.v2iXLen.v2f64(<2 x double> %x)
678 declare <2 x iXLen> @llvm.lrint.v2iXLen.v2f64(<2 x double>)
680 define <4 x iXLen> @lrint_v4f64(<4 x double> %x) {
681 ; RV32-LABEL: lrint_v4f64:
683 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
684 ; RV32-NEXT: vslidedown.vi v10, v8, 1
685 ; RV32-NEXT: vfmv.f.s fa5, v10
686 ; RV32-NEXT: fcvt.w.d a0, fa5
687 ; RV32-NEXT: vfmv.f.s fa5, v8
688 ; RV32-NEXT: fcvt.w.d a1, fa5
689 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
690 ; RV32-NEXT: vmv.v.x v10, a1
691 ; RV32-NEXT: vslide1down.vx v10, v10, a0
692 ; RV32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
693 ; RV32-NEXT: vslidedown.vi v12, v8, 2
694 ; RV32-NEXT: vfmv.f.s fa5, v12
695 ; RV32-NEXT: fcvt.w.d a0, fa5
696 ; RV32-NEXT: vsetvli zero, zero, e32, m1, ta, ma
697 ; RV32-NEXT: vslide1down.vx v10, v10, a0
698 ; RV32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
699 ; RV32-NEXT: vslidedown.vi v8, v8, 3
700 ; RV32-NEXT: vfmv.f.s fa5, v8
701 ; RV32-NEXT: fcvt.w.d a0, fa5
702 ; RV32-NEXT: vsetvli zero, zero, e32, m1, ta, ma
703 ; RV32-NEXT: vslide1down.vx v8, v10, a0
706 ; RV64-i32-LABEL: lrint_v4f64:
708 ; RV64-i32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
709 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 1
710 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
711 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
712 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
713 ; RV64-i32-NEXT: fcvt.l.d a1, fa5
714 ; RV64-i32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
715 ; RV64-i32-NEXT: vmv.v.x v10, a1
716 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
717 ; RV64-i32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
718 ; RV64-i32-NEXT: vslidedown.vi v12, v8, 2
719 ; RV64-i32-NEXT: vfmv.f.s fa5, v12
720 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
721 ; RV64-i32-NEXT: vsetvli zero, zero, e32, m1, ta, ma
722 ; RV64-i32-NEXT: vslide1down.vx v10, v10, a0
723 ; RV64-i32-NEXT: vsetvli zero, zero, e64, m2, ta, ma
724 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 3
725 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
726 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
727 ; RV64-i32-NEXT: vsetvli zero, zero, e32, m1, ta, ma
728 ; RV64-i32-NEXT: vslide1down.vx v8, v10, a0
731 ; RV64-i64-LABEL: lrint_v4f64:
733 ; RV64-i64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
734 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 1
735 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
736 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
737 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
738 ; RV64-i64-NEXT: fcvt.l.d a1, fa5
739 ; RV64-i64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
740 ; RV64-i64-NEXT: vmv.v.x v10, a1
741 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
742 ; RV64-i64-NEXT: vslidedown.vi v12, v8, 2
743 ; RV64-i64-NEXT: vfmv.f.s fa5, v12
744 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
745 ; RV64-i64-NEXT: vslide1down.vx v10, v10, a0
746 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 3
747 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
748 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
749 ; RV64-i64-NEXT: vslide1down.vx v8, v10, a0
751 %a = call <4 x iXLen> @llvm.lrint.v4iXLen.v4f64(<4 x double> %x)
754 declare <4 x iXLen> @llvm.lrint.v4iXLen.v4f64(<4 x double>)
756 define <8 x iXLen> @lrint_v8f64(<8 x double> %x) {
757 ; RV32-LABEL: lrint_v8f64:
759 ; RV32-NEXT: addi sp, sp, -128
760 ; RV32-NEXT: .cfi_def_cfa_offset 128
761 ; RV32-NEXT: sw ra, 124(sp) # 4-byte Folded Spill
762 ; RV32-NEXT: sw s0, 120(sp) # 4-byte Folded Spill
763 ; RV32-NEXT: .cfi_offset ra, -4
764 ; RV32-NEXT: .cfi_offset s0, -8
765 ; RV32-NEXT: addi s0, sp, 128
766 ; RV32-NEXT: .cfi_def_cfa s0, 0
767 ; RV32-NEXT: andi sp, sp, -64
768 ; RV32-NEXT: mv a0, sp
769 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
770 ; RV32-NEXT: vse64.v v8, (a0)
771 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
772 ; RV32-NEXT: vslidedown.vi v10, v8, 1
773 ; RV32-NEXT: vfmv.f.s fa5, v10
774 ; RV32-NEXT: fcvt.w.d a0, fa5
775 ; RV32-NEXT: vfmv.f.s fa5, v8
776 ; RV32-NEXT: fcvt.w.d a1, fa5
777 ; RV32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
778 ; RV32-NEXT: vslidedown.vi v10, v8, 2
779 ; RV32-NEXT: vfmv.f.s fa5, v10
780 ; RV32-NEXT: fcvt.w.d a2, fa5
781 ; RV32-NEXT: vslidedown.vi v8, v8, 3
782 ; RV32-NEXT: fld fa5, 32(sp)
783 ; RV32-NEXT: vfmv.f.s fa4, v8
784 ; RV32-NEXT: fld fa3, 40(sp)
785 ; RV32-NEXT: fcvt.w.d a3, fa4
786 ; RV32-NEXT: fcvt.w.d a4, fa5
787 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
788 ; RV32-NEXT: vmv.v.x v8, a1
789 ; RV32-NEXT: fcvt.w.d a1, fa3
790 ; RV32-NEXT: fld fa5, 48(sp)
791 ; RV32-NEXT: vslide1down.vx v8, v8, a0
792 ; RV32-NEXT: vslide1down.vx v8, v8, a2
793 ; RV32-NEXT: vslide1down.vx v8, v8, a3
794 ; RV32-NEXT: fcvt.w.d a0, fa5
795 ; RV32-NEXT: fld fa5, 56(sp)
796 ; RV32-NEXT: vslide1down.vx v8, v8, a4
797 ; RV32-NEXT: vslide1down.vx v8, v8, a1
798 ; RV32-NEXT: vslide1down.vx v8, v8, a0
799 ; RV32-NEXT: fcvt.w.d a0, fa5
800 ; RV32-NEXT: vslide1down.vx v8, v8, a0
801 ; RV32-NEXT: addi sp, s0, -128
802 ; RV32-NEXT: lw ra, 124(sp) # 4-byte Folded Reload
803 ; RV32-NEXT: lw s0, 120(sp) # 4-byte Folded Reload
804 ; RV32-NEXT: addi sp, sp, 128
807 ; RV64-i32-LABEL: lrint_v8f64:
809 ; RV64-i32-NEXT: addi sp, sp, -128
810 ; RV64-i32-NEXT: .cfi_def_cfa_offset 128
811 ; RV64-i32-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
812 ; RV64-i32-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
813 ; RV64-i32-NEXT: .cfi_offset ra, -8
814 ; RV64-i32-NEXT: .cfi_offset s0, -16
815 ; RV64-i32-NEXT: addi s0, sp, 128
816 ; RV64-i32-NEXT: .cfi_def_cfa s0, 0
817 ; RV64-i32-NEXT: andi sp, sp, -64
818 ; RV64-i32-NEXT: mv a0, sp
819 ; RV64-i32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
820 ; RV64-i32-NEXT: vse64.v v8, (a0)
821 ; RV64-i32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
822 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 1
823 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
824 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
825 ; RV64-i32-NEXT: vfmv.f.s fa5, v8
826 ; RV64-i32-NEXT: fcvt.l.d a1, fa5
827 ; RV64-i32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
828 ; RV64-i32-NEXT: vslidedown.vi v10, v8, 2
829 ; RV64-i32-NEXT: vfmv.f.s fa5, v10
830 ; RV64-i32-NEXT: fcvt.l.d a2, fa5
831 ; RV64-i32-NEXT: vslidedown.vi v8, v8, 3
832 ; RV64-i32-NEXT: fld fa5, 32(sp)
833 ; RV64-i32-NEXT: vfmv.f.s fa4, v8
834 ; RV64-i32-NEXT: fld fa3, 40(sp)
835 ; RV64-i32-NEXT: fcvt.l.d a3, fa4
836 ; RV64-i32-NEXT: fcvt.l.d a4, fa5
837 ; RV64-i32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
838 ; RV64-i32-NEXT: vmv.v.x v8, a1
839 ; RV64-i32-NEXT: fcvt.l.d a1, fa3
840 ; RV64-i32-NEXT: fld fa5, 48(sp)
841 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a0
842 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a2
843 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a3
844 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
845 ; RV64-i32-NEXT: fld fa5, 56(sp)
846 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a4
847 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a1
848 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a0
849 ; RV64-i32-NEXT: fcvt.l.d a0, fa5
850 ; RV64-i32-NEXT: vslide1down.vx v8, v8, a0
851 ; RV64-i32-NEXT: addi sp, s0, -128
852 ; RV64-i32-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
853 ; RV64-i32-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
854 ; RV64-i32-NEXT: addi sp, sp, 128
857 ; RV64-i64-LABEL: lrint_v8f64:
859 ; RV64-i64-NEXT: addi sp, sp, -192
860 ; RV64-i64-NEXT: .cfi_def_cfa_offset 192
861 ; RV64-i64-NEXT: sd ra, 184(sp) # 8-byte Folded Spill
862 ; RV64-i64-NEXT: sd s0, 176(sp) # 8-byte Folded Spill
863 ; RV64-i64-NEXT: .cfi_offset ra, -8
864 ; RV64-i64-NEXT: .cfi_offset s0, -16
865 ; RV64-i64-NEXT: addi s0, sp, 192
866 ; RV64-i64-NEXT: .cfi_def_cfa s0, 0
867 ; RV64-i64-NEXT: andi sp, sp, -64
868 ; RV64-i64-NEXT: mv a0, sp
869 ; RV64-i64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
870 ; RV64-i64-NEXT: vse64.v v8, (a0)
871 ; RV64-i64-NEXT: fld fa5, 56(sp)
872 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
873 ; RV64-i64-NEXT: sd a0, 120(sp)
874 ; RV64-i64-NEXT: fld fa5, 48(sp)
875 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
876 ; RV64-i64-NEXT: sd a0, 112(sp)
877 ; RV64-i64-NEXT: fld fa5, 40(sp)
878 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
879 ; RV64-i64-NEXT: sd a0, 104(sp)
880 ; RV64-i64-NEXT: fld fa5, 32(sp)
881 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
882 ; RV64-i64-NEXT: sd a0, 96(sp)
883 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
884 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
885 ; RV64-i64-NEXT: sd a0, 64(sp)
886 ; RV64-i64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
887 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 1
888 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
889 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
890 ; RV64-i64-NEXT: sd a0, 72(sp)
891 ; RV64-i64-NEXT: vsetivli zero, 1, e64, m2, ta, ma
892 ; RV64-i64-NEXT: vslidedown.vi v10, v8, 3
893 ; RV64-i64-NEXT: vfmv.f.s fa5, v10
894 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
895 ; RV64-i64-NEXT: sd a0, 88(sp)
896 ; RV64-i64-NEXT: vslidedown.vi v8, v8, 2
897 ; RV64-i64-NEXT: vfmv.f.s fa5, v8
898 ; RV64-i64-NEXT: fcvt.l.d a0, fa5
899 ; RV64-i64-NEXT: sd a0, 80(sp)
900 ; RV64-i64-NEXT: addi a0, sp, 64
901 ; RV64-i64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
902 ; RV64-i64-NEXT: vle64.v v8, (a0)
903 ; RV64-i64-NEXT: addi sp, s0, -192
904 ; RV64-i64-NEXT: ld ra, 184(sp) # 8-byte Folded Reload
905 ; RV64-i64-NEXT: ld s0, 176(sp) # 8-byte Folded Reload
906 ; RV64-i64-NEXT: addi sp, sp, 192
908 %a = call <8 x iXLen> @llvm.lrint.v8iXLen.v8f64(<8 x double> %x)
911 declare <8 x iXLen> @llvm.lrint.v8iXLen.v8f64(<8 x double>)