1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v,+f,+d -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v,+f,+d -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=RV64
7 define <1 x i64> @llrint_v1i64_v1f32(<1 x float> %x) {
8 ; RV32-LABEL: llrint_v1i64_v1f32:
10 ; RV32-NEXT: addi sp, sp, -16
11 ; RV32-NEXT: .cfi_def_cfa_offset 16
12 ; RV32-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
13 ; RV32-NEXT: .cfi_offset ra, -4
14 ; RV32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
15 ; RV32-NEXT: vfmv.f.s fa0, v8
16 ; RV32-NEXT: call llrintf
17 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
18 ; RV32-NEXT: vmv.v.x v8, a0
19 ; RV32-NEXT: vslide1down.vx v8, v8, a1
20 ; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
21 ; RV32-NEXT: addi sp, sp, 16
24 ; RV64-LABEL: llrint_v1i64_v1f32:
26 ; RV64-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
27 ; RV64-NEXT: vfmv.f.s fa5, v8
28 ; RV64-NEXT: fcvt.l.s a0, fa5
29 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
30 ; RV64-NEXT: vmv.s.x v8, a0
32 %a = call <1 x i64> @llvm.llrint.v1i64.v1f32(<1 x float> %x)
35 declare <1 x i64> @llvm.llrint.v1i64.v1f32(<1 x float>)
37 define <2 x i64> @llrint_v2i64_v2f32(<2 x float> %x) {
38 ; RV32-LABEL: llrint_v2i64_v2f32:
40 ; RV32-NEXT: addi sp, sp, -32
41 ; RV32-NEXT: .cfi_def_cfa_offset 32
42 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
43 ; RV32-NEXT: .cfi_offset ra, -4
44 ; RV32-NEXT: csrr a0, vlenb
45 ; RV32-NEXT: slli a0, a0, 1
46 ; RV32-NEXT: sub sp, sp, a0
47 ; RV32-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 2 * vlenb
48 ; RV32-NEXT: addi a0, sp, 16
49 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
50 ; RV32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
51 ; RV32-NEXT: vfmv.f.s fa0, v8
52 ; RV32-NEXT: call llrintf
53 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
54 ; RV32-NEXT: vmv.v.x v8, a0
55 ; RV32-NEXT: vslide1down.vx v8, v8, a1
56 ; RV32-NEXT: csrr a0, vlenb
57 ; RV32-NEXT: add a0, sp, a0
58 ; RV32-NEXT: addi a0, a0, 16
59 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
60 ; RV32-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
61 ; RV32-NEXT: addi a0, sp, 16
62 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
63 ; RV32-NEXT: vslidedown.vi v8, v8, 1
64 ; RV32-NEXT: vfmv.f.s fa0, v8
65 ; RV32-NEXT: call llrintf
66 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
67 ; RV32-NEXT: csrr a2, vlenb
68 ; RV32-NEXT: add a2, sp, a2
69 ; RV32-NEXT: addi a2, a2, 16
70 ; RV32-NEXT: vl1r.v v8, (a2) # Unknown-size Folded Reload
71 ; RV32-NEXT: vslide1down.vx v8, v8, a0
72 ; RV32-NEXT: vslide1down.vx v8, v8, a1
73 ; RV32-NEXT: csrr a0, vlenb
74 ; RV32-NEXT: slli a0, a0, 1
75 ; RV32-NEXT: add sp, sp, a0
76 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
77 ; RV32-NEXT: addi sp, sp, 32
80 ; RV64-LABEL: llrint_v2i64_v2f32:
82 ; RV64-NEXT: vsetivli zero, 1, e32, mf2, ta, ma
83 ; RV64-NEXT: vslidedown.vi v9, v8, 1
84 ; RV64-NEXT: vfmv.f.s fa5, v9
85 ; RV64-NEXT: fcvt.l.s a0, fa5
86 ; RV64-NEXT: vfmv.f.s fa5, v8
87 ; RV64-NEXT: fcvt.l.s a1, fa5
88 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
89 ; RV64-NEXT: vmv.v.x v8, a1
90 ; RV64-NEXT: vslide1down.vx v8, v8, a0
92 %a = call <2 x i64> @llvm.llrint.v2i64.v2f32(<2 x float> %x)
95 declare <2 x i64> @llvm.llrint.v2i64.v2f32(<2 x float>)
97 define <3 x i64> @llrint_v3i64_v3f32(<3 x float> %x) {
98 ; RV32-LABEL: llrint_v3i64_v3f32:
100 ; RV32-NEXT: addi sp, sp, -32
101 ; RV32-NEXT: .cfi_def_cfa_offset 32
102 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
103 ; RV32-NEXT: .cfi_offset ra, -4
104 ; RV32-NEXT: csrr a0, vlenb
105 ; RV32-NEXT: slli a0, a0, 2
106 ; RV32-NEXT: sub sp, sp, a0
107 ; RV32-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 4 * vlenb
108 ; RV32-NEXT: csrr a0, vlenb
109 ; RV32-NEXT: slli a0, a0, 1
110 ; RV32-NEXT: add a0, sp, a0
111 ; RV32-NEXT: addi a0, a0, 16
112 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
113 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
114 ; RV32-NEXT: vfmv.f.s fa0, v8
115 ; RV32-NEXT: call llrintf
116 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
117 ; RV32-NEXT: vmv.v.x v8, a0
118 ; RV32-NEXT: vslide1down.vx v8, v8, a1
119 ; RV32-NEXT: addi a0, sp, 16
120 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
121 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
122 ; RV32-NEXT: csrr a0, vlenb
123 ; RV32-NEXT: slli a0, a0, 1
124 ; RV32-NEXT: add a0, sp, a0
125 ; RV32-NEXT: addi a0, a0, 16
126 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
127 ; RV32-NEXT: vslidedown.vi v8, v8, 1
128 ; RV32-NEXT: vfmv.f.s fa0, v8
129 ; RV32-NEXT: call llrintf
130 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
131 ; RV32-NEXT: addi a2, sp, 16
132 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
133 ; RV32-NEXT: vslide1down.vx v8, v8, a0
134 ; RV32-NEXT: vslide1down.vx v8, v8, a1
135 ; RV32-NEXT: addi a0, sp, 16
136 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
137 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
138 ; RV32-NEXT: csrr a0, vlenb
139 ; RV32-NEXT: slli a0, a0, 1
140 ; RV32-NEXT: add a0, sp, a0
141 ; RV32-NEXT: addi a0, a0, 16
142 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
143 ; RV32-NEXT: vslidedown.vi v8, v8, 2
144 ; RV32-NEXT: vfmv.f.s fa0, v8
145 ; RV32-NEXT: call llrintf
146 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
147 ; RV32-NEXT: addi a2, sp, 16
148 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
149 ; RV32-NEXT: vslide1down.vx v8, v8, a0
150 ; RV32-NEXT: vslide1down.vx v8, v8, a1
151 ; RV32-NEXT: addi a0, sp, 16
152 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
153 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
154 ; RV32-NEXT: csrr a0, vlenb
155 ; RV32-NEXT: slli a0, a0, 1
156 ; RV32-NEXT: add a0, sp, a0
157 ; RV32-NEXT: addi a0, a0, 16
158 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
159 ; RV32-NEXT: vslidedown.vi v8, v8, 3
160 ; RV32-NEXT: vfmv.f.s fa0, v8
161 ; RV32-NEXT: call llrintf
162 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
163 ; RV32-NEXT: addi a2, sp, 16
164 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
165 ; RV32-NEXT: vslide1down.vx v8, v8, a0
166 ; RV32-NEXT: vslide1down.vx v8, v8, a1
167 ; RV32-NEXT: csrr a0, vlenb
168 ; RV32-NEXT: slli a0, a0, 2
169 ; RV32-NEXT: add sp, sp, a0
170 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
171 ; RV32-NEXT: addi sp, sp, 32
174 ; RV64-LABEL: llrint_v3i64_v3f32:
176 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
177 ; RV64-NEXT: vslidedown.vi v9, v8, 1
178 ; RV64-NEXT: vfmv.f.s fa5, v9
179 ; RV64-NEXT: fcvt.l.s a0, fa5
180 ; RV64-NEXT: vfmv.f.s fa5, v8
181 ; RV64-NEXT: fcvt.l.s a1, fa5
182 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
183 ; RV64-NEXT: vmv.v.x v10, a1
184 ; RV64-NEXT: vslide1down.vx v10, v10, a0
185 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
186 ; RV64-NEXT: vslidedown.vi v9, v8, 2
187 ; RV64-NEXT: vfmv.f.s fa5, v9
188 ; RV64-NEXT: fcvt.l.s a0, fa5
189 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
190 ; RV64-NEXT: vslide1down.vx v10, v10, a0
191 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
192 ; RV64-NEXT: vslidedown.vi v8, v8, 3
193 ; RV64-NEXT: vfmv.f.s fa5, v8
194 ; RV64-NEXT: fcvt.l.s a0, fa5
195 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
196 ; RV64-NEXT: vslide1down.vx v8, v10, a0
198 %a = call <3 x i64> @llvm.llrint.v3i64.v3f32(<3 x float> %x)
201 declare <3 x i64> @llvm.llrint.v3i64.v3f32(<3 x float>)
203 define <4 x i64> @llrint_v4i64_v4f32(<4 x float> %x) {
204 ; RV32-LABEL: llrint_v4i64_v4f32:
206 ; RV32-NEXT: addi sp, sp, -32
207 ; RV32-NEXT: .cfi_def_cfa_offset 32
208 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
209 ; RV32-NEXT: .cfi_offset ra, -4
210 ; RV32-NEXT: csrr a0, vlenb
211 ; RV32-NEXT: slli a0, a0, 2
212 ; RV32-NEXT: sub sp, sp, a0
213 ; RV32-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 4 * vlenb
214 ; RV32-NEXT: csrr a0, vlenb
215 ; RV32-NEXT: slli a0, a0, 1
216 ; RV32-NEXT: add a0, sp, a0
217 ; RV32-NEXT: addi a0, a0, 16
218 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
219 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
220 ; RV32-NEXT: vfmv.f.s fa0, v8
221 ; RV32-NEXT: call llrintf
222 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
223 ; RV32-NEXT: vmv.v.x v8, a0
224 ; RV32-NEXT: vslide1down.vx v8, v8, a1
225 ; RV32-NEXT: addi a0, sp, 16
226 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
227 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
228 ; RV32-NEXT: csrr a0, vlenb
229 ; RV32-NEXT: slli a0, a0, 1
230 ; RV32-NEXT: add a0, sp, a0
231 ; RV32-NEXT: addi a0, a0, 16
232 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
233 ; RV32-NEXT: vslidedown.vi v8, v8, 1
234 ; RV32-NEXT: vfmv.f.s fa0, v8
235 ; RV32-NEXT: call llrintf
236 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
237 ; RV32-NEXT: addi a2, sp, 16
238 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
239 ; RV32-NEXT: vslide1down.vx v8, v8, a0
240 ; RV32-NEXT: vslide1down.vx v8, v8, a1
241 ; RV32-NEXT: addi a0, sp, 16
242 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
243 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
244 ; RV32-NEXT: csrr a0, vlenb
245 ; RV32-NEXT: slli a0, a0, 1
246 ; RV32-NEXT: add a0, sp, a0
247 ; RV32-NEXT: addi a0, a0, 16
248 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
249 ; RV32-NEXT: vslidedown.vi v8, v8, 2
250 ; RV32-NEXT: vfmv.f.s fa0, v8
251 ; RV32-NEXT: call llrintf
252 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
253 ; RV32-NEXT: addi a2, sp, 16
254 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
255 ; RV32-NEXT: vslide1down.vx v8, v8, a0
256 ; RV32-NEXT: vslide1down.vx v8, v8, a1
257 ; RV32-NEXT: addi a0, sp, 16
258 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
259 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
260 ; RV32-NEXT: csrr a0, vlenb
261 ; RV32-NEXT: slli a0, a0, 1
262 ; RV32-NEXT: add a0, sp, a0
263 ; RV32-NEXT: addi a0, a0, 16
264 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
265 ; RV32-NEXT: vslidedown.vi v8, v8, 3
266 ; RV32-NEXT: vfmv.f.s fa0, v8
267 ; RV32-NEXT: call llrintf
268 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
269 ; RV32-NEXT: addi a2, sp, 16
270 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
271 ; RV32-NEXT: vslide1down.vx v8, v8, a0
272 ; RV32-NEXT: vslide1down.vx v8, v8, a1
273 ; RV32-NEXT: csrr a0, vlenb
274 ; RV32-NEXT: slli a0, a0, 2
275 ; RV32-NEXT: add sp, sp, a0
276 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
277 ; RV32-NEXT: addi sp, sp, 32
280 ; RV64-LABEL: llrint_v4i64_v4f32:
282 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
283 ; RV64-NEXT: vslidedown.vi v9, v8, 1
284 ; RV64-NEXT: vfmv.f.s fa5, v9
285 ; RV64-NEXT: fcvt.l.s a0, fa5
286 ; RV64-NEXT: vfmv.f.s fa5, v8
287 ; RV64-NEXT: fcvt.l.s a1, fa5
288 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
289 ; RV64-NEXT: vmv.v.x v10, a1
290 ; RV64-NEXT: vslide1down.vx v10, v10, a0
291 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
292 ; RV64-NEXT: vslidedown.vi v9, v8, 2
293 ; RV64-NEXT: vfmv.f.s fa5, v9
294 ; RV64-NEXT: fcvt.l.s a0, fa5
295 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
296 ; RV64-NEXT: vslide1down.vx v10, v10, a0
297 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
298 ; RV64-NEXT: vslidedown.vi v8, v8, 3
299 ; RV64-NEXT: vfmv.f.s fa5, v8
300 ; RV64-NEXT: fcvt.l.s a0, fa5
301 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
302 ; RV64-NEXT: vslide1down.vx v8, v10, a0
304 %a = call <4 x i64> @llvm.llrint.v4i64.v4f32(<4 x float> %x)
307 declare <4 x i64> @llvm.llrint.v4i64.v4f32(<4 x float>)
309 define <8 x i64> @llrint_v8i64_v8f32(<8 x float> %x) {
310 ; RV32-LABEL: llrint_v8i64_v8f32:
312 ; RV32-NEXT: addi sp, sp, -208
313 ; RV32-NEXT: .cfi_def_cfa_offset 208
314 ; RV32-NEXT: sw ra, 204(sp) # 4-byte Folded Spill
315 ; RV32-NEXT: sw s0, 200(sp) # 4-byte Folded Spill
316 ; RV32-NEXT: .cfi_offset ra, -4
317 ; RV32-NEXT: .cfi_offset s0, -8
318 ; RV32-NEXT: addi s0, sp, 208
319 ; RV32-NEXT: .cfi_def_cfa s0, 0
320 ; RV32-NEXT: csrr a0, vlenb
321 ; RV32-NEXT: slli a0, a0, 1
322 ; RV32-NEXT: sub sp, sp, a0
323 ; RV32-NEXT: andi sp, sp, -64
324 ; RV32-NEXT: addi a0, sp, 192
325 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
326 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
327 ; RV32-NEXT: vfmv.f.s fa0, v8
328 ; RV32-NEXT: call llrintf
329 ; RV32-NEXT: sw a1, 68(sp)
330 ; RV32-NEXT: sw a0, 64(sp)
331 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
332 ; RV32-NEXT: addi a0, sp, 192
333 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
334 ; RV32-NEXT: vslidedown.vi v8, v8, 7
335 ; RV32-NEXT: vfmv.f.s fa0, v8
336 ; RV32-NEXT: call llrintf
337 ; RV32-NEXT: sw a1, 124(sp)
338 ; RV32-NEXT: sw a0, 120(sp)
339 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
340 ; RV32-NEXT: addi a0, sp, 192
341 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
342 ; RV32-NEXT: vslidedown.vi v8, v8, 6
343 ; RV32-NEXT: vfmv.f.s fa0, v8
344 ; RV32-NEXT: call llrintf
345 ; RV32-NEXT: sw a1, 116(sp)
346 ; RV32-NEXT: sw a0, 112(sp)
347 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
348 ; RV32-NEXT: addi a0, sp, 192
349 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
350 ; RV32-NEXT: vslidedown.vi v8, v8, 5
351 ; RV32-NEXT: vfmv.f.s fa0, v8
352 ; RV32-NEXT: call llrintf
353 ; RV32-NEXT: sw a1, 108(sp)
354 ; RV32-NEXT: sw a0, 104(sp)
355 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
356 ; RV32-NEXT: addi a0, sp, 192
357 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
358 ; RV32-NEXT: vslidedown.vi v8, v8, 4
359 ; RV32-NEXT: vfmv.f.s fa0, v8
360 ; RV32-NEXT: call llrintf
361 ; RV32-NEXT: sw a1, 100(sp)
362 ; RV32-NEXT: sw a0, 96(sp)
363 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
364 ; RV32-NEXT: addi a0, sp, 192
365 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
366 ; RV32-NEXT: vslidedown.vi v8, v8, 3
367 ; RV32-NEXT: vfmv.f.s fa0, v8
368 ; RV32-NEXT: call llrintf
369 ; RV32-NEXT: sw a1, 92(sp)
370 ; RV32-NEXT: sw a0, 88(sp)
371 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
372 ; RV32-NEXT: addi a0, sp, 192
373 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
374 ; RV32-NEXT: vslidedown.vi v8, v8, 2
375 ; RV32-NEXT: vfmv.f.s fa0, v8
376 ; RV32-NEXT: call llrintf
377 ; RV32-NEXT: sw a1, 84(sp)
378 ; RV32-NEXT: sw a0, 80(sp)
379 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
380 ; RV32-NEXT: addi a0, sp, 192
381 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
382 ; RV32-NEXT: vslidedown.vi v8, v8, 1
383 ; RV32-NEXT: vfmv.f.s fa0, v8
384 ; RV32-NEXT: call llrintf
385 ; RV32-NEXT: sw a1, 76(sp)
386 ; RV32-NEXT: sw a0, 72(sp)
387 ; RV32-NEXT: addi a0, sp, 64
388 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
389 ; RV32-NEXT: vle32.v v8, (a0)
390 ; RV32-NEXT: addi sp, s0, -208
391 ; RV32-NEXT: lw ra, 204(sp) # 4-byte Folded Reload
392 ; RV32-NEXT: lw s0, 200(sp) # 4-byte Folded Reload
393 ; RV32-NEXT: addi sp, sp, 208
396 ; RV64-LABEL: llrint_v8i64_v8f32:
398 ; RV64-NEXT: addi sp, sp, -128
399 ; RV64-NEXT: .cfi_def_cfa_offset 128
400 ; RV64-NEXT: sd ra, 120(sp) # 8-byte Folded Spill
401 ; RV64-NEXT: sd s0, 112(sp) # 8-byte Folded Spill
402 ; RV64-NEXT: .cfi_offset ra, -8
403 ; RV64-NEXT: .cfi_offset s0, -16
404 ; RV64-NEXT: addi s0, sp, 128
405 ; RV64-NEXT: .cfi_def_cfa s0, 0
406 ; RV64-NEXT: andi sp, sp, -64
407 ; RV64-NEXT: vsetivli zero, 1, e32, m2, ta, ma
408 ; RV64-NEXT: vfmv.f.s fa5, v8
409 ; RV64-NEXT: fcvt.l.s a0, fa5
410 ; RV64-NEXT: sd a0, 0(sp)
411 ; RV64-NEXT: vslidedown.vi v10, v8, 7
412 ; RV64-NEXT: vfmv.f.s fa5, v10
413 ; RV64-NEXT: fcvt.l.s a0, fa5
414 ; RV64-NEXT: sd a0, 56(sp)
415 ; RV64-NEXT: vslidedown.vi v10, v8, 6
416 ; RV64-NEXT: vfmv.f.s fa5, v10
417 ; RV64-NEXT: fcvt.l.s a0, fa5
418 ; RV64-NEXT: sd a0, 48(sp)
419 ; RV64-NEXT: vslidedown.vi v10, v8, 5
420 ; RV64-NEXT: vfmv.f.s fa5, v10
421 ; RV64-NEXT: fcvt.l.s a0, fa5
422 ; RV64-NEXT: sd a0, 40(sp)
423 ; RV64-NEXT: vslidedown.vi v10, v8, 4
424 ; RV64-NEXT: vfmv.f.s fa5, v10
425 ; RV64-NEXT: fcvt.l.s a0, fa5
426 ; RV64-NEXT: sd a0, 32(sp)
427 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
428 ; RV64-NEXT: vslidedown.vi v9, v8, 3
429 ; RV64-NEXT: vfmv.f.s fa5, v9
430 ; RV64-NEXT: fcvt.l.s a0, fa5
431 ; RV64-NEXT: sd a0, 24(sp)
432 ; RV64-NEXT: vslidedown.vi v9, v8, 2
433 ; RV64-NEXT: vfmv.f.s fa5, v9
434 ; RV64-NEXT: fcvt.l.s a0, fa5
435 ; RV64-NEXT: sd a0, 16(sp)
436 ; RV64-NEXT: vslidedown.vi v8, v8, 1
437 ; RV64-NEXT: vfmv.f.s fa5, v8
438 ; RV64-NEXT: fcvt.l.s a0, fa5
439 ; RV64-NEXT: sd a0, 8(sp)
440 ; RV64-NEXT: mv a0, sp
441 ; RV64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
442 ; RV64-NEXT: vle64.v v8, (a0)
443 ; RV64-NEXT: addi sp, s0, -128
444 ; RV64-NEXT: ld ra, 120(sp) # 8-byte Folded Reload
445 ; RV64-NEXT: ld s0, 112(sp) # 8-byte Folded Reload
446 ; RV64-NEXT: addi sp, sp, 128
448 %a = call <8 x i64> @llvm.llrint.v8i64.v8f32(<8 x float> %x)
451 declare <8 x i64> @llvm.llrint.v8i64.v8f32(<8 x float>)
453 define <16 x i64> @llrint_v16i64_v16f32(<16 x float> %x) {
454 ; RV32-LABEL: llrint_v16i64_v16f32:
456 ; RV32-NEXT: addi sp, sp, -400
457 ; RV32-NEXT: .cfi_def_cfa_offset 400
458 ; RV32-NEXT: sw ra, 396(sp) # 4-byte Folded Spill
459 ; RV32-NEXT: sw s0, 392(sp) # 4-byte Folded Spill
460 ; RV32-NEXT: .cfi_offset ra, -4
461 ; RV32-NEXT: .cfi_offset s0, -8
462 ; RV32-NEXT: addi s0, sp, 400
463 ; RV32-NEXT: .cfi_def_cfa s0, 0
464 ; RV32-NEXT: csrr a0, vlenb
465 ; RV32-NEXT: slli a0, a0, 2
466 ; RV32-NEXT: sub sp, sp, a0
467 ; RV32-NEXT: andi sp, sp, -128
468 ; RV32-NEXT: addi a0, sp, 384
469 ; RV32-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
470 ; RV32-NEXT: addi a0, sp, 64
471 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
472 ; RV32-NEXT: vse32.v v8, (a0)
473 ; RV32-NEXT: flw fa0, 124(sp)
474 ; RV32-NEXT: call llrintf
475 ; RV32-NEXT: sw a1, 252(sp)
476 ; RV32-NEXT: sw a0, 248(sp)
477 ; RV32-NEXT: flw fa0, 120(sp)
478 ; RV32-NEXT: call llrintf
479 ; RV32-NEXT: sw a1, 244(sp)
480 ; RV32-NEXT: sw a0, 240(sp)
481 ; RV32-NEXT: flw fa0, 116(sp)
482 ; RV32-NEXT: call llrintf
483 ; RV32-NEXT: sw a1, 236(sp)
484 ; RV32-NEXT: sw a0, 232(sp)
485 ; RV32-NEXT: flw fa0, 112(sp)
486 ; RV32-NEXT: call llrintf
487 ; RV32-NEXT: sw a1, 228(sp)
488 ; RV32-NEXT: sw a0, 224(sp)
489 ; RV32-NEXT: flw fa0, 108(sp)
490 ; RV32-NEXT: call llrintf
491 ; RV32-NEXT: sw a1, 220(sp)
492 ; RV32-NEXT: sw a0, 216(sp)
493 ; RV32-NEXT: flw fa0, 104(sp)
494 ; RV32-NEXT: call llrintf
495 ; RV32-NEXT: sw a1, 212(sp)
496 ; RV32-NEXT: sw a0, 208(sp)
497 ; RV32-NEXT: flw fa0, 100(sp)
498 ; RV32-NEXT: call llrintf
499 ; RV32-NEXT: sw a1, 204(sp)
500 ; RV32-NEXT: sw a0, 200(sp)
501 ; RV32-NEXT: flw fa0, 96(sp)
502 ; RV32-NEXT: call llrintf
503 ; RV32-NEXT: sw a1, 196(sp)
504 ; RV32-NEXT: sw a0, 192(sp)
505 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
506 ; RV32-NEXT: addi a0, sp, 384
507 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
508 ; RV32-NEXT: vfmv.f.s fa0, v8
509 ; RV32-NEXT: call llrintf
510 ; RV32-NEXT: sw a1, 132(sp)
511 ; RV32-NEXT: sw a0, 128(sp)
512 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
513 ; RV32-NEXT: addi a0, sp, 384
514 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
515 ; RV32-NEXT: vslidedown.vi v8, v8, 3
516 ; RV32-NEXT: vfmv.f.s fa0, v8
517 ; RV32-NEXT: call llrintf
518 ; RV32-NEXT: sw a1, 156(sp)
519 ; RV32-NEXT: sw a0, 152(sp)
520 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
521 ; RV32-NEXT: addi a0, sp, 384
522 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
523 ; RV32-NEXT: vslidedown.vi v8, v8, 2
524 ; RV32-NEXT: vfmv.f.s fa0, v8
525 ; RV32-NEXT: call llrintf
526 ; RV32-NEXT: sw a1, 148(sp)
527 ; RV32-NEXT: sw a0, 144(sp)
528 ; RV32-NEXT: vsetivli zero, 1, e32, m1, ta, ma
529 ; RV32-NEXT: addi a0, sp, 384
530 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
531 ; RV32-NEXT: vslidedown.vi v8, v8, 1
532 ; RV32-NEXT: vfmv.f.s fa0, v8
533 ; RV32-NEXT: call llrintf
534 ; RV32-NEXT: sw a1, 140(sp)
535 ; RV32-NEXT: sw a0, 136(sp)
536 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
537 ; RV32-NEXT: addi a0, sp, 384
538 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
539 ; RV32-NEXT: vslidedown.vi v8, v8, 7
540 ; RV32-NEXT: vfmv.f.s fa0, v8
541 ; RV32-NEXT: call llrintf
542 ; RV32-NEXT: sw a1, 188(sp)
543 ; RV32-NEXT: sw a0, 184(sp)
544 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
545 ; RV32-NEXT: addi a0, sp, 384
546 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
547 ; RV32-NEXT: vslidedown.vi v8, v8, 6
548 ; RV32-NEXT: vfmv.f.s fa0, v8
549 ; RV32-NEXT: call llrintf
550 ; RV32-NEXT: sw a1, 180(sp)
551 ; RV32-NEXT: sw a0, 176(sp)
552 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
553 ; RV32-NEXT: addi a0, sp, 384
554 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
555 ; RV32-NEXT: vslidedown.vi v8, v8, 5
556 ; RV32-NEXT: vfmv.f.s fa0, v8
557 ; RV32-NEXT: call llrintf
558 ; RV32-NEXT: sw a1, 172(sp)
559 ; RV32-NEXT: sw a0, 168(sp)
560 ; RV32-NEXT: vsetivli zero, 1, e32, m2, ta, ma
561 ; RV32-NEXT: addi a0, sp, 384
562 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
563 ; RV32-NEXT: vslidedown.vi v8, v8, 4
564 ; RV32-NEXT: vfmv.f.s fa0, v8
565 ; RV32-NEXT: call llrintf
566 ; RV32-NEXT: sw a1, 164(sp)
567 ; RV32-NEXT: sw a0, 160(sp)
568 ; RV32-NEXT: li a0, 32
569 ; RV32-NEXT: addi a1, sp, 128
570 ; RV32-NEXT: vsetvli zero, a0, e32, m8, ta, ma
571 ; RV32-NEXT: vle32.v v8, (a1)
572 ; RV32-NEXT: addi sp, s0, -400
573 ; RV32-NEXT: lw ra, 396(sp) # 4-byte Folded Reload
574 ; RV32-NEXT: lw s0, 392(sp) # 4-byte Folded Reload
575 ; RV32-NEXT: addi sp, sp, 400
578 ; RV64-LABEL: llrint_v16i64_v16f32:
580 ; RV64-NEXT: addi sp, sp, -384
581 ; RV64-NEXT: .cfi_def_cfa_offset 384
582 ; RV64-NEXT: sd ra, 376(sp) # 8-byte Folded Spill
583 ; RV64-NEXT: sd s0, 368(sp) # 8-byte Folded Spill
584 ; RV64-NEXT: .cfi_offset ra, -8
585 ; RV64-NEXT: .cfi_offset s0, -16
586 ; RV64-NEXT: addi s0, sp, 384
587 ; RV64-NEXT: .cfi_def_cfa s0, 0
588 ; RV64-NEXT: andi sp, sp, -128
589 ; RV64-NEXT: addi a0, sp, 64
590 ; RV64-NEXT: vsetivli zero, 16, e32, m4, ta, ma
591 ; RV64-NEXT: vse32.v v8, (a0)
592 ; RV64-NEXT: flw fa5, 124(sp)
593 ; RV64-NEXT: fcvt.l.s a0, fa5
594 ; RV64-NEXT: sd a0, 248(sp)
595 ; RV64-NEXT: flw fa5, 120(sp)
596 ; RV64-NEXT: fcvt.l.s a0, fa5
597 ; RV64-NEXT: sd a0, 240(sp)
598 ; RV64-NEXT: flw fa5, 116(sp)
599 ; RV64-NEXT: fcvt.l.s a0, fa5
600 ; RV64-NEXT: sd a0, 232(sp)
601 ; RV64-NEXT: flw fa5, 112(sp)
602 ; RV64-NEXT: fcvt.l.s a0, fa5
603 ; RV64-NEXT: sd a0, 224(sp)
604 ; RV64-NEXT: flw fa5, 108(sp)
605 ; RV64-NEXT: fcvt.l.s a0, fa5
606 ; RV64-NEXT: sd a0, 216(sp)
607 ; RV64-NEXT: flw fa5, 104(sp)
608 ; RV64-NEXT: fcvt.l.s a0, fa5
609 ; RV64-NEXT: sd a0, 208(sp)
610 ; RV64-NEXT: flw fa5, 100(sp)
611 ; RV64-NEXT: fcvt.l.s a0, fa5
612 ; RV64-NEXT: sd a0, 200(sp)
613 ; RV64-NEXT: flw fa5, 96(sp)
614 ; RV64-NEXT: fcvt.l.s a0, fa5
615 ; RV64-NEXT: sd a0, 192(sp)
616 ; RV64-NEXT: vfmv.f.s fa5, v8
617 ; RV64-NEXT: fcvt.l.s a0, fa5
618 ; RV64-NEXT: sd a0, 128(sp)
619 ; RV64-NEXT: vsetivli zero, 1, e32, m1, ta, ma
620 ; RV64-NEXT: vslidedown.vi v10, v8, 3
621 ; RV64-NEXT: vfmv.f.s fa5, v10
622 ; RV64-NEXT: fcvt.l.s a0, fa5
623 ; RV64-NEXT: sd a0, 152(sp)
624 ; RV64-NEXT: vslidedown.vi v10, v8, 2
625 ; RV64-NEXT: vfmv.f.s fa5, v10
626 ; RV64-NEXT: fcvt.l.s a0, fa5
627 ; RV64-NEXT: sd a0, 144(sp)
628 ; RV64-NEXT: vslidedown.vi v10, v8, 1
629 ; RV64-NEXT: vfmv.f.s fa5, v10
630 ; RV64-NEXT: fcvt.l.s a0, fa5
631 ; RV64-NEXT: sd a0, 136(sp)
632 ; RV64-NEXT: vsetivli zero, 1, e32, m2, ta, ma
633 ; RV64-NEXT: vslidedown.vi v10, v8, 7
634 ; RV64-NEXT: vfmv.f.s fa5, v10
635 ; RV64-NEXT: fcvt.l.s a0, fa5
636 ; RV64-NEXT: sd a0, 184(sp)
637 ; RV64-NEXT: vslidedown.vi v10, v8, 6
638 ; RV64-NEXT: vfmv.f.s fa5, v10
639 ; RV64-NEXT: fcvt.l.s a0, fa5
640 ; RV64-NEXT: sd a0, 176(sp)
641 ; RV64-NEXT: vslidedown.vi v10, v8, 5
642 ; RV64-NEXT: vfmv.f.s fa5, v10
643 ; RV64-NEXT: fcvt.l.s a0, fa5
644 ; RV64-NEXT: sd a0, 168(sp)
645 ; RV64-NEXT: vslidedown.vi v8, v8, 4
646 ; RV64-NEXT: vfmv.f.s fa5, v8
647 ; RV64-NEXT: fcvt.l.s a0, fa5
648 ; RV64-NEXT: sd a0, 160(sp)
649 ; RV64-NEXT: addi a0, sp, 128
650 ; RV64-NEXT: vsetivli zero, 16, e64, m8, ta, ma
651 ; RV64-NEXT: vle64.v v8, (a0)
652 ; RV64-NEXT: addi sp, s0, -384
653 ; RV64-NEXT: ld ra, 376(sp) # 8-byte Folded Reload
654 ; RV64-NEXT: ld s0, 368(sp) # 8-byte Folded Reload
655 ; RV64-NEXT: addi sp, sp, 384
657 %a = call <16 x i64> @llvm.llrint.v16i64.v16f32(<16 x float> %x)
660 declare <16 x i64> @llvm.llrint.v16i64.v16f32(<16 x float>)
662 define <1 x i64> @llrint_v1i64_v1f64(<1 x double> %x) {
663 ; RV32-LABEL: llrint_v1i64_v1f64:
665 ; RV32-NEXT: addi sp, sp, -16
666 ; RV32-NEXT: .cfi_def_cfa_offset 16
667 ; RV32-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
668 ; RV32-NEXT: .cfi_offset ra, -4
669 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
670 ; RV32-NEXT: vfmv.f.s fa0, v8
671 ; RV32-NEXT: call llrint
672 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
673 ; RV32-NEXT: vmv.v.x v8, a0
674 ; RV32-NEXT: vslide1down.vx v8, v8, a1
675 ; RV32-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
676 ; RV32-NEXT: addi sp, sp, 16
679 ; RV64-LABEL: llrint_v1i64_v1f64:
681 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
682 ; RV64-NEXT: vfmv.f.s fa5, v8
683 ; RV64-NEXT: fcvt.l.d a0, fa5
684 ; RV64-NEXT: vmv.s.x v8, a0
686 %a = call <1 x i64> @llvm.llrint.v1i64.v1f64(<1 x double> %x)
689 declare <1 x i64> @llvm.llrint.v1i64.v1f64(<1 x double>)
691 define <2 x i64> @llrint_v2i64_v2f64(<2 x double> %x) {
692 ; RV32-LABEL: llrint_v2i64_v2f64:
694 ; RV32-NEXT: addi sp, sp, -32
695 ; RV32-NEXT: .cfi_def_cfa_offset 32
696 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
697 ; RV32-NEXT: .cfi_offset ra, -4
698 ; RV32-NEXT: csrr a0, vlenb
699 ; RV32-NEXT: slli a0, a0, 1
700 ; RV32-NEXT: sub sp, sp, a0
701 ; RV32-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x02, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 2 * vlenb
702 ; RV32-NEXT: addi a0, sp, 16
703 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
704 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
705 ; RV32-NEXT: vfmv.f.s fa0, v8
706 ; RV32-NEXT: call llrint
707 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
708 ; RV32-NEXT: vmv.v.x v8, a0
709 ; RV32-NEXT: vslide1down.vx v8, v8, a1
710 ; RV32-NEXT: csrr a0, vlenb
711 ; RV32-NEXT: add a0, sp, a0
712 ; RV32-NEXT: addi a0, a0, 16
713 ; RV32-NEXT: vs1r.v v8, (a0) # Unknown-size Folded Spill
714 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
715 ; RV32-NEXT: addi a0, sp, 16
716 ; RV32-NEXT: vl1r.v v8, (a0) # Unknown-size Folded Reload
717 ; RV32-NEXT: vslidedown.vi v8, v8, 1
718 ; RV32-NEXT: vfmv.f.s fa0, v8
719 ; RV32-NEXT: call llrint
720 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
721 ; RV32-NEXT: csrr a2, vlenb
722 ; RV32-NEXT: add a2, sp, a2
723 ; RV32-NEXT: addi a2, a2, 16
724 ; RV32-NEXT: vl1r.v v8, (a2) # Unknown-size Folded Reload
725 ; RV32-NEXT: vslide1down.vx v8, v8, a0
726 ; RV32-NEXT: vslide1down.vx v8, v8, a1
727 ; RV32-NEXT: csrr a0, vlenb
728 ; RV32-NEXT: slli a0, a0, 1
729 ; RV32-NEXT: add sp, sp, a0
730 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
731 ; RV32-NEXT: addi sp, sp, 32
734 ; RV64-LABEL: llrint_v2i64_v2f64:
736 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
737 ; RV64-NEXT: vslidedown.vi v9, v8, 1
738 ; RV64-NEXT: vfmv.f.s fa5, v9
739 ; RV64-NEXT: fcvt.l.d a0, fa5
740 ; RV64-NEXT: vfmv.f.s fa5, v8
741 ; RV64-NEXT: fcvt.l.d a1, fa5
742 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
743 ; RV64-NEXT: vmv.v.x v8, a1
744 ; RV64-NEXT: vslide1down.vx v8, v8, a0
746 %a = call <2 x i64> @llvm.llrint.v2i64.v2f64(<2 x double> %x)
749 declare <2 x i64> @llvm.llrint.v2i64.v2f64(<2 x double>)
751 define <4 x i64> @llrint_v4i64_v4f64(<4 x double> %x) {
752 ; RV32-LABEL: llrint_v4i64_v4f64:
754 ; RV32-NEXT: addi sp, sp, -32
755 ; RV32-NEXT: .cfi_def_cfa_offset 32
756 ; RV32-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
757 ; RV32-NEXT: .cfi_offset ra, -4
758 ; RV32-NEXT: csrr a0, vlenb
759 ; RV32-NEXT: slli a0, a0, 2
760 ; RV32-NEXT: sub sp, sp, a0
761 ; RV32-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x20, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 32 + 4 * vlenb
762 ; RV32-NEXT: csrr a0, vlenb
763 ; RV32-NEXT: slli a0, a0, 1
764 ; RV32-NEXT: add a0, sp, a0
765 ; RV32-NEXT: addi a0, a0, 16
766 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
767 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
768 ; RV32-NEXT: vfmv.f.s fa0, v8
769 ; RV32-NEXT: call llrint
770 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
771 ; RV32-NEXT: vmv.v.x v8, a0
772 ; RV32-NEXT: vslide1down.vx v8, v8, a1
773 ; RV32-NEXT: addi a0, sp, 16
774 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
775 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
776 ; RV32-NEXT: csrr a0, vlenb
777 ; RV32-NEXT: slli a0, a0, 1
778 ; RV32-NEXT: add a0, sp, a0
779 ; RV32-NEXT: addi a0, a0, 16
780 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
781 ; RV32-NEXT: vslidedown.vi v8, v8, 1
782 ; RV32-NEXT: vfmv.f.s fa0, v8
783 ; RV32-NEXT: call llrint
784 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
785 ; RV32-NEXT: addi a2, sp, 16
786 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
787 ; RV32-NEXT: vslide1down.vx v8, v8, a0
788 ; RV32-NEXT: vslide1down.vx v8, v8, a1
789 ; RV32-NEXT: addi a0, sp, 16
790 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
791 ; RV32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
792 ; RV32-NEXT: csrr a0, vlenb
793 ; RV32-NEXT: slli a0, a0, 1
794 ; RV32-NEXT: add a0, sp, a0
795 ; RV32-NEXT: addi a0, a0, 16
796 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
797 ; RV32-NEXT: vslidedown.vi v8, v8, 2
798 ; RV32-NEXT: vfmv.f.s fa0, v8
799 ; RV32-NEXT: call llrint
800 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
801 ; RV32-NEXT: addi a2, sp, 16
802 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
803 ; RV32-NEXT: vslide1down.vx v8, v8, a0
804 ; RV32-NEXT: vslide1down.vx v8, v8, a1
805 ; RV32-NEXT: addi a0, sp, 16
806 ; RV32-NEXT: vs2r.v v8, (a0) # Unknown-size Folded Spill
807 ; RV32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
808 ; RV32-NEXT: csrr a0, vlenb
809 ; RV32-NEXT: slli a0, a0, 1
810 ; RV32-NEXT: add a0, sp, a0
811 ; RV32-NEXT: addi a0, a0, 16
812 ; RV32-NEXT: vl2r.v v8, (a0) # Unknown-size Folded Reload
813 ; RV32-NEXT: vslidedown.vi v8, v8, 3
814 ; RV32-NEXT: vfmv.f.s fa0, v8
815 ; RV32-NEXT: call llrint
816 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
817 ; RV32-NEXT: addi a2, sp, 16
818 ; RV32-NEXT: vl2r.v v8, (a2) # Unknown-size Folded Reload
819 ; RV32-NEXT: vslide1down.vx v8, v8, a0
820 ; RV32-NEXT: vslide1down.vx v8, v8, a1
821 ; RV32-NEXT: csrr a0, vlenb
822 ; RV32-NEXT: slli a0, a0, 2
823 ; RV32-NEXT: add sp, sp, a0
824 ; RV32-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
825 ; RV32-NEXT: addi sp, sp, 32
828 ; RV64-LABEL: llrint_v4i64_v4f64:
830 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
831 ; RV64-NEXT: vslidedown.vi v10, v8, 1
832 ; RV64-NEXT: vfmv.f.s fa5, v10
833 ; RV64-NEXT: fcvt.l.d a0, fa5
834 ; RV64-NEXT: vfmv.f.s fa5, v8
835 ; RV64-NEXT: fcvt.l.d a1, fa5
836 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
837 ; RV64-NEXT: vmv.v.x v10, a1
838 ; RV64-NEXT: vslide1down.vx v10, v10, a0
839 ; RV64-NEXT: vsetivli zero, 1, e64, m2, ta, ma
840 ; RV64-NEXT: vslidedown.vi v12, v8, 2
841 ; RV64-NEXT: vfmv.f.s fa5, v12
842 ; RV64-NEXT: fcvt.l.d a0, fa5
843 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
844 ; RV64-NEXT: vslide1down.vx v10, v10, a0
845 ; RV64-NEXT: vsetivli zero, 1, e64, m2, ta, ma
846 ; RV64-NEXT: vslidedown.vi v8, v8, 3
847 ; RV64-NEXT: vfmv.f.s fa5, v8
848 ; RV64-NEXT: fcvt.l.d a0, fa5
849 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
850 ; RV64-NEXT: vslide1down.vx v8, v10, a0
852 %a = call <4 x i64> @llvm.llrint.v4i64.v4f64(<4 x double> %x)
855 declare <4 x i64> @llvm.llrint.v4i64.v4f64(<4 x double>)
857 define <8 x i64> @llrint_v8i64_v8f64(<8 x double> %x) {
858 ; RV32-LABEL: llrint_v8i64_v8f64:
860 ; RV32-NEXT: addi sp, sp, -272
861 ; RV32-NEXT: .cfi_def_cfa_offset 272
862 ; RV32-NEXT: sw ra, 268(sp) # 4-byte Folded Spill
863 ; RV32-NEXT: sw s0, 264(sp) # 4-byte Folded Spill
864 ; RV32-NEXT: .cfi_offset ra, -4
865 ; RV32-NEXT: .cfi_offset s0, -8
866 ; RV32-NEXT: addi s0, sp, 272
867 ; RV32-NEXT: .cfi_def_cfa s0, 0
868 ; RV32-NEXT: csrr a0, vlenb
869 ; RV32-NEXT: slli a0, a0, 2
870 ; RV32-NEXT: sub sp, sp, a0
871 ; RV32-NEXT: andi sp, sp, -64
872 ; RV32-NEXT: addi a0, sp, 256
873 ; RV32-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
874 ; RV32-NEXT: addi a0, sp, 64
875 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
876 ; RV32-NEXT: vse64.v v8, (a0)
877 ; RV32-NEXT: fld fa0, 120(sp)
878 ; RV32-NEXT: call llrint
879 ; RV32-NEXT: sw a1, 188(sp)
880 ; RV32-NEXT: sw a0, 184(sp)
881 ; RV32-NEXT: fld fa0, 112(sp)
882 ; RV32-NEXT: call llrint
883 ; RV32-NEXT: sw a1, 180(sp)
884 ; RV32-NEXT: sw a0, 176(sp)
885 ; RV32-NEXT: fld fa0, 104(sp)
886 ; RV32-NEXT: call llrint
887 ; RV32-NEXT: sw a1, 172(sp)
888 ; RV32-NEXT: sw a0, 168(sp)
889 ; RV32-NEXT: fld fa0, 96(sp)
890 ; RV32-NEXT: call llrint
891 ; RV32-NEXT: sw a1, 164(sp)
892 ; RV32-NEXT: sw a0, 160(sp)
893 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
894 ; RV32-NEXT: addi a0, sp, 256
895 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
896 ; RV32-NEXT: vfmv.f.s fa0, v8
897 ; RV32-NEXT: call llrint
898 ; RV32-NEXT: sw a1, 132(sp)
899 ; RV32-NEXT: sw a0, 128(sp)
900 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
901 ; RV32-NEXT: addi a0, sp, 256
902 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
903 ; RV32-NEXT: vslidedown.vi v8, v8, 1
904 ; RV32-NEXT: vfmv.f.s fa0, v8
905 ; RV32-NEXT: call llrint
906 ; RV32-NEXT: sw a1, 140(sp)
907 ; RV32-NEXT: sw a0, 136(sp)
908 ; RV32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
909 ; RV32-NEXT: addi a0, sp, 256
910 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
911 ; RV32-NEXT: vslidedown.vi v8, v8, 3
912 ; RV32-NEXT: vfmv.f.s fa0, v8
913 ; RV32-NEXT: call llrint
914 ; RV32-NEXT: sw a1, 156(sp)
915 ; RV32-NEXT: sw a0, 152(sp)
916 ; RV32-NEXT: vsetivli zero, 1, e64, m2, ta, ma
917 ; RV32-NEXT: addi a0, sp, 256
918 ; RV32-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
919 ; RV32-NEXT: vslidedown.vi v8, v8, 2
920 ; RV32-NEXT: vfmv.f.s fa0, v8
921 ; RV32-NEXT: call llrint
922 ; RV32-NEXT: sw a1, 148(sp)
923 ; RV32-NEXT: sw a0, 144(sp)
924 ; RV32-NEXT: addi a0, sp, 128
925 ; RV32-NEXT: vsetivli zero, 16, e32, m4, ta, ma
926 ; RV32-NEXT: vle32.v v8, (a0)
927 ; RV32-NEXT: addi sp, s0, -272
928 ; RV32-NEXT: lw ra, 268(sp) # 4-byte Folded Reload
929 ; RV32-NEXT: lw s0, 264(sp) # 4-byte Folded Reload
930 ; RV32-NEXT: addi sp, sp, 272
933 ; RV64-LABEL: llrint_v8i64_v8f64:
935 ; RV64-NEXT: addi sp, sp, -192
936 ; RV64-NEXT: .cfi_def_cfa_offset 192
937 ; RV64-NEXT: sd ra, 184(sp) # 8-byte Folded Spill
938 ; RV64-NEXT: sd s0, 176(sp) # 8-byte Folded Spill
939 ; RV64-NEXT: .cfi_offset ra, -8
940 ; RV64-NEXT: .cfi_offset s0, -16
941 ; RV64-NEXT: addi s0, sp, 192
942 ; RV64-NEXT: .cfi_def_cfa s0, 0
943 ; RV64-NEXT: andi sp, sp, -64
944 ; RV64-NEXT: mv a0, sp
945 ; RV64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
946 ; RV64-NEXT: vse64.v v8, (a0)
947 ; RV64-NEXT: fld fa5, 56(sp)
948 ; RV64-NEXT: fcvt.l.d a0, fa5
949 ; RV64-NEXT: sd a0, 120(sp)
950 ; RV64-NEXT: fld fa5, 48(sp)
951 ; RV64-NEXT: fcvt.l.d a0, fa5
952 ; RV64-NEXT: sd a0, 112(sp)
953 ; RV64-NEXT: fld fa5, 40(sp)
954 ; RV64-NEXT: fcvt.l.d a0, fa5
955 ; RV64-NEXT: sd a0, 104(sp)
956 ; RV64-NEXT: fld fa5, 32(sp)
957 ; RV64-NEXT: fcvt.l.d a0, fa5
958 ; RV64-NEXT: sd a0, 96(sp)
959 ; RV64-NEXT: vfmv.f.s fa5, v8
960 ; RV64-NEXT: fcvt.l.d a0, fa5
961 ; RV64-NEXT: sd a0, 64(sp)
962 ; RV64-NEXT: vsetivli zero, 1, e64, m1, ta, ma
963 ; RV64-NEXT: vslidedown.vi v10, v8, 1
964 ; RV64-NEXT: vfmv.f.s fa5, v10
965 ; RV64-NEXT: fcvt.l.d a0, fa5
966 ; RV64-NEXT: sd a0, 72(sp)
967 ; RV64-NEXT: vsetivli zero, 1, e64, m2, ta, ma
968 ; RV64-NEXT: vslidedown.vi v10, v8, 3
969 ; RV64-NEXT: vfmv.f.s fa5, v10
970 ; RV64-NEXT: fcvt.l.d a0, fa5
971 ; RV64-NEXT: sd a0, 88(sp)
972 ; RV64-NEXT: vslidedown.vi v8, v8, 2
973 ; RV64-NEXT: vfmv.f.s fa5, v8
974 ; RV64-NEXT: fcvt.l.d a0, fa5
975 ; RV64-NEXT: sd a0, 80(sp)
976 ; RV64-NEXT: addi a0, sp, 64
977 ; RV64-NEXT: vsetivli zero, 8, e64, m4, ta, ma
978 ; RV64-NEXT: vle64.v v8, (a0)
979 ; RV64-NEXT: addi sp, s0, -192
980 ; RV64-NEXT: ld ra, 184(sp) # 8-byte Folded Reload
981 ; RV64-NEXT: ld s0, 176(sp) # 8-byte Folded Reload
982 ; RV64-NEXT: addi sp, sp, 192
984 %a = call <8 x i64> @llvm.llrint.v8i64.v8f64(<8 x double> %x)
987 declare <8 x i64> @llvm.llrint.v8i64.v8f64(<8 x double>)