1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | \
3 ; RUN: FileCheck %s -check-prefix=RV32
4 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | \
5 ; RUN: FileCheck %s -check-prefix=RV64
7 ; ================================================================================
8 ; trunc <vscale x 1 x double>
9 ; ================================================================================
11 declare <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double>)
13 define <vscale x 1 x i8> @trunc_nxv1f64_to_si8(<vscale x 1 x double> %x) {
14 ; RV32-LABEL: trunc_nxv1f64_to_si8:
16 ; RV32-NEXT: lui a0, %hi(.LCPI0_0)
17 ; RV32-NEXT: fld fa5, %lo(.LCPI0_0)(a0)
18 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
19 ; RV32-NEXT: vfabs.v v9, v8
20 ; RV32-NEXT: vmflt.vf v0, v9, fa5
21 ; RV32-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
22 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
23 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
24 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
25 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
26 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
27 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
28 ; RV32-NEXT: vnsrl.wi v8, v9, 0
29 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
30 ; RV32-NEXT: vnsrl.wi v8, v8, 0
33 ; RV64-LABEL: trunc_nxv1f64_to_si8:
35 ; RV64-NEXT: lui a0, %hi(.LCPI0_0)
36 ; RV64-NEXT: fld fa5, %lo(.LCPI0_0)(a0)
37 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
38 ; RV64-NEXT: vfabs.v v9, v8
39 ; RV64-NEXT: vmflt.vf v0, v9, fa5
40 ; RV64-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
41 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
42 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
43 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
44 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
45 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
46 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
47 ; RV64-NEXT: vnsrl.wi v8, v9, 0
48 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
49 ; RV64-NEXT: vnsrl.wi v8, v8, 0
51 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
52 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i8>
53 ret <vscale x 1 x i8> %b
56 define <vscale x 1 x i8> @trunc_nxv1f64_to_ui8(<vscale x 1 x double> %x) {
57 ; RV32-LABEL: trunc_nxv1f64_to_ui8:
59 ; RV32-NEXT: lui a0, %hi(.LCPI1_0)
60 ; RV32-NEXT: fld fa5, %lo(.LCPI1_0)(a0)
61 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
62 ; RV32-NEXT: vfabs.v v9, v8
63 ; RV32-NEXT: vmflt.vf v0, v9, fa5
64 ; RV32-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
65 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
66 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
67 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
68 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
69 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
70 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
71 ; RV32-NEXT: vnsrl.wi v8, v9, 0
72 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
73 ; RV32-NEXT: vnsrl.wi v8, v8, 0
76 ; RV64-LABEL: trunc_nxv1f64_to_ui8:
78 ; RV64-NEXT: lui a0, %hi(.LCPI1_0)
79 ; RV64-NEXT: fld fa5, %lo(.LCPI1_0)(a0)
80 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
81 ; RV64-NEXT: vfabs.v v9, v8
82 ; RV64-NEXT: vmflt.vf v0, v9, fa5
83 ; RV64-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
84 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
85 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
86 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
87 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
88 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
89 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
90 ; RV64-NEXT: vnsrl.wi v8, v9, 0
91 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
92 ; RV64-NEXT: vnsrl.wi v8, v8, 0
94 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
95 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i8>
96 ret <vscale x 1 x i8> %b
99 define <vscale x 1 x i16> @trunc_nxv1f64_to_si16(<vscale x 1 x double> %x) {
100 ; RV32-LABEL: trunc_nxv1f64_to_si16:
102 ; RV32-NEXT: lui a0, %hi(.LCPI2_0)
103 ; RV32-NEXT: fld fa5, %lo(.LCPI2_0)(a0)
104 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
105 ; RV32-NEXT: vfabs.v v9, v8
106 ; RV32-NEXT: vmflt.vf v0, v9, fa5
107 ; RV32-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
108 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
109 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
110 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
111 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
112 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
113 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
114 ; RV32-NEXT: vnsrl.wi v8, v9, 0
117 ; RV64-LABEL: trunc_nxv1f64_to_si16:
119 ; RV64-NEXT: lui a0, %hi(.LCPI2_0)
120 ; RV64-NEXT: fld fa5, %lo(.LCPI2_0)(a0)
121 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
122 ; RV64-NEXT: vfabs.v v9, v8
123 ; RV64-NEXT: vmflt.vf v0, v9, fa5
124 ; RV64-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
125 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
126 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
127 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
128 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
129 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
130 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
131 ; RV64-NEXT: vnsrl.wi v8, v9, 0
133 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
134 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i16>
135 ret <vscale x 1 x i16> %b
138 define <vscale x 1 x i16> @trunc_nxv1f64_to_ui16(<vscale x 1 x double> %x) {
139 ; RV32-LABEL: trunc_nxv1f64_to_ui16:
141 ; RV32-NEXT: lui a0, %hi(.LCPI3_0)
142 ; RV32-NEXT: fld fa5, %lo(.LCPI3_0)(a0)
143 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
144 ; RV32-NEXT: vfabs.v v9, v8
145 ; RV32-NEXT: vmflt.vf v0, v9, fa5
146 ; RV32-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
147 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
148 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
149 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
150 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
151 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
152 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
153 ; RV32-NEXT: vnsrl.wi v8, v9, 0
156 ; RV64-LABEL: trunc_nxv1f64_to_ui16:
158 ; RV64-NEXT: lui a0, %hi(.LCPI3_0)
159 ; RV64-NEXT: fld fa5, %lo(.LCPI3_0)(a0)
160 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
161 ; RV64-NEXT: vfabs.v v9, v8
162 ; RV64-NEXT: vmflt.vf v0, v9, fa5
163 ; RV64-NEXT: vfcvt.rtz.x.f.v v9, v8, v0.t
164 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
165 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
166 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
167 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
168 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
169 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
170 ; RV64-NEXT: vnsrl.wi v8, v9, 0
172 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
173 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i16>
174 ret <vscale x 1 x i16> %b
177 define <vscale x 1 x i32> @trunc_nxv1f64_to_si32(<vscale x 1 x double> %x) {
178 ; RV32-LABEL: trunc_nxv1f64_to_si32:
180 ; RV32-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
181 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
182 ; RV32-NEXT: vmv1r.v v8, v9
185 ; RV64-LABEL: trunc_nxv1f64_to_si32:
187 ; RV64-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
188 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
189 ; RV64-NEXT: vmv1r.v v8, v9
191 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
192 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i32>
193 ret <vscale x 1 x i32> %b
196 define <vscale x 1 x i32> @trunc_nxv1f64_to_ui32(<vscale x 1 x double> %x) {
197 ; RV32-LABEL: trunc_nxv1f64_to_ui32:
199 ; RV32-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
200 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
201 ; RV32-NEXT: vmv1r.v v8, v9
204 ; RV64-LABEL: trunc_nxv1f64_to_ui32:
206 ; RV64-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
207 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
208 ; RV64-NEXT: vmv1r.v v8, v9
210 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
211 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i32>
212 ret <vscale x 1 x i32> %b
215 define <vscale x 1 x i64> @trunc_nxv1f64_to_si64(<vscale x 1 x double> %x) {
216 ; RV32-LABEL: trunc_nxv1f64_to_si64:
218 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
219 ; RV32-NEXT: vfcvt.rtz.x.f.v v8, v8
222 ; RV64-LABEL: trunc_nxv1f64_to_si64:
224 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
225 ; RV64-NEXT: vfcvt.rtz.x.f.v v8, v8
227 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
228 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i64>
229 ret <vscale x 1 x i64> %b
232 define <vscale x 1 x i64> @trunc_nxv1f64_to_ui64(<vscale x 1 x double> %x) {
233 ; RV32-LABEL: trunc_nxv1f64_to_ui64:
235 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
236 ; RV32-NEXT: vfcvt.rtz.xu.f.v v8, v8
239 ; RV64-LABEL: trunc_nxv1f64_to_ui64:
241 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
242 ; RV64-NEXT: vfcvt.rtz.xu.f.v v8, v8
244 %a = call <vscale x 1 x double> @llvm.trunc.nxv1f64(<vscale x 1 x double> %x)
245 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i64>
246 ret <vscale x 1 x i64> %b
249 ; ================================================================================
250 ; trunc <vscale x 4 x double>
251 ; ================================================================================
253 declare <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double>)
255 define <vscale x 4 x i8> @trunc_nxv4f64_to_si8(<vscale x 4 x double> %x) {
256 ; RV32-LABEL: trunc_nxv4f64_to_si8:
258 ; RV32-NEXT: lui a0, %hi(.LCPI8_0)
259 ; RV32-NEXT: fld fa5, %lo(.LCPI8_0)(a0)
260 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
261 ; RV32-NEXT: vfabs.v v12, v8
262 ; RV32-NEXT: vmflt.vf v0, v12, fa5
263 ; RV32-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
264 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
265 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
266 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
267 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
268 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
269 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
270 ; RV32-NEXT: vnsrl.wi v8, v12, 0
271 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
272 ; RV32-NEXT: vnsrl.wi v8, v8, 0
275 ; RV64-LABEL: trunc_nxv4f64_to_si8:
277 ; RV64-NEXT: lui a0, %hi(.LCPI8_0)
278 ; RV64-NEXT: fld fa5, %lo(.LCPI8_0)(a0)
279 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
280 ; RV64-NEXT: vfabs.v v12, v8
281 ; RV64-NEXT: vmflt.vf v0, v12, fa5
282 ; RV64-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
283 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
284 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
285 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
286 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
287 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
288 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
289 ; RV64-NEXT: vnsrl.wi v8, v12, 0
290 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
291 ; RV64-NEXT: vnsrl.wi v8, v8, 0
293 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
294 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i8>
295 ret <vscale x 4 x i8> %b
298 define <vscale x 4 x i8> @trunc_nxv4f64_to_ui8(<vscale x 4 x double> %x) {
299 ; RV32-LABEL: trunc_nxv4f64_to_ui8:
301 ; RV32-NEXT: lui a0, %hi(.LCPI9_0)
302 ; RV32-NEXT: fld fa5, %lo(.LCPI9_0)(a0)
303 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
304 ; RV32-NEXT: vfabs.v v12, v8
305 ; RV32-NEXT: vmflt.vf v0, v12, fa5
306 ; RV32-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
307 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
308 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
309 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
310 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
311 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
312 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
313 ; RV32-NEXT: vnsrl.wi v8, v12, 0
314 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
315 ; RV32-NEXT: vnsrl.wi v8, v8, 0
318 ; RV64-LABEL: trunc_nxv4f64_to_ui8:
320 ; RV64-NEXT: lui a0, %hi(.LCPI9_0)
321 ; RV64-NEXT: fld fa5, %lo(.LCPI9_0)(a0)
322 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
323 ; RV64-NEXT: vfabs.v v12, v8
324 ; RV64-NEXT: vmflt.vf v0, v12, fa5
325 ; RV64-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
326 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
327 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
328 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
329 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
330 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
331 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
332 ; RV64-NEXT: vnsrl.wi v8, v12, 0
333 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
334 ; RV64-NEXT: vnsrl.wi v8, v8, 0
336 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
337 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i8>
338 ret <vscale x 4 x i8> %b
341 define <vscale x 4 x i16> @trunc_nxv4f64_to_si16(<vscale x 4 x double> %x) {
342 ; RV32-LABEL: trunc_nxv4f64_to_si16:
344 ; RV32-NEXT: lui a0, %hi(.LCPI10_0)
345 ; RV32-NEXT: fld fa5, %lo(.LCPI10_0)(a0)
346 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
347 ; RV32-NEXT: vfabs.v v12, v8
348 ; RV32-NEXT: vmflt.vf v0, v12, fa5
349 ; RV32-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
350 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
351 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
352 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
353 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
354 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
355 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
356 ; RV32-NEXT: vnsrl.wi v8, v12, 0
359 ; RV64-LABEL: trunc_nxv4f64_to_si16:
361 ; RV64-NEXT: lui a0, %hi(.LCPI10_0)
362 ; RV64-NEXT: fld fa5, %lo(.LCPI10_0)(a0)
363 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
364 ; RV64-NEXT: vfabs.v v12, v8
365 ; RV64-NEXT: vmflt.vf v0, v12, fa5
366 ; RV64-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
367 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
368 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
369 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
370 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
371 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
372 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
373 ; RV64-NEXT: vnsrl.wi v8, v12, 0
375 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
376 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i16>
377 ret <vscale x 4 x i16> %b
380 define <vscale x 4 x i16> @trunc_nxv4f64_to_ui16(<vscale x 4 x double> %x) {
381 ; RV32-LABEL: trunc_nxv4f64_to_ui16:
383 ; RV32-NEXT: lui a0, %hi(.LCPI11_0)
384 ; RV32-NEXT: fld fa5, %lo(.LCPI11_0)(a0)
385 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
386 ; RV32-NEXT: vfabs.v v12, v8
387 ; RV32-NEXT: vmflt.vf v0, v12, fa5
388 ; RV32-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
389 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
390 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
391 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
392 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
393 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
394 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
395 ; RV32-NEXT: vnsrl.wi v8, v12, 0
398 ; RV64-LABEL: trunc_nxv4f64_to_ui16:
400 ; RV64-NEXT: lui a0, %hi(.LCPI11_0)
401 ; RV64-NEXT: fld fa5, %lo(.LCPI11_0)(a0)
402 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
403 ; RV64-NEXT: vfabs.v v12, v8
404 ; RV64-NEXT: vmflt.vf v0, v12, fa5
405 ; RV64-NEXT: vfcvt.rtz.x.f.v v12, v8, v0.t
406 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
407 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
408 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
409 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
410 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
411 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
412 ; RV64-NEXT: vnsrl.wi v8, v12, 0
414 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
415 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i16>
416 ret <vscale x 4 x i16> %b
419 define <vscale x 4 x i32> @trunc_nxv4f64_to_si32(<vscale x 4 x double> %x) {
420 ; RV32-LABEL: trunc_nxv4f64_to_si32:
422 ; RV32-NEXT: vsetvli a0, zero, e32, m2, ta, ma
423 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
424 ; RV32-NEXT: vmv.v.v v8, v12
427 ; RV64-LABEL: trunc_nxv4f64_to_si32:
429 ; RV64-NEXT: vsetvli a0, zero, e32, m2, ta, ma
430 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
431 ; RV64-NEXT: vmv.v.v v8, v12
433 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
434 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i32>
435 ret <vscale x 4 x i32> %b
438 define <vscale x 4 x i32> @trunc_nxv4f64_to_ui32(<vscale x 4 x double> %x) {
439 ; RV32-LABEL: trunc_nxv4f64_to_ui32:
441 ; RV32-NEXT: vsetvli a0, zero, e32, m2, ta, ma
442 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
443 ; RV32-NEXT: vmv.v.v v8, v12
446 ; RV64-LABEL: trunc_nxv4f64_to_ui32:
448 ; RV64-NEXT: vsetvli a0, zero, e32, m2, ta, ma
449 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
450 ; RV64-NEXT: vmv.v.v v8, v12
452 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
453 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i32>
454 ret <vscale x 4 x i32> %b
457 define <vscale x 4 x i64> @trunc_nxv4f64_to_si64(<vscale x 4 x double> %x) {
458 ; RV32-LABEL: trunc_nxv4f64_to_si64:
460 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
461 ; RV32-NEXT: vfcvt.rtz.x.f.v v8, v8
464 ; RV64-LABEL: trunc_nxv4f64_to_si64:
466 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
467 ; RV64-NEXT: vfcvt.rtz.x.f.v v8, v8
469 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
470 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i64>
471 ret <vscale x 4 x i64> %b
474 define <vscale x 4 x i64> @trunc_nxv4f64_to_ui64(<vscale x 4 x double> %x) {
475 ; RV32-LABEL: trunc_nxv4f64_to_ui64:
477 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
478 ; RV32-NEXT: vfcvt.rtz.xu.f.v v8, v8
481 ; RV64-LABEL: trunc_nxv4f64_to_ui64:
483 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
484 ; RV64-NEXT: vfcvt.rtz.xu.f.v v8, v8
486 %a = call <vscale x 4 x double> @llvm.trunc.nxv4f64(<vscale x 4 x double> %x)
487 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i64>
488 ret <vscale x 4 x i64> %b
491 ; ================================================================================
492 ; ceil <vscale x 1 x double>
493 ; ================================================================================
495 declare <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double>)
497 define <vscale x 1 x i8> @ceil_nxv1f64_to_si8(<vscale x 1 x double> %x) {
498 ; RV32-LABEL: ceil_nxv1f64_to_si8:
500 ; RV32-NEXT: lui a0, %hi(.LCPI16_0)
501 ; RV32-NEXT: fld fa5, %lo(.LCPI16_0)(a0)
502 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
503 ; RV32-NEXT: vfabs.v v9, v8
504 ; RV32-NEXT: vmflt.vf v0, v9, fa5
505 ; RV32-NEXT: fsrmi a0, 3
506 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
508 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
509 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
510 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
511 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
512 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
513 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
514 ; RV32-NEXT: vnsrl.wi v8, v9, 0
515 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
516 ; RV32-NEXT: vnsrl.wi v8, v8, 0
519 ; RV64-LABEL: ceil_nxv1f64_to_si8:
521 ; RV64-NEXT: lui a0, %hi(.LCPI16_0)
522 ; RV64-NEXT: fld fa5, %lo(.LCPI16_0)(a0)
523 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
524 ; RV64-NEXT: vfabs.v v9, v8
525 ; RV64-NEXT: vmflt.vf v0, v9, fa5
526 ; RV64-NEXT: fsrmi a0, 3
527 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
529 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
530 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
531 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
532 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
533 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
534 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
535 ; RV64-NEXT: vnsrl.wi v8, v9, 0
536 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
537 ; RV64-NEXT: vnsrl.wi v8, v8, 0
539 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
540 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i8>
541 ret <vscale x 1 x i8> %b
544 define <vscale x 1 x i8> @ceil_nxv1f64_to_ui8(<vscale x 1 x double> %x) {
545 ; RV32-LABEL: ceil_nxv1f64_to_ui8:
547 ; RV32-NEXT: lui a0, %hi(.LCPI17_0)
548 ; RV32-NEXT: fld fa5, %lo(.LCPI17_0)(a0)
549 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
550 ; RV32-NEXT: vfabs.v v9, v8
551 ; RV32-NEXT: vmflt.vf v0, v9, fa5
552 ; RV32-NEXT: fsrmi a0, 3
553 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
555 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
556 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
557 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
558 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
559 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
560 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
561 ; RV32-NEXT: vnsrl.wi v8, v9, 0
562 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
563 ; RV32-NEXT: vnsrl.wi v8, v8, 0
566 ; RV64-LABEL: ceil_nxv1f64_to_ui8:
568 ; RV64-NEXT: lui a0, %hi(.LCPI17_0)
569 ; RV64-NEXT: fld fa5, %lo(.LCPI17_0)(a0)
570 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
571 ; RV64-NEXT: vfabs.v v9, v8
572 ; RV64-NEXT: vmflt.vf v0, v9, fa5
573 ; RV64-NEXT: fsrmi a0, 3
574 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
576 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
577 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
578 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
579 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
580 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
581 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
582 ; RV64-NEXT: vnsrl.wi v8, v9, 0
583 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
584 ; RV64-NEXT: vnsrl.wi v8, v8, 0
586 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
587 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i8>
588 ret <vscale x 1 x i8> %b
591 define <vscale x 1 x i16> @ceil_nxv1f64_to_si16(<vscale x 1 x double> %x) {
592 ; RV32-LABEL: ceil_nxv1f64_to_si16:
594 ; RV32-NEXT: lui a0, %hi(.LCPI18_0)
595 ; RV32-NEXT: fld fa5, %lo(.LCPI18_0)(a0)
596 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
597 ; RV32-NEXT: vfabs.v v9, v8
598 ; RV32-NEXT: vmflt.vf v0, v9, fa5
599 ; RV32-NEXT: fsrmi a0, 3
600 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
602 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
603 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
604 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
605 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
606 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
607 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
608 ; RV32-NEXT: vnsrl.wi v8, v9, 0
611 ; RV64-LABEL: ceil_nxv1f64_to_si16:
613 ; RV64-NEXT: lui a0, %hi(.LCPI18_0)
614 ; RV64-NEXT: fld fa5, %lo(.LCPI18_0)(a0)
615 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
616 ; RV64-NEXT: vfabs.v v9, v8
617 ; RV64-NEXT: vmflt.vf v0, v9, fa5
618 ; RV64-NEXT: fsrmi a0, 3
619 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
621 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
622 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
623 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
624 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
625 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
626 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
627 ; RV64-NEXT: vnsrl.wi v8, v9, 0
629 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
630 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i16>
631 ret <vscale x 1 x i16> %b
634 define <vscale x 1 x i16> @ceil_nxv1f64_to_ui16(<vscale x 1 x double> %x) {
635 ; RV32-LABEL: ceil_nxv1f64_to_ui16:
637 ; RV32-NEXT: lui a0, %hi(.LCPI19_0)
638 ; RV32-NEXT: fld fa5, %lo(.LCPI19_0)(a0)
639 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
640 ; RV32-NEXT: vfabs.v v9, v8
641 ; RV32-NEXT: vmflt.vf v0, v9, fa5
642 ; RV32-NEXT: fsrmi a0, 3
643 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
645 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
646 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
647 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
648 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
649 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
650 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
651 ; RV32-NEXT: vnsrl.wi v8, v9, 0
654 ; RV64-LABEL: ceil_nxv1f64_to_ui16:
656 ; RV64-NEXT: lui a0, %hi(.LCPI19_0)
657 ; RV64-NEXT: fld fa5, %lo(.LCPI19_0)(a0)
658 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
659 ; RV64-NEXT: vfabs.v v9, v8
660 ; RV64-NEXT: vmflt.vf v0, v9, fa5
661 ; RV64-NEXT: fsrmi a0, 3
662 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
664 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
665 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
666 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
667 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
668 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
669 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
670 ; RV64-NEXT: vnsrl.wi v8, v9, 0
672 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
673 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i16>
674 ret <vscale x 1 x i16> %b
677 define <vscale x 1 x i32> @ceil_nxv1f64_to_si32(<vscale x 1 x double> %x) {
678 ; RV32-LABEL: ceil_nxv1f64_to_si32:
680 ; RV32-NEXT: fsrmi a0, 3
681 ; RV32-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
682 ; RV32-NEXT: vfncvt.x.f.w v9, v8
684 ; RV32-NEXT: vmv1r.v v8, v9
687 ; RV64-LABEL: ceil_nxv1f64_to_si32:
689 ; RV64-NEXT: fsrmi a0, 3
690 ; RV64-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
691 ; RV64-NEXT: vfncvt.x.f.w v9, v8
693 ; RV64-NEXT: vmv1r.v v8, v9
695 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
696 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i32>
697 ret <vscale x 1 x i32> %b
700 define <vscale x 1 x i32> @ceil_nxv1f64_to_ui32(<vscale x 1 x double> %x) {
701 ; RV32-LABEL: ceil_nxv1f64_to_ui32:
703 ; RV32-NEXT: fsrmi a0, 3
704 ; RV32-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
705 ; RV32-NEXT: vfncvt.xu.f.w v9, v8
707 ; RV32-NEXT: vmv1r.v v8, v9
710 ; RV64-LABEL: ceil_nxv1f64_to_ui32:
712 ; RV64-NEXT: fsrmi a0, 3
713 ; RV64-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
714 ; RV64-NEXT: vfncvt.xu.f.w v9, v8
716 ; RV64-NEXT: vmv1r.v v8, v9
718 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
719 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i32>
720 ret <vscale x 1 x i32> %b
723 define <vscale x 1 x i64> @ceil_nxv1f64_to_si64(<vscale x 1 x double> %x) {
724 ; RV32-LABEL: ceil_nxv1f64_to_si64:
726 ; RV32-NEXT: fsrmi a0, 3
727 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
728 ; RV32-NEXT: vfcvt.x.f.v v8, v8
732 ; RV64-LABEL: ceil_nxv1f64_to_si64:
734 ; RV64-NEXT: fsrmi a0, 3
735 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
736 ; RV64-NEXT: vfcvt.x.f.v v8, v8
739 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
740 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i64>
741 ret <vscale x 1 x i64> %b
744 define <vscale x 1 x i64> @ceil_nxv1f64_to_ui64(<vscale x 1 x double> %x) {
745 ; RV32-LABEL: ceil_nxv1f64_to_ui64:
747 ; RV32-NEXT: fsrmi a0, 3
748 ; RV32-NEXT: vsetvli a1, zero, e64, m1, ta, ma
749 ; RV32-NEXT: vfcvt.xu.f.v v8, v8
753 ; RV64-LABEL: ceil_nxv1f64_to_ui64:
755 ; RV64-NEXT: fsrmi a0, 3
756 ; RV64-NEXT: vsetvli a1, zero, e64, m1, ta, ma
757 ; RV64-NEXT: vfcvt.xu.f.v v8, v8
760 %a = call <vscale x 1 x double> @llvm.ceil.nxv1f64(<vscale x 1 x double> %x)
761 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i64>
762 ret <vscale x 1 x i64> %b
765 ; ================================================================================
766 ; ceil <vscale x 4 x double>
767 ; ================================================================================
769 declare <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double>)
771 define <vscale x 4 x i8> @ceil_nxv4f64_to_si8(<vscale x 4 x double> %x) {
772 ; RV32-LABEL: ceil_nxv4f64_to_si8:
774 ; RV32-NEXT: lui a0, %hi(.LCPI24_0)
775 ; RV32-NEXT: fld fa5, %lo(.LCPI24_0)(a0)
776 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
777 ; RV32-NEXT: vfabs.v v12, v8
778 ; RV32-NEXT: vmflt.vf v0, v12, fa5
779 ; RV32-NEXT: fsrmi a0, 3
780 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
782 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
783 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
784 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
785 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
786 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
787 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
788 ; RV32-NEXT: vnsrl.wi v8, v12, 0
789 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
790 ; RV32-NEXT: vnsrl.wi v8, v8, 0
793 ; RV64-LABEL: ceil_nxv4f64_to_si8:
795 ; RV64-NEXT: lui a0, %hi(.LCPI24_0)
796 ; RV64-NEXT: fld fa5, %lo(.LCPI24_0)(a0)
797 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
798 ; RV64-NEXT: vfabs.v v12, v8
799 ; RV64-NEXT: vmflt.vf v0, v12, fa5
800 ; RV64-NEXT: fsrmi a0, 3
801 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
803 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
804 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
805 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
806 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
807 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
808 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
809 ; RV64-NEXT: vnsrl.wi v8, v12, 0
810 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
811 ; RV64-NEXT: vnsrl.wi v8, v8, 0
813 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
814 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i8>
815 ret <vscale x 4 x i8> %b
818 define <vscale x 4 x i8> @ceil_nxv4f64_to_ui8(<vscale x 4 x double> %x) {
819 ; RV32-LABEL: ceil_nxv4f64_to_ui8:
821 ; RV32-NEXT: lui a0, %hi(.LCPI25_0)
822 ; RV32-NEXT: fld fa5, %lo(.LCPI25_0)(a0)
823 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
824 ; RV32-NEXT: vfabs.v v12, v8
825 ; RV32-NEXT: vmflt.vf v0, v12, fa5
826 ; RV32-NEXT: fsrmi a0, 3
827 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
829 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
830 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
831 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
832 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
833 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
834 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
835 ; RV32-NEXT: vnsrl.wi v8, v12, 0
836 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
837 ; RV32-NEXT: vnsrl.wi v8, v8, 0
840 ; RV64-LABEL: ceil_nxv4f64_to_ui8:
842 ; RV64-NEXT: lui a0, %hi(.LCPI25_0)
843 ; RV64-NEXT: fld fa5, %lo(.LCPI25_0)(a0)
844 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
845 ; RV64-NEXT: vfabs.v v12, v8
846 ; RV64-NEXT: vmflt.vf v0, v12, fa5
847 ; RV64-NEXT: fsrmi a0, 3
848 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
850 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
851 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
852 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
853 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
854 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
855 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
856 ; RV64-NEXT: vnsrl.wi v8, v12, 0
857 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
858 ; RV64-NEXT: vnsrl.wi v8, v8, 0
860 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
861 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i8>
862 ret <vscale x 4 x i8> %b
865 define <vscale x 4 x i16> @ceil_nxv4f64_to_si16(<vscale x 4 x double> %x) {
866 ; RV32-LABEL: ceil_nxv4f64_to_si16:
868 ; RV32-NEXT: lui a0, %hi(.LCPI26_0)
869 ; RV32-NEXT: fld fa5, %lo(.LCPI26_0)(a0)
870 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
871 ; RV32-NEXT: vfabs.v v12, v8
872 ; RV32-NEXT: vmflt.vf v0, v12, fa5
873 ; RV32-NEXT: fsrmi a0, 3
874 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
876 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
877 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
878 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
879 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
880 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
881 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
882 ; RV32-NEXT: vnsrl.wi v8, v12, 0
885 ; RV64-LABEL: ceil_nxv4f64_to_si16:
887 ; RV64-NEXT: lui a0, %hi(.LCPI26_0)
888 ; RV64-NEXT: fld fa5, %lo(.LCPI26_0)(a0)
889 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
890 ; RV64-NEXT: vfabs.v v12, v8
891 ; RV64-NEXT: vmflt.vf v0, v12, fa5
892 ; RV64-NEXT: fsrmi a0, 3
893 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
895 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
896 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
897 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
898 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
899 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
900 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
901 ; RV64-NEXT: vnsrl.wi v8, v12, 0
903 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
904 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i16>
905 ret <vscale x 4 x i16> %b
908 define <vscale x 4 x i16> @ceil_nxv4f64_to_ui16(<vscale x 4 x double> %x) {
909 ; RV32-LABEL: ceil_nxv4f64_to_ui16:
911 ; RV32-NEXT: lui a0, %hi(.LCPI27_0)
912 ; RV32-NEXT: fld fa5, %lo(.LCPI27_0)(a0)
913 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
914 ; RV32-NEXT: vfabs.v v12, v8
915 ; RV32-NEXT: vmflt.vf v0, v12, fa5
916 ; RV32-NEXT: fsrmi a0, 3
917 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
919 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
920 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
921 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
922 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
923 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
924 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
925 ; RV32-NEXT: vnsrl.wi v8, v12, 0
928 ; RV64-LABEL: ceil_nxv4f64_to_ui16:
930 ; RV64-NEXT: lui a0, %hi(.LCPI27_0)
931 ; RV64-NEXT: fld fa5, %lo(.LCPI27_0)(a0)
932 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
933 ; RV64-NEXT: vfabs.v v12, v8
934 ; RV64-NEXT: vmflt.vf v0, v12, fa5
935 ; RV64-NEXT: fsrmi a0, 3
936 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
938 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
939 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
940 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
941 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
942 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
943 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
944 ; RV64-NEXT: vnsrl.wi v8, v12, 0
946 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
947 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i16>
948 ret <vscale x 4 x i16> %b
951 define <vscale x 4 x i32> @ceil_nxv4f64_to_si32(<vscale x 4 x double> %x) {
952 ; RV32-LABEL: ceil_nxv4f64_to_si32:
954 ; RV32-NEXT: fsrmi a0, 3
955 ; RV32-NEXT: vsetvli a1, zero, e32, m2, ta, ma
956 ; RV32-NEXT: vfncvt.x.f.w v12, v8
958 ; RV32-NEXT: vmv.v.v v8, v12
961 ; RV64-LABEL: ceil_nxv4f64_to_si32:
963 ; RV64-NEXT: fsrmi a0, 3
964 ; RV64-NEXT: vsetvli a1, zero, e32, m2, ta, ma
965 ; RV64-NEXT: vfncvt.x.f.w v12, v8
967 ; RV64-NEXT: vmv.v.v v8, v12
969 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
970 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i32>
971 ret <vscale x 4 x i32> %b
974 define <vscale x 4 x i32> @ceil_nxv4f64_to_ui32(<vscale x 4 x double> %x) {
975 ; RV32-LABEL: ceil_nxv4f64_to_ui32:
977 ; RV32-NEXT: fsrmi a0, 3
978 ; RV32-NEXT: vsetvli a1, zero, e32, m2, ta, ma
979 ; RV32-NEXT: vfncvt.xu.f.w v12, v8
981 ; RV32-NEXT: vmv.v.v v8, v12
984 ; RV64-LABEL: ceil_nxv4f64_to_ui32:
986 ; RV64-NEXT: fsrmi a0, 3
987 ; RV64-NEXT: vsetvli a1, zero, e32, m2, ta, ma
988 ; RV64-NEXT: vfncvt.xu.f.w v12, v8
990 ; RV64-NEXT: vmv.v.v v8, v12
992 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
993 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i32>
994 ret <vscale x 4 x i32> %b
997 define <vscale x 4 x i64> @ceil_nxv4f64_to_si64(<vscale x 4 x double> %x) {
998 ; RV32-LABEL: ceil_nxv4f64_to_si64:
1000 ; RV32-NEXT: fsrmi a0, 3
1001 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1002 ; RV32-NEXT: vfcvt.x.f.v v8, v8
1003 ; RV32-NEXT: fsrm a0
1006 ; RV64-LABEL: ceil_nxv4f64_to_si64:
1008 ; RV64-NEXT: fsrmi a0, 3
1009 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1010 ; RV64-NEXT: vfcvt.x.f.v v8, v8
1011 ; RV64-NEXT: fsrm a0
1013 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
1014 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i64>
1015 ret <vscale x 4 x i64> %b
1018 define <vscale x 4 x i64> @ceil_nxv4f64_to_ui64(<vscale x 4 x double> %x) {
1019 ; RV32-LABEL: ceil_nxv4f64_to_ui64:
1021 ; RV32-NEXT: fsrmi a0, 3
1022 ; RV32-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1023 ; RV32-NEXT: vfcvt.xu.f.v v8, v8
1024 ; RV32-NEXT: fsrm a0
1027 ; RV64-LABEL: ceil_nxv4f64_to_ui64:
1029 ; RV64-NEXT: fsrmi a0, 3
1030 ; RV64-NEXT: vsetvli a1, zero, e64, m4, ta, ma
1031 ; RV64-NEXT: vfcvt.xu.f.v v8, v8
1032 ; RV64-NEXT: fsrm a0
1034 %a = call <vscale x 4 x double> @llvm.ceil.nxv4f64(<vscale x 4 x double> %x)
1035 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i64>
1036 ret <vscale x 4 x i64> %b
1039 ; ================================================================================
1040 ; rint <vscale x 1 x double>
1041 ; ================================================================================
1043 declare <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double>)
1045 define <vscale x 1 x i8> @rint_nxv1f64_to_si8(<vscale x 1 x double> %x) {
1046 ; RV32-LABEL: rint_nxv1f64_to_si8:
1048 ; RV32-NEXT: lui a0, %hi(.LCPI32_0)
1049 ; RV32-NEXT: fld fa5, %lo(.LCPI32_0)(a0)
1050 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1051 ; RV32-NEXT: vfabs.v v9, v8
1052 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1053 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1054 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1055 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1056 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1057 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1058 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
1059 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1060 ; RV32-NEXT: vnsrl.wi v8, v9, 0
1061 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1062 ; RV32-NEXT: vnsrl.wi v8, v8, 0
1065 ; RV64-LABEL: rint_nxv1f64_to_si8:
1067 ; RV64-NEXT: lui a0, %hi(.LCPI32_0)
1068 ; RV64-NEXT: fld fa5, %lo(.LCPI32_0)(a0)
1069 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1070 ; RV64-NEXT: vfabs.v v9, v8
1071 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1072 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1073 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1074 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1075 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1076 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1077 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
1078 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1079 ; RV64-NEXT: vnsrl.wi v8, v9, 0
1080 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1081 ; RV64-NEXT: vnsrl.wi v8, v8, 0
1083 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1084 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i8>
1085 ret <vscale x 1 x i8> %b
1088 define <vscale x 1 x i8> @rint_nxv1f64_to_ui8(<vscale x 1 x double> %x) {
1089 ; RV32-LABEL: rint_nxv1f64_to_ui8:
1091 ; RV32-NEXT: lui a0, %hi(.LCPI33_0)
1092 ; RV32-NEXT: fld fa5, %lo(.LCPI33_0)(a0)
1093 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1094 ; RV32-NEXT: vfabs.v v9, v8
1095 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1096 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1097 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1098 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1099 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1100 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1101 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
1102 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1103 ; RV32-NEXT: vnsrl.wi v8, v9, 0
1104 ; RV32-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1105 ; RV32-NEXT: vnsrl.wi v8, v8, 0
1108 ; RV64-LABEL: rint_nxv1f64_to_ui8:
1110 ; RV64-NEXT: lui a0, %hi(.LCPI33_0)
1111 ; RV64-NEXT: fld fa5, %lo(.LCPI33_0)(a0)
1112 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1113 ; RV64-NEXT: vfabs.v v9, v8
1114 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1115 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1116 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1117 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1118 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1119 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1120 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
1121 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1122 ; RV64-NEXT: vnsrl.wi v8, v9, 0
1123 ; RV64-NEXT: vsetvli zero, zero, e8, mf8, ta, ma
1124 ; RV64-NEXT: vnsrl.wi v8, v8, 0
1126 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1127 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i8>
1128 ret <vscale x 1 x i8> %b
1131 define <vscale x 1 x i16> @rint_nxv1f64_to_si16(<vscale x 1 x double> %x) {
1132 ; RV32-LABEL: rint_nxv1f64_to_si16:
1134 ; RV32-NEXT: lui a0, %hi(.LCPI34_0)
1135 ; RV32-NEXT: fld fa5, %lo(.LCPI34_0)(a0)
1136 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1137 ; RV32-NEXT: vfabs.v v9, v8
1138 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1139 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1140 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1141 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1142 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1143 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1144 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
1145 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1146 ; RV32-NEXT: vnsrl.wi v8, v9, 0
1149 ; RV64-LABEL: rint_nxv1f64_to_si16:
1151 ; RV64-NEXT: lui a0, %hi(.LCPI34_0)
1152 ; RV64-NEXT: fld fa5, %lo(.LCPI34_0)(a0)
1153 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1154 ; RV64-NEXT: vfabs.v v9, v8
1155 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1156 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1157 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1158 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1159 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1160 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1161 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
1162 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1163 ; RV64-NEXT: vnsrl.wi v8, v9, 0
1165 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1166 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i16>
1167 ret <vscale x 1 x i16> %b
1170 define <vscale x 1 x i16> @rint_nxv1f64_to_ui16(<vscale x 1 x double> %x) {
1171 ; RV32-LABEL: rint_nxv1f64_to_ui16:
1173 ; RV32-NEXT: lui a0, %hi(.LCPI35_0)
1174 ; RV32-NEXT: fld fa5, %lo(.LCPI35_0)(a0)
1175 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1176 ; RV32-NEXT: vfabs.v v9, v8
1177 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1178 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1179 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1180 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1181 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1182 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1183 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
1184 ; RV32-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1185 ; RV32-NEXT: vnsrl.wi v8, v9, 0
1188 ; RV64-LABEL: rint_nxv1f64_to_ui16:
1190 ; RV64-NEXT: lui a0, %hi(.LCPI35_0)
1191 ; RV64-NEXT: fld fa5, %lo(.LCPI35_0)(a0)
1192 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1193 ; RV64-NEXT: vfabs.v v9, v8
1194 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1195 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1196 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1197 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1198 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1199 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1200 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
1201 ; RV64-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
1202 ; RV64-NEXT: vnsrl.wi v8, v9, 0
1204 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1205 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i16>
1206 ret <vscale x 1 x i16> %b
1209 define <vscale x 1 x i32> @rint_nxv1f64_to_si32(<vscale x 1 x double> %x) {
1210 ; RV32-LABEL: rint_nxv1f64_to_si32:
1212 ; RV32-NEXT: lui a0, %hi(.LCPI36_0)
1213 ; RV32-NEXT: fld fa5, %lo(.LCPI36_0)(a0)
1214 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1215 ; RV32-NEXT: vfabs.v v9, v8
1216 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1217 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1218 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1219 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1220 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1221 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1222 ; RV32-NEXT: vfncvt.rtz.x.f.w v9, v8
1223 ; RV32-NEXT: vmv1r.v v8, v9
1226 ; RV64-LABEL: rint_nxv1f64_to_si32:
1228 ; RV64-NEXT: lui a0, %hi(.LCPI36_0)
1229 ; RV64-NEXT: fld fa5, %lo(.LCPI36_0)(a0)
1230 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1231 ; RV64-NEXT: vfabs.v v9, v8
1232 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1233 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1234 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1235 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1236 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1237 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1238 ; RV64-NEXT: vfncvt.rtz.x.f.w v9, v8
1239 ; RV64-NEXT: vmv1r.v v8, v9
1241 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1242 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i32>
1243 ret <vscale x 1 x i32> %b
1246 define <vscale x 1 x i32> @rint_nxv1f64_to_ui32(<vscale x 1 x double> %x) {
1247 ; RV32-LABEL: rint_nxv1f64_to_ui32:
1249 ; RV32-NEXT: lui a0, %hi(.LCPI37_0)
1250 ; RV32-NEXT: fld fa5, %lo(.LCPI37_0)(a0)
1251 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1252 ; RV32-NEXT: vfabs.v v9, v8
1253 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1254 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1255 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1256 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1257 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1258 ; RV32-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1259 ; RV32-NEXT: vfncvt.rtz.xu.f.w v9, v8
1260 ; RV32-NEXT: vmv1r.v v8, v9
1263 ; RV64-LABEL: rint_nxv1f64_to_ui32:
1265 ; RV64-NEXT: lui a0, %hi(.LCPI37_0)
1266 ; RV64-NEXT: fld fa5, %lo(.LCPI37_0)(a0)
1267 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1268 ; RV64-NEXT: vfabs.v v9, v8
1269 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1270 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1271 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1272 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1273 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1274 ; RV64-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1275 ; RV64-NEXT: vfncvt.rtz.xu.f.w v9, v8
1276 ; RV64-NEXT: vmv1r.v v8, v9
1278 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1279 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i32>
1280 ret <vscale x 1 x i32> %b
1283 define <vscale x 1 x i64> @rint_nxv1f64_to_si64(<vscale x 1 x double> %x) {
1284 ; RV32-LABEL: rint_nxv1f64_to_si64:
1286 ; RV32-NEXT: lui a0, %hi(.LCPI38_0)
1287 ; RV32-NEXT: fld fa5, %lo(.LCPI38_0)(a0)
1288 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1289 ; RV32-NEXT: vfabs.v v9, v8
1290 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1291 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1292 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1293 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1294 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1295 ; RV32-NEXT: vfcvt.rtz.x.f.v v8, v8
1298 ; RV64-LABEL: rint_nxv1f64_to_si64:
1300 ; RV64-NEXT: lui a0, %hi(.LCPI38_0)
1301 ; RV64-NEXT: fld fa5, %lo(.LCPI38_0)(a0)
1302 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1303 ; RV64-NEXT: vfabs.v v9, v8
1304 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1305 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1306 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1307 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1308 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1309 ; RV64-NEXT: vfcvt.rtz.x.f.v v8, v8
1311 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1312 %b = fptosi <vscale x 1 x double> %a to <vscale x 1 x i64>
1313 ret <vscale x 1 x i64> %b
1316 define <vscale x 1 x i64> @rint_nxv1f64_to_ui64(<vscale x 1 x double> %x) {
1317 ; RV32-LABEL: rint_nxv1f64_to_ui64:
1319 ; RV32-NEXT: lui a0, %hi(.LCPI39_0)
1320 ; RV32-NEXT: fld fa5, %lo(.LCPI39_0)(a0)
1321 ; RV32-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1322 ; RV32-NEXT: vfabs.v v9, v8
1323 ; RV32-NEXT: vmflt.vf v0, v9, fa5
1324 ; RV32-NEXT: vfcvt.x.f.v v9, v8, v0.t
1325 ; RV32-NEXT: vfcvt.f.x.v v9, v9, v0.t
1326 ; RV32-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1327 ; RV32-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1328 ; RV32-NEXT: vfcvt.rtz.xu.f.v v8, v8
1331 ; RV64-LABEL: rint_nxv1f64_to_ui64:
1333 ; RV64-NEXT: lui a0, %hi(.LCPI39_0)
1334 ; RV64-NEXT: fld fa5, %lo(.LCPI39_0)(a0)
1335 ; RV64-NEXT: vsetvli a0, zero, e64, m1, ta, ma
1336 ; RV64-NEXT: vfabs.v v9, v8
1337 ; RV64-NEXT: vmflt.vf v0, v9, fa5
1338 ; RV64-NEXT: vfcvt.x.f.v v9, v8, v0.t
1339 ; RV64-NEXT: vfcvt.f.x.v v9, v9, v0.t
1340 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1341 ; RV64-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1342 ; RV64-NEXT: vfcvt.rtz.xu.f.v v8, v8
1344 %a = call <vscale x 1 x double> @llvm.rint.nxv1f64(<vscale x 1 x double> %x)
1345 %b = fptoui <vscale x 1 x double> %a to <vscale x 1 x i64>
1346 ret <vscale x 1 x i64> %b
1349 ; ================================================================================
1350 ; rint <vscale x 4 x double>
1351 ; ================================================================================
1353 declare <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double>)
1355 define <vscale x 4 x i8> @rint_nxv4f64_to_si8(<vscale x 4 x double> %x) {
1356 ; RV32-LABEL: rint_nxv4f64_to_si8:
1358 ; RV32-NEXT: lui a0, %hi(.LCPI40_0)
1359 ; RV32-NEXT: fld fa5, %lo(.LCPI40_0)(a0)
1360 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1361 ; RV32-NEXT: vfabs.v v12, v8
1362 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1363 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1364 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1365 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1366 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1367 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1368 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
1369 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1370 ; RV32-NEXT: vnsrl.wi v8, v12, 0
1371 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
1372 ; RV32-NEXT: vnsrl.wi v8, v8, 0
1375 ; RV64-LABEL: rint_nxv4f64_to_si8:
1377 ; RV64-NEXT: lui a0, %hi(.LCPI40_0)
1378 ; RV64-NEXT: fld fa5, %lo(.LCPI40_0)(a0)
1379 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1380 ; RV64-NEXT: vfabs.v v12, v8
1381 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1382 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1383 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1384 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1385 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1386 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1387 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
1388 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1389 ; RV64-NEXT: vnsrl.wi v8, v12, 0
1390 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
1391 ; RV64-NEXT: vnsrl.wi v8, v8, 0
1393 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1394 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i8>
1395 ret <vscale x 4 x i8> %b
1398 define <vscale x 4 x i8> @rint_nxv4f64_to_ui8(<vscale x 4 x double> %x) {
1399 ; RV32-LABEL: rint_nxv4f64_to_ui8:
1401 ; RV32-NEXT: lui a0, %hi(.LCPI41_0)
1402 ; RV32-NEXT: fld fa5, %lo(.LCPI41_0)(a0)
1403 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1404 ; RV32-NEXT: vfabs.v v12, v8
1405 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1406 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1407 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1408 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1409 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1410 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1411 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
1412 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1413 ; RV32-NEXT: vnsrl.wi v8, v12, 0
1414 ; RV32-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
1415 ; RV32-NEXT: vnsrl.wi v8, v8, 0
1418 ; RV64-LABEL: rint_nxv4f64_to_ui8:
1420 ; RV64-NEXT: lui a0, %hi(.LCPI41_0)
1421 ; RV64-NEXT: fld fa5, %lo(.LCPI41_0)(a0)
1422 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1423 ; RV64-NEXT: vfabs.v v12, v8
1424 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1425 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1426 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1427 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1428 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1429 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1430 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
1431 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1432 ; RV64-NEXT: vnsrl.wi v8, v12, 0
1433 ; RV64-NEXT: vsetvli zero, zero, e8, mf2, ta, ma
1434 ; RV64-NEXT: vnsrl.wi v8, v8, 0
1436 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1437 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i8>
1438 ret <vscale x 4 x i8> %b
1441 define <vscale x 4 x i16> @rint_nxv4f64_to_si16(<vscale x 4 x double> %x) {
1442 ; RV32-LABEL: rint_nxv4f64_to_si16:
1444 ; RV32-NEXT: lui a0, %hi(.LCPI42_0)
1445 ; RV32-NEXT: fld fa5, %lo(.LCPI42_0)(a0)
1446 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1447 ; RV32-NEXT: vfabs.v v12, v8
1448 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1449 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1450 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1451 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1452 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1453 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1454 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
1455 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1456 ; RV32-NEXT: vnsrl.wi v8, v12, 0
1459 ; RV64-LABEL: rint_nxv4f64_to_si16:
1461 ; RV64-NEXT: lui a0, %hi(.LCPI42_0)
1462 ; RV64-NEXT: fld fa5, %lo(.LCPI42_0)(a0)
1463 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1464 ; RV64-NEXT: vfabs.v v12, v8
1465 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1466 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1467 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1468 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1469 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1470 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1471 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
1472 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1473 ; RV64-NEXT: vnsrl.wi v8, v12, 0
1475 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1476 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i16>
1477 ret <vscale x 4 x i16> %b
1480 define <vscale x 4 x i16> @rint_nxv4f64_to_ui16(<vscale x 4 x double> %x) {
1481 ; RV32-LABEL: rint_nxv4f64_to_ui16:
1483 ; RV32-NEXT: lui a0, %hi(.LCPI43_0)
1484 ; RV32-NEXT: fld fa5, %lo(.LCPI43_0)(a0)
1485 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1486 ; RV32-NEXT: vfabs.v v12, v8
1487 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1488 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1489 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1490 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1491 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1492 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1493 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
1494 ; RV32-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1495 ; RV32-NEXT: vnsrl.wi v8, v12, 0
1498 ; RV64-LABEL: rint_nxv4f64_to_ui16:
1500 ; RV64-NEXT: lui a0, %hi(.LCPI43_0)
1501 ; RV64-NEXT: fld fa5, %lo(.LCPI43_0)(a0)
1502 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1503 ; RV64-NEXT: vfabs.v v12, v8
1504 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1505 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1506 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1507 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1508 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1509 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1510 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
1511 ; RV64-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1512 ; RV64-NEXT: vnsrl.wi v8, v12, 0
1514 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1515 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i16>
1516 ret <vscale x 4 x i16> %b
1519 define <vscale x 4 x i32> @rint_nxv4f64_to_si32(<vscale x 4 x double> %x) {
1520 ; RV32-LABEL: rint_nxv4f64_to_si32:
1522 ; RV32-NEXT: lui a0, %hi(.LCPI44_0)
1523 ; RV32-NEXT: fld fa5, %lo(.LCPI44_0)(a0)
1524 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1525 ; RV32-NEXT: vfabs.v v12, v8
1526 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1527 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1528 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1529 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1530 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1531 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1532 ; RV32-NEXT: vfncvt.rtz.x.f.w v12, v8
1533 ; RV32-NEXT: vmv.v.v v8, v12
1536 ; RV64-LABEL: rint_nxv4f64_to_si32:
1538 ; RV64-NEXT: lui a0, %hi(.LCPI44_0)
1539 ; RV64-NEXT: fld fa5, %lo(.LCPI44_0)(a0)
1540 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1541 ; RV64-NEXT: vfabs.v v12, v8
1542 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1543 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1544 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1545 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1546 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1547 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1548 ; RV64-NEXT: vfncvt.rtz.x.f.w v12, v8
1549 ; RV64-NEXT: vmv.v.v v8, v12
1551 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1552 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i32>
1553 ret <vscale x 4 x i32> %b
1556 define <vscale x 4 x i32> @rint_nxv4f64_to_ui32(<vscale x 4 x double> %x) {
1557 ; RV32-LABEL: rint_nxv4f64_to_ui32:
1559 ; RV32-NEXT: lui a0, %hi(.LCPI45_0)
1560 ; RV32-NEXT: fld fa5, %lo(.LCPI45_0)(a0)
1561 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1562 ; RV32-NEXT: vfabs.v v12, v8
1563 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1564 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1565 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1566 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1567 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1568 ; RV32-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1569 ; RV32-NEXT: vfncvt.rtz.xu.f.w v12, v8
1570 ; RV32-NEXT: vmv.v.v v8, v12
1573 ; RV64-LABEL: rint_nxv4f64_to_ui32:
1575 ; RV64-NEXT: lui a0, %hi(.LCPI45_0)
1576 ; RV64-NEXT: fld fa5, %lo(.LCPI45_0)(a0)
1577 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1578 ; RV64-NEXT: vfabs.v v12, v8
1579 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1580 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1581 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1582 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1583 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1584 ; RV64-NEXT: vsetvli zero, zero, e32, m2, ta, ma
1585 ; RV64-NEXT: vfncvt.rtz.xu.f.w v12, v8
1586 ; RV64-NEXT: vmv.v.v v8, v12
1588 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1589 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i32>
1590 ret <vscale x 4 x i32> %b
1593 define <vscale x 4 x i64> @rint_nxv4f64_to_si64(<vscale x 4 x double> %x) {
1594 ; RV32-LABEL: rint_nxv4f64_to_si64:
1596 ; RV32-NEXT: lui a0, %hi(.LCPI46_0)
1597 ; RV32-NEXT: fld fa5, %lo(.LCPI46_0)(a0)
1598 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1599 ; RV32-NEXT: vfabs.v v12, v8
1600 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1601 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1602 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1603 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1604 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1605 ; RV32-NEXT: vfcvt.rtz.x.f.v v8, v8
1608 ; RV64-LABEL: rint_nxv4f64_to_si64:
1610 ; RV64-NEXT: lui a0, %hi(.LCPI46_0)
1611 ; RV64-NEXT: fld fa5, %lo(.LCPI46_0)(a0)
1612 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1613 ; RV64-NEXT: vfabs.v v12, v8
1614 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1615 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1616 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1617 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1618 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1619 ; RV64-NEXT: vfcvt.rtz.x.f.v v8, v8
1621 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1622 %b = fptosi <vscale x 4 x double> %a to <vscale x 4 x i64>
1623 ret <vscale x 4 x i64> %b
1626 define <vscale x 4 x i64> @rint_nxv4f64_to_ui64(<vscale x 4 x double> %x) {
1627 ; RV32-LABEL: rint_nxv4f64_to_ui64:
1629 ; RV32-NEXT: lui a0, %hi(.LCPI47_0)
1630 ; RV32-NEXT: fld fa5, %lo(.LCPI47_0)(a0)
1631 ; RV32-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1632 ; RV32-NEXT: vfabs.v v12, v8
1633 ; RV32-NEXT: vmflt.vf v0, v12, fa5
1634 ; RV32-NEXT: vfcvt.x.f.v v12, v8, v0.t
1635 ; RV32-NEXT: vfcvt.f.x.v v12, v12, v0.t
1636 ; RV32-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1637 ; RV32-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1638 ; RV32-NEXT: vfcvt.rtz.xu.f.v v8, v8
1641 ; RV64-LABEL: rint_nxv4f64_to_ui64:
1643 ; RV64-NEXT: lui a0, %hi(.LCPI47_0)
1644 ; RV64-NEXT: fld fa5, %lo(.LCPI47_0)(a0)
1645 ; RV64-NEXT: vsetvli a0, zero, e64, m4, ta, ma
1646 ; RV64-NEXT: vfabs.v v12, v8
1647 ; RV64-NEXT: vmflt.vf v0, v12, fa5
1648 ; RV64-NEXT: vfcvt.x.f.v v12, v8, v0.t
1649 ; RV64-NEXT: vfcvt.f.x.v v12, v12, v0.t
1650 ; RV64-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1651 ; RV64-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1652 ; RV64-NEXT: vfcvt.rtz.xu.f.v v8, v8
1654 %a = call <vscale x 4 x double> @llvm.rint.nxv4f64(<vscale x 4 x double> %x)
1655 %b = fptoui <vscale x 4 x double> %a to <vscale x 4 x i64>
1656 ret <vscale x 4 x i64> %b