1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfhmin,+zvfhmin,+v -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfhmin,+zvfhmin,+v -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
11 declare <vscale x 1 x half> @llvm.vp.rint.nxv1f16(<vscale x 1 x half>, <vscale x 1 x i1>, i32)
13 define <vscale x 1 x half> @vp_rint_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
14 ; ZVFH-LABEL: vp_rint_nxv1f16:
16 ; ZVFH-NEXT: lui a1, %hi(.LCPI0_0)
17 ; ZVFH-NEXT: flh fa5, %lo(.LCPI0_0)(a1)
18 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
19 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
20 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
21 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
22 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
23 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
24 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
25 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
26 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
29 ; ZVFHMIN-LABEL: vp_rint_nxv1f16:
31 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
32 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
33 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
34 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
35 ; ZVFHMIN-NEXT: lui a0, 307200
36 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
37 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
38 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
39 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
40 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
41 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
42 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
43 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
44 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
45 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
47 %v = call <vscale x 1 x half> @llvm.vp.rint.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
48 ret <vscale x 1 x half> %v
51 define <vscale x 1 x half> @vp_rint_nxv1f16_unmasked(<vscale x 1 x half> %va, i32 zeroext %evl) {
52 ; ZVFH-LABEL: vp_rint_nxv1f16_unmasked:
54 ; ZVFH-NEXT: lui a1, %hi(.LCPI1_0)
55 ; ZVFH-NEXT: flh fa5, %lo(.LCPI1_0)(a1)
56 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
57 ; ZVFH-NEXT: vfabs.v v9, v8
58 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
59 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
60 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
61 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
62 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
65 ; ZVFHMIN-LABEL: vp_rint_nxv1f16_unmasked:
67 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
68 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
69 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
70 ; ZVFHMIN-NEXT: vfabs.v v8, v9
71 ; ZVFHMIN-NEXT: lui a0, 307200
72 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
73 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
74 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
75 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
76 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
77 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
78 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
79 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
81 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
82 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
83 %v = call <vscale x 1 x half> @llvm.vp.rint.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
84 ret <vscale x 1 x half> %v
87 declare <vscale x 2 x half> @llvm.vp.rint.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
89 define <vscale x 2 x half> @vp_rint_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
90 ; ZVFH-LABEL: vp_rint_nxv2f16:
92 ; ZVFH-NEXT: lui a1, %hi(.LCPI2_0)
93 ; ZVFH-NEXT: flh fa5, %lo(.LCPI2_0)(a1)
94 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
95 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
96 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
97 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
98 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
99 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
100 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
101 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
102 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
105 ; ZVFHMIN-LABEL: vp_rint_nxv2f16:
107 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
108 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
109 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
110 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
111 ; ZVFHMIN-NEXT: lui a0, 307200
112 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
113 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
114 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
115 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
116 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
117 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
118 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
119 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
120 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
121 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
123 %v = call <vscale x 2 x half> @llvm.vp.rint.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
124 ret <vscale x 2 x half> %v
127 define <vscale x 2 x half> @vp_rint_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
128 ; ZVFH-LABEL: vp_rint_nxv2f16_unmasked:
130 ; ZVFH-NEXT: lui a1, %hi(.LCPI3_0)
131 ; ZVFH-NEXT: flh fa5, %lo(.LCPI3_0)(a1)
132 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
133 ; ZVFH-NEXT: vfabs.v v9, v8
134 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
135 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
136 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
137 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
138 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
141 ; ZVFHMIN-LABEL: vp_rint_nxv2f16_unmasked:
143 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
144 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
145 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
146 ; ZVFHMIN-NEXT: vfabs.v v8, v9
147 ; ZVFHMIN-NEXT: lui a0, 307200
148 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
149 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
150 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
151 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
152 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
153 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
154 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
155 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
157 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
158 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
159 %v = call <vscale x 2 x half> @llvm.vp.rint.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
160 ret <vscale x 2 x half> %v
163 declare <vscale x 4 x half> @llvm.vp.rint.nxv4f16(<vscale x 4 x half>, <vscale x 4 x i1>, i32)
165 define <vscale x 4 x half> @vp_rint_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
166 ; ZVFH-LABEL: vp_rint_nxv4f16:
168 ; ZVFH-NEXT: lui a1, %hi(.LCPI4_0)
169 ; ZVFH-NEXT: flh fa5, %lo(.LCPI4_0)(a1)
170 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
171 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
172 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
173 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
174 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, ma
175 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
176 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
177 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
178 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
181 ; ZVFHMIN-LABEL: vp_rint_nxv4f16:
183 ; ZVFHMIN-NEXT: vmv1r.v v9, v0
184 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
185 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
186 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
187 ; ZVFHMIN-NEXT: vfabs.v v12, v10, v0.t
188 ; ZVFHMIN-NEXT: lui a0, 307200
189 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
190 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
191 ; ZVFHMIN-NEXT: vmflt.vf v9, v12, fa5, v0.t
192 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
193 ; ZVFHMIN-NEXT: vmv1r.v v0, v9
194 ; ZVFHMIN-NEXT: vfcvt.x.f.v v12, v10, v0.t
195 ; ZVFHMIN-NEXT: vfcvt.f.x.v v12, v12, v0.t
196 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
197 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v12, v10, v0.t
198 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
199 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
201 %v = call <vscale x 4 x half> @llvm.vp.rint.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 %evl)
202 ret <vscale x 4 x half> %v
205 define <vscale x 4 x half> @vp_rint_nxv4f16_unmasked(<vscale x 4 x half> %va, i32 zeroext %evl) {
206 ; ZVFH-LABEL: vp_rint_nxv4f16_unmasked:
208 ; ZVFH-NEXT: lui a1, %hi(.LCPI5_0)
209 ; ZVFH-NEXT: flh fa5, %lo(.LCPI5_0)(a1)
210 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
211 ; ZVFH-NEXT: vfabs.v v9, v8
212 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
213 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
214 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
215 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
216 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
219 ; ZVFHMIN-LABEL: vp_rint_nxv4f16_unmasked:
221 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
222 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
223 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
224 ; ZVFHMIN-NEXT: vfabs.v v8, v10
225 ; ZVFHMIN-NEXT: lui a0, 307200
226 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
227 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
228 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v10, v0.t
229 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
230 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
231 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v8, v10, v0.t
232 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
233 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
235 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
236 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
237 %v = call <vscale x 4 x half> @llvm.vp.rint.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 %evl)
238 ret <vscale x 4 x half> %v
241 declare <vscale x 8 x half> @llvm.vp.rint.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, i32)
243 define <vscale x 8 x half> @vp_rint_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
244 ; ZVFH-LABEL: vp_rint_nxv8f16:
246 ; ZVFH-NEXT: vmv1r.v v10, v0
247 ; ZVFH-NEXT: lui a1, %hi(.LCPI6_0)
248 ; ZVFH-NEXT: flh fa5, %lo(.LCPI6_0)(a1)
249 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
250 ; ZVFH-NEXT: vfabs.v v12, v8, v0.t
251 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
252 ; ZVFH-NEXT: vmflt.vf v10, v12, fa5, v0.t
253 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, ma
254 ; ZVFH-NEXT: vmv1r.v v0, v10
255 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
256 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
257 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
258 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
261 ; ZVFHMIN-LABEL: vp_rint_nxv8f16:
263 ; ZVFHMIN-NEXT: vmv1r.v v10, v0
264 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
265 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
266 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
267 ; ZVFHMIN-NEXT: vfabs.v v16, v12, v0.t
268 ; ZVFHMIN-NEXT: lui a0, 307200
269 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
270 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
271 ; ZVFHMIN-NEXT: vmflt.vf v10, v16, fa5, v0.t
272 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
273 ; ZVFHMIN-NEXT: vmv1r.v v0, v10
274 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v12, v0.t
275 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
276 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
277 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v16, v12, v0.t
278 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
279 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
281 %v = call <vscale x 8 x half> @llvm.vp.rint.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 %evl)
282 ret <vscale x 8 x half> %v
285 define <vscale x 8 x half> @vp_rint_nxv8f16_unmasked(<vscale x 8 x half> %va, i32 zeroext %evl) {
286 ; ZVFH-LABEL: vp_rint_nxv8f16_unmasked:
288 ; ZVFH-NEXT: lui a1, %hi(.LCPI7_0)
289 ; ZVFH-NEXT: flh fa5, %lo(.LCPI7_0)(a1)
290 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
291 ; ZVFH-NEXT: vfabs.v v10, v8
292 ; ZVFH-NEXT: vmflt.vf v0, v10, fa5
293 ; ZVFH-NEXT: vfcvt.x.f.v v10, v8, v0.t
294 ; ZVFH-NEXT: vfcvt.f.x.v v10, v10, v0.t
295 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
296 ; ZVFH-NEXT: vfsgnj.vv v8, v10, v8, v0.t
299 ; ZVFHMIN-LABEL: vp_rint_nxv8f16_unmasked:
301 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
302 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
303 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
304 ; ZVFHMIN-NEXT: vfabs.v v8, v12
305 ; ZVFHMIN-NEXT: lui a0, 307200
306 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
307 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
308 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v12, v0.t
309 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
310 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
311 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v8, v12, v0.t
312 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
313 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
315 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
316 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
317 %v = call <vscale x 8 x half> @llvm.vp.rint.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 %evl)
318 ret <vscale x 8 x half> %v
321 declare <vscale x 16 x half> @llvm.vp.rint.nxv16f16(<vscale x 16 x half>, <vscale x 16 x i1>, i32)
323 define <vscale x 16 x half> @vp_rint_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
324 ; ZVFH-LABEL: vp_rint_nxv16f16:
326 ; ZVFH-NEXT: vmv1r.v v12, v0
327 ; ZVFH-NEXT: lui a1, %hi(.LCPI8_0)
328 ; ZVFH-NEXT: flh fa5, %lo(.LCPI8_0)(a1)
329 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
330 ; ZVFH-NEXT: vfabs.v v16, v8, v0.t
331 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
332 ; ZVFH-NEXT: vmflt.vf v12, v16, fa5, v0.t
333 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, ma
334 ; ZVFH-NEXT: vmv1r.v v0, v12
335 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
336 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
337 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
338 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
341 ; ZVFHMIN-LABEL: vp_rint_nxv16f16:
343 ; ZVFHMIN-NEXT: vmv1r.v v12, v0
344 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
345 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
346 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
347 ; ZVFHMIN-NEXT: vfabs.v v24, v16, v0.t
348 ; ZVFHMIN-NEXT: lui a0, 307200
349 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
350 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
351 ; ZVFHMIN-NEXT: vmflt.vf v12, v24, fa5, v0.t
352 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
353 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
354 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
355 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
356 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
357 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
358 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
359 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
361 %v = call <vscale x 16 x half> @llvm.vp.rint.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 %evl)
362 ret <vscale x 16 x half> %v
365 define <vscale x 16 x half> @vp_rint_nxv16f16_unmasked(<vscale x 16 x half> %va, i32 zeroext %evl) {
366 ; ZVFH-LABEL: vp_rint_nxv16f16_unmasked:
368 ; ZVFH-NEXT: lui a1, %hi(.LCPI9_0)
369 ; ZVFH-NEXT: flh fa5, %lo(.LCPI9_0)(a1)
370 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
371 ; ZVFH-NEXT: vfabs.v v12, v8
372 ; ZVFH-NEXT: vmflt.vf v0, v12, fa5
373 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
374 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
375 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
376 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
379 ; ZVFHMIN-LABEL: vp_rint_nxv16f16_unmasked:
381 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
382 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
383 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
384 ; ZVFHMIN-NEXT: vfabs.v v8, v16
385 ; ZVFHMIN-NEXT: lui a0, 307200
386 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
387 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
388 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v16, v0.t
389 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
390 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
391 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v8, v16, v0.t
392 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
393 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
395 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
396 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
397 %v = call <vscale x 16 x half> @llvm.vp.rint.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 %evl)
398 ret <vscale x 16 x half> %v
401 declare <vscale x 32 x half> @llvm.vp.rint.nxv32f16(<vscale x 32 x half>, <vscale x 32 x i1>, i32)
403 define <vscale x 32 x half> @vp_rint_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
404 ; ZVFH-LABEL: vp_rint_nxv32f16:
406 ; ZVFH-NEXT: vmv1r.v v16, v0
407 ; ZVFH-NEXT: lui a1, %hi(.LCPI10_0)
408 ; ZVFH-NEXT: flh fa5, %lo(.LCPI10_0)(a1)
409 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
410 ; ZVFH-NEXT: vfabs.v v24, v8, v0.t
411 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
412 ; ZVFH-NEXT: vmflt.vf v16, v24, fa5, v0.t
413 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, ma
414 ; ZVFH-NEXT: vmv1r.v v0, v16
415 ; ZVFH-NEXT: vfcvt.x.f.v v24, v8, v0.t
416 ; ZVFH-NEXT: vfcvt.f.x.v v24, v24, v0.t
417 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
418 ; ZVFH-NEXT: vfsgnj.vv v8, v24, v8, v0.t
421 ; ZVFHMIN-LABEL: vp_rint_nxv32f16:
423 ; ZVFHMIN-NEXT: addi sp, sp, -16
424 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
425 ; ZVFHMIN-NEXT: csrr a1, vlenb
426 ; ZVFHMIN-NEXT: slli a1, a1, 3
427 ; ZVFHMIN-NEXT: sub sp, sp, a1
428 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
429 ; ZVFHMIN-NEXT: vmv1r.v v16, v0
430 ; ZVFHMIN-NEXT: csrr a2, vlenb
431 ; ZVFHMIN-NEXT: slli a1, a2, 1
432 ; ZVFHMIN-NEXT: sub a3, a0, a1
433 ; ZVFHMIN-NEXT: sltu a4, a0, a3
434 ; ZVFHMIN-NEXT: addi a4, a4, -1
435 ; ZVFHMIN-NEXT: and a3, a4, a3
436 ; ZVFHMIN-NEXT: srli a2, a2, 2
437 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
438 ; ZVFHMIN-NEXT: vslidedown.vx v17, v0, a2
439 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
440 ; ZVFHMIN-NEXT: addi a2, sp, 16
441 ; ZVFHMIN-NEXT: vs8r.v v8, (a2) # Unknown-size Folded Spill
442 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
443 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
444 ; ZVFHMIN-NEXT: vmv1r.v v0, v17
445 ; ZVFHMIN-NEXT: vfabs.v v8, v24, v0.t
446 ; ZVFHMIN-NEXT: lui a2, 307200
447 ; ZVFHMIN-NEXT: fmv.w.x fa5, a2
448 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
449 ; ZVFHMIN-NEXT: vmflt.vf v17, v8, fa5, v0.t
450 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
451 ; ZVFHMIN-NEXT: vmv1r.v v0, v17
452 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v24, v0.t
453 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
454 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
455 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v8, v24, v0.t
456 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
457 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v24
458 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB10_2
459 ; ZVFHMIN-NEXT: # %bb.1:
460 ; ZVFHMIN-NEXT: mv a0, a1
461 ; ZVFHMIN-NEXT: .LBB10_2:
462 ; ZVFHMIN-NEXT: addi a1, sp, 16
463 ; ZVFHMIN-NEXT: vl8r.v v8, (a1) # Unknown-size Folded Reload
464 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
465 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
466 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
467 ; ZVFHMIN-NEXT: vfabs.v v8, v24, v0.t
468 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
469 ; ZVFHMIN-NEXT: vmflt.vf v16, v8, fa5, v0.t
470 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
471 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
472 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v24, v0.t
473 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
474 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
475 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v8, v24, v0.t
476 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
477 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v24
478 ; ZVFHMIN-NEXT: vmv8r.v v8, v16
479 ; ZVFHMIN-NEXT: csrr a0, vlenb
480 ; ZVFHMIN-NEXT: slli a0, a0, 3
481 ; ZVFHMIN-NEXT: add sp, sp, a0
482 ; ZVFHMIN-NEXT: addi sp, sp, 16
484 %v = call <vscale x 32 x half> @llvm.vp.rint.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 %evl)
485 ret <vscale x 32 x half> %v
488 define <vscale x 32 x half> @vp_rint_nxv32f16_unmasked(<vscale x 32 x half> %va, i32 zeroext %evl) {
489 ; ZVFH-LABEL: vp_rint_nxv32f16_unmasked:
491 ; ZVFH-NEXT: lui a1, %hi(.LCPI11_0)
492 ; ZVFH-NEXT: flh fa5, %lo(.LCPI11_0)(a1)
493 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
494 ; ZVFH-NEXT: vfabs.v v16, v8
495 ; ZVFH-NEXT: vmflt.vf v0, v16, fa5
496 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
497 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
498 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
499 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
502 ; ZVFHMIN-LABEL: vp_rint_nxv32f16_unmasked:
504 ; ZVFHMIN-NEXT: addi sp, sp, -16
505 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
506 ; ZVFHMIN-NEXT: csrr a1, vlenb
507 ; ZVFHMIN-NEXT: slli a1, a1, 3
508 ; ZVFHMIN-NEXT: sub sp, sp, a1
509 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
510 ; ZVFHMIN-NEXT: vsetvli a1, zero, e8, m4, ta, ma
511 ; ZVFHMIN-NEXT: vmset.m v16
512 ; ZVFHMIN-NEXT: csrr a2, vlenb
513 ; ZVFHMIN-NEXT: slli a1, a2, 1
514 ; ZVFHMIN-NEXT: sub a3, a0, a1
515 ; ZVFHMIN-NEXT: sltu a4, a0, a3
516 ; ZVFHMIN-NEXT: addi a4, a4, -1
517 ; ZVFHMIN-NEXT: and a3, a4, a3
518 ; ZVFHMIN-NEXT: srli a2, a2, 2
519 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
520 ; ZVFHMIN-NEXT: vslidedown.vx v16, v16, a2
521 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
522 ; ZVFHMIN-NEXT: addi a2, sp, 16
523 ; ZVFHMIN-NEXT: vs8r.v v8, (a2) # Unknown-size Folded Spill
524 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
525 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
526 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
527 ; ZVFHMIN-NEXT: vfabs.v v8, v24, v0.t
528 ; ZVFHMIN-NEXT: lui a2, 307200
529 ; ZVFHMIN-NEXT: fmv.w.x fa5, a2
530 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
531 ; ZVFHMIN-NEXT: vmflt.vf v16, v8, fa5, v0.t
532 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
533 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
534 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v24, v0.t
535 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
536 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
537 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v8, v24, v0.t
538 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
539 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
540 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB11_2
541 ; ZVFHMIN-NEXT: # %bb.1:
542 ; ZVFHMIN-NEXT: mv a0, a1
543 ; ZVFHMIN-NEXT: .LBB11_2:
544 ; ZVFHMIN-NEXT: addi a1, sp, 16
545 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
546 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
547 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
548 ; ZVFHMIN-NEXT: vfabs.v v24, v16
549 ; ZVFHMIN-NEXT: vmflt.vf v0, v24, fa5
550 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
551 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
552 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
553 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
554 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
555 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
556 ; ZVFHMIN-NEXT: csrr a0, vlenb
557 ; ZVFHMIN-NEXT: slli a0, a0, 3
558 ; ZVFHMIN-NEXT: add sp, sp, a0
559 ; ZVFHMIN-NEXT: addi sp, sp, 16
561 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
562 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
563 %v = call <vscale x 32 x half> @llvm.vp.rint.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 %evl)
564 ret <vscale x 32 x half> %v
567 declare <vscale x 1 x float> @llvm.vp.rint.nxv1f32(<vscale x 1 x float>, <vscale x 1 x i1>, i32)
569 define <vscale x 1 x float> @vp_rint_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
570 ; CHECK-LABEL: vp_rint_nxv1f32:
572 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
573 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
574 ; CHECK-NEXT: lui a0, 307200
575 ; CHECK-NEXT: fmv.w.x fa5, a0
576 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
577 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
578 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
579 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
580 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
581 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
582 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
584 %v = call <vscale x 1 x float> @llvm.vp.rint.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 %evl)
585 ret <vscale x 1 x float> %v
588 define <vscale x 1 x float> @vp_rint_nxv1f32_unmasked(<vscale x 1 x float> %va, i32 zeroext %evl) {
589 ; CHECK-LABEL: vp_rint_nxv1f32_unmasked:
591 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
592 ; CHECK-NEXT: vfabs.v v9, v8
593 ; CHECK-NEXT: lui a0, 307200
594 ; CHECK-NEXT: fmv.w.x fa5, a0
595 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
596 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
597 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
598 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
599 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
601 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
602 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
603 %v = call <vscale x 1 x float> @llvm.vp.rint.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 %evl)
604 ret <vscale x 1 x float> %v
607 declare <vscale x 2 x float> @llvm.vp.rint.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
609 define <vscale x 2 x float> @vp_rint_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
610 ; CHECK-LABEL: vp_rint_nxv2f32:
612 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
613 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
614 ; CHECK-NEXT: lui a0, 307200
615 ; CHECK-NEXT: fmv.w.x fa5, a0
616 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
617 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
618 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
619 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
620 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
621 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
622 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
624 %v = call <vscale x 2 x float> @llvm.vp.rint.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
625 ret <vscale x 2 x float> %v
628 define <vscale x 2 x float> @vp_rint_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
629 ; CHECK-LABEL: vp_rint_nxv2f32_unmasked:
631 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
632 ; CHECK-NEXT: vfabs.v v9, v8
633 ; CHECK-NEXT: lui a0, 307200
634 ; CHECK-NEXT: fmv.w.x fa5, a0
635 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
636 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
637 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
638 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
639 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
641 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
642 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
643 %v = call <vscale x 2 x float> @llvm.vp.rint.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
644 ret <vscale x 2 x float> %v
647 declare <vscale x 4 x float> @llvm.vp.rint.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, i32)
649 define <vscale x 4 x float> @vp_rint_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
650 ; CHECK-LABEL: vp_rint_nxv4f32:
652 ; CHECK-NEXT: vmv1r.v v10, v0
653 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
654 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
655 ; CHECK-NEXT: lui a0, 307200
656 ; CHECK-NEXT: fmv.w.x fa5, a0
657 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
658 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
659 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
660 ; CHECK-NEXT: vmv1r.v v0, v10
661 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
662 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
663 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
664 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
666 %v = call <vscale x 4 x float> @llvm.vp.rint.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 %evl)
667 ret <vscale x 4 x float> %v
670 define <vscale x 4 x float> @vp_rint_nxv4f32_unmasked(<vscale x 4 x float> %va, i32 zeroext %evl) {
671 ; CHECK-LABEL: vp_rint_nxv4f32_unmasked:
673 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
674 ; CHECK-NEXT: vfabs.v v10, v8
675 ; CHECK-NEXT: lui a0, 307200
676 ; CHECK-NEXT: fmv.w.x fa5, a0
677 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
678 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
679 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
680 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
681 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
683 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
684 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
685 %v = call <vscale x 4 x float> @llvm.vp.rint.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 %evl)
686 ret <vscale x 4 x float> %v
689 declare <vscale x 8 x float> @llvm.vp.rint.nxv8f32(<vscale x 8 x float>, <vscale x 8 x i1>, i32)
691 define <vscale x 8 x float> @vp_rint_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
692 ; CHECK-LABEL: vp_rint_nxv8f32:
694 ; CHECK-NEXT: vmv1r.v v12, v0
695 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
696 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
697 ; CHECK-NEXT: lui a0, 307200
698 ; CHECK-NEXT: fmv.w.x fa5, a0
699 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
700 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
701 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
702 ; CHECK-NEXT: vmv1r.v v0, v12
703 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
704 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
705 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
706 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
708 %v = call <vscale x 8 x float> @llvm.vp.rint.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 %evl)
709 ret <vscale x 8 x float> %v
712 define <vscale x 8 x float> @vp_rint_nxv8f32_unmasked(<vscale x 8 x float> %va, i32 zeroext %evl) {
713 ; CHECK-LABEL: vp_rint_nxv8f32_unmasked:
715 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
716 ; CHECK-NEXT: vfabs.v v12, v8
717 ; CHECK-NEXT: lui a0, 307200
718 ; CHECK-NEXT: fmv.w.x fa5, a0
719 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
720 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
721 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
722 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
723 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
725 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
726 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
727 %v = call <vscale x 8 x float> @llvm.vp.rint.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 %evl)
728 ret <vscale x 8 x float> %v
731 declare <vscale x 16 x float> @llvm.vp.rint.nxv16f32(<vscale x 16 x float>, <vscale x 16 x i1>, i32)
733 define <vscale x 16 x float> @vp_rint_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
734 ; CHECK-LABEL: vp_rint_nxv16f32:
736 ; CHECK-NEXT: vmv1r.v v16, v0
737 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
738 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
739 ; CHECK-NEXT: lui a0, 307200
740 ; CHECK-NEXT: fmv.w.x fa5, a0
741 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
742 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
743 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
744 ; CHECK-NEXT: vmv1r.v v0, v16
745 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
746 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
747 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
748 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
750 %v = call <vscale x 16 x float> @llvm.vp.rint.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 %evl)
751 ret <vscale x 16 x float> %v
754 define <vscale x 16 x float> @vp_rint_nxv16f32_unmasked(<vscale x 16 x float> %va, i32 zeroext %evl) {
755 ; CHECK-LABEL: vp_rint_nxv16f32_unmasked:
757 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
758 ; CHECK-NEXT: vfabs.v v16, v8
759 ; CHECK-NEXT: lui a0, 307200
760 ; CHECK-NEXT: fmv.w.x fa5, a0
761 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
762 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
763 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
764 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
765 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
767 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
768 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
769 %v = call <vscale x 16 x float> @llvm.vp.rint.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 %evl)
770 ret <vscale x 16 x float> %v
773 declare <vscale x 1 x double> @llvm.vp.rint.nxv1f64(<vscale x 1 x double>, <vscale x 1 x i1>, i32)
775 define <vscale x 1 x double> @vp_rint_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
776 ; CHECK-LABEL: vp_rint_nxv1f64:
778 ; CHECK-NEXT: lui a1, %hi(.LCPI22_0)
779 ; CHECK-NEXT: fld fa5, %lo(.LCPI22_0)(a1)
780 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
781 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
782 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
783 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
784 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
785 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
786 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
787 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
788 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
790 %v = call <vscale x 1 x double> @llvm.vp.rint.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 %evl)
791 ret <vscale x 1 x double> %v
794 define <vscale x 1 x double> @vp_rint_nxv1f64_unmasked(<vscale x 1 x double> %va, i32 zeroext %evl) {
795 ; CHECK-LABEL: vp_rint_nxv1f64_unmasked:
797 ; CHECK-NEXT: lui a1, %hi(.LCPI23_0)
798 ; CHECK-NEXT: fld fa5, %lo(.LCPI23_0)(a1)
799 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
800 ; CHECK-NEXT: vfabs.v v9, v8
801 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
802 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
803 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
804 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
805 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
807 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
808 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
809 %v = call <vscale x 1 x double> @llvm.vp.rint.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 %evl)
810 ret <vscale x 1 x double> %v
813 declare <vscale x 2 x double> @llvm.vp.rint.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
815 define <vscale x 2 x double> @vp_rint_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
816 ; CHECK-LABEL: vp_rint_nxv2f64:
818 ; CHECK-NEXT: vmv1r.v v10, v0
819 ; CHECK-NEXT: lui a1, %hi(.LCPI24_0)
820 ; CHECK-NEXT: fld fa5, %lo(.LCPI24_0)(a1)
821 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
822 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
823 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
824 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
825 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
826 ; CHECK-NEXT: vmv1r.v v0, v10
827 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
828 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
829 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
830 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
832 %v = call <vscale x 2 x double> @llvm.vp.rint.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
833 ret <vscale x 2 x double> %v
836 define <vscale x 2 x double> @vp_rint_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
837 ; CHECK-LABEL: vp_rint_nxv2f64_unmasked:
839 ; CHECK-NEXT: lui a1, %hi(.LCPI25_0)
840 ; CHECK-NEXT: fld fa5, %lo(.LCPI25_0)(a1)
841 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
842 ; CHECK-NEXT: vfabs.v v10, v8
843 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
844 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
845 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
846 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
847 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
849 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
850 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
851 %v = call <vscale x 2 x double> @llvm.vp.rint.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
852 ret <vscale x 2 x double> %v
855 declare <vscale x 4 x double> @llvm.vp.rint.nxv4f64(<vscale x 4 x double>, <vscale x 4 x i1>, i32)
857 define <vscale x 4 x double> @vp_rint_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
858 ; CHECK-LABEL: vp_rint_nxv4f64:
860 ; CHECK-NEXT: vmv1r.v v12, v0
861 ; CHECK-NEXT: lui a1, %hi(.LCPI26_0)
862 ; CHECK-NEXT: fld fa5, %lo(.LCPI26_0)(a1)
863 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
864 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
865 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
866 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
867 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
868 ; CHECK-NEXT: vmv1r.v v0, v12
869 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
870 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
871 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
872 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
874 %v = call <vscale x 4 x double> @llvm.vp.rint.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 %evl)
875 ret <vscale x 4 x double> %v
878 define <vscale x 4 x double> @vp_rint_nxv4f64_unmasked(<vscale x 4 x double> %va, i32 zeroext %evl) {
879 ; CHECK-LABEL: vp_rint_nxv4f64_unmasked:
881 ; CHECK-NEXT: lui a1, %hi(.LCPI27_0)
882 ; CHECK-NEXT: fld fa5, %lo(.LCPI27_0)(a1)
883 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
884 ; CHECK-NEXT: vfabs.v v12, v8
885 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
886 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
887 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
888 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
889 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
891 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
892 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
893 %v = call <vscale x 4 x double> @llvm.vp.rint.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 %evl)
894 ret <vscale x 4 x double> %v
897 declare <vscale x 7 x double> @llvm.vp.rint.nxv7f64(<vscale x 7 x double>, <vscale x 7 x i1>, i32)
899 define <vscale x 7 x double> @vp_rint_nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 zeroext %evl) {
900 ; CHECK-LABEL: vp_rint_nxv7f64:
902 ; CHECK-NEXT: vmv1r.v v16, v0
903 ; CHECK-NEXT: lui a1, %hi(.LCPI28_0)
904 ; CHECK-NEXT: fld fa5, %lo(.LCPI28_0)(a1)
905 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
906 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
907 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
908 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
909 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
910 ; CHECK-NEXT: vmv1r.v v0, v16
911 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
912 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
913 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
914 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
916 %v = call <vscale x 7 x double> @llvm.vp.rint.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 %evl)
917 ret <vscale x 7 x double> %v
920 define <vscale x 7 x double> @vp_rint_nxv7f64_unmasked(<vscale x 7 x double> %va, i32 zeroext %evl) {
921 ; CHECK-LABEL: vp_rint_nxv7f64_unmasked:
923 ; CHECK-NEXT: lui a1, %hi(.LCPI29_0)
924 ; CHECK-NEXT: fld fa5, %lo(.LCPI29_0)(a1)
925 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
926 ; CHECK-NEXT: vfabs.v v16, v8
927 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
928 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
929 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
930 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
931 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
933 %head = insertelement <vscale x 7 x i1> poison, i1 true, i32 0
934 %m = shufflevector <vscale x 7 x i1> %head, <vscale x 7 x i1> poison, <vscale x 7 x i32> zeroinitializer
935 %v = call <vscale x 7 x double> @llvm.vp.rint.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 %evl)
936 ret <vscale x 7 x double> %v
939 declare <vscale x 8 x double> @llvm.vp.rint.nxv8f64(<vscale x 8 x double>, <vscale x 8 x i1>, i32)
941 define <vscale x 8 x double> @vp_rint_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
942 ; CHECK-LABEL: vp_rint_nxv8f64:
944 ; CHECK-NEXT: vmv1r.v v16, v0
945 ; CHECK-NEXT: lui a1, %hi(.LCPI30_0)
946 ; CHECK-NEXT: fld fa5, %lo(.LCPI30_0)(a1)
947 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
948 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
949 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
950 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
951 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
952 ; CHECK-NEXT: vmv1r.v v0, v16
953 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
954 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
955 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
956 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
958 %v = call <vscale x 8 x double> @llvm.vp.rint.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 %evl)
959 ret <vscale x 8 x double> %v
962 define <vscale x 8 x double> @vp_rint_nxv8f64_unmasked(<vscale x 8 x double> %va, i32 zeroext %evl) {
963 ; CHECK-LABEL: vp_rint_nxv8f64_unmasked:
965 ; CHECK-NEXT: lui a1, %hi(.LCPI31_0)
966 ; CHECK-NEXT: fld fa5, %lo(.LCPI31_0)(a1)
967 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
968 ; CHECK-NEXT: vfabs.v v16, v8
969 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
970 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
971 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
972 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
973 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
975 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
976 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
977 %v = call <vscale x 8 x double> @llvm.vp.rint.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 %evl)
978 ret <vscale x 8 x double> %v
982 declare <vscale x 16 x double> @llvm.vp.rint.nxv16f64(<vscale x 16 x double>, <vscale x 16 x i1>, i32)
984 define <vscale x 16 x double> @vp_rint_nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
985 ; CHECK-LABEL: vp_rint_nxv16f64:
987 ; CHECK-NEXT: addi sp, sp, -16
988 ; CHECK-NEXT: .cfi_def_cfa_offset 16
989 ; CHECK-NEXT: csrr a1, vlenb
990 ; CHECK-NEXT: slli a1, a1, 4
991 ; CHECK-NEXT: sub sp, sp, a1
992 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
993 ; CHECK-NEXT: vmv1r.v v24, v0
994 ; CHECK-NEXT: addi a1, sp, 16
995 ; CHECK-NEXT: vs8r.v v8, (a1) # Unknown-size Folded Spill
996 ; CHECK-NEXT: csrr a1, vlenb
997 ; CHECK-NEXT: srli a2, a1, 3
998 ; CHECK-NEXT: vsetvli a3, zero, e8, mf4, ta, ma
999 ; CHECK-NEXT: vslidedown.vx v25, v0, a2
1000 ; CHECK-NEXT: sub a2, a0, a1
1001 ; CHECK-NEXT: sltu a3, a0, a2
1002 ; CHECK-NEXT: addi a3, a3, -1
1003 ; CHECK-NEXT: and a2, a3, a2
1004 ; CHECK-NEXT: lui a3, %hi(.LCPI32_0)
1005 ; CHECK-NEXT: fld fa5, %lo(.LCPI32_0)(a3)
1006 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1007 ; CHECK-NEXT: vmv1r.v v0, v25
1008 ; CHECK-NEXT: vfabs.v v8, v16, v0.t
1009 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1010 ; CHECK-NEXT: vmflt.vf v25, v8, fa5, v0.t
1011 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1012 ; CHECK-NEXT: vmv1r.v v0, v25
1013 ; CHECK-NEXT: vfcvt.x.f.v v8, v16, v0.t
1014 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
1015 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1016 ; CHECK-NEXT: vfsgnj.vv v16, v8, v16, v0.t
1017 ; CHECK-NEXT: csrr a2, vlenb
1018 ; CHECK-NEXT: slli a2, a2, 3
1019 ; CHECK-NEXT: add a2, sp, a2
1020 ; CHECK-NEXT: addi a2, a2, 16
1021 ; CHECK-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
1022 ; CHECK-NEXT: bltu a0, a1, .LBB32_2
1023 ; CHECK-NEXT: # %bb.1:
1024 ; CHECK-NEXT: mv a0, a1
1025 ; CHECK-NEXT: .LBB32_2:
1026 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1027 ; CHECK-NEXT: vmv1r.v v0, v24
1028 ; CHECK-NEXT: addi a0, sp, 16
1029 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
1030 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
1031 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1032 ; CHECK-NEXT: vmflt.vf v24, v16, fa5, v0.t
1033 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1034 ; CHECK-NEXT: vmv1r.v v0, v24
1035 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1036 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1037 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1038 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1039 ; CHECK-NEXT: csrr a0, vlenb
1040 ; CHECK-NEXT: slli a0, a0, 3
1041 ; CHECK-NEXT: add a0, sp, a0
1042 ; CHECK-NEXT: addi a0, a0, 16
1043 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
1044 ; CHECK-NEXT: csrr a0, vlenb
1045 ; CHECK-NEXT: slli a0, a0, 4
1046 ; CHECK-NEXT: add sp, sp, a0
1047 ; CHECK-NEXT: addi sp, sp, 16
1049 %v = call <vscale x 16 x double> @llvm.vp.rint.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 %evl)
1050 ret <vscale x 16 x double> %v
1053 define <vscale x 16 x double> @vp_rint_nxv16f64_unmasked(<vscale x 16 x double> %va, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vp_rint_nxv16f64_unmasked:
1056 ; CHECK-NEXT: csrr a1, vlenb
1057 ; CHECK-NEXT: sub a2, a0, a1
1058 ; CHECK-NEXT: lui a3, %hi(.LCPI33_0)
1059 ; CHECK-NEXT: fld fa5, %lo(.LCPI33_0)(a3)
1060 ; CHECK-NEXT: sltu a3, a0, a2
1061 ; CHECK-NEXT: addi a3, a3, -1
1062 ; CHECK-NEXT: and a2, a3, a2
1063 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1064 ; CHECK-NEXT: vfabs.v v24, v16
1065 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1066 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
1067 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1068 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1069 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
1070 ; CHECK-NEXT: bltu a0, a1, .LBB33_2
1071 ; CHECK-NEXT: # %bb.1:
1072 ; CHECK-NEXT: mv a0, a1
1073 ; CHECK-NEXT: .LBB33_2:
1074 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1075 ; CHECK-NEXT: vfabs.v v24, v8
1076 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1077 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1078 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1079 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1080 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1082 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1083 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1084 %v = call <vscale x 16 x double> @llvm.vp.rint.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 %evl)
1085 ret <vscale x 16 x double> %v