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.roundeven.nxv1f16(<vscale x 1 x half>, <vscale x 1 x i1>, i32)
13 define <vscale x 1 x half> @vp_roundeven_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
14 ; ZVFH-LABEL: vp_roundeven_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: fsrmi a0, 0
23 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
24 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
26 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
27 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
28 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
31 ; ZVFHMIN-LABEL: vp_roundeven_nxv1f16:
33 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
34 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
35 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
36 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
37 ; ZVFHMIN-NEXT: lui a0, 307200
38 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
39 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
40 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
41 ; ZVFHMIN-NEXT: fsrmi a0, 0
42 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
43 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
44 ; ZVFHMIN-NEXT: fsrm a0
45 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
46 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
47 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
48 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
49 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
51 %v = call <vscale x 1 x half> @llvm.vp.roundeven.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
52 ret <vscale x 1 x half> %v
55 define <vscale x 1 x half> @vp_roundeven_nxv1f16_unmasked(<vscale x 1 x half> %va, i32 zeroext %evl) {
56 ; ZVFH-LABEL: vp_roundeven_nxv1f16_unmasked:
58 ; ZVFH-NEXT: lui a1, %hi(.LCPI1_0)
59 ; ZVFH-NEXT: flh fa5, %lo(.LCPI1_0)(a1)
60 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
61 ; ZVFH-NEXT: vfabs.v v9, v8
62 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
63 ; ZVFH-NEXT: fsrmi a0, 0
64 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
66 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
67 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
68 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
71 ; ZVFHMIN-LABEL: vp_roundeven_nxv1f16_unmasked:
73 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
74 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
75 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
76 ; ZVFHMIN-NEXT: vfabs.v v8, v9
77 ; ZVFHMIN-NEXT: lui a0, 307200
78 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
79 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
80 ; ZVFHMIN-NEXT: fsrmi a0, 0
81 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
82 ; ZVFHMIN-NEXT: fsrm a0
83 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
84 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
85 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
86 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
87 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
89 %v = call <vscale x 1 x half> @llvm.vp.roundeven.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
90 ret <vscale x 1 x half> %v
93 declare <vscale x 2 x half> @llvm.vp.roundeven.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
95 define <vscale x 2 x half> @vp_roundeven_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
96 ; ZVFH-LABEL: vp_roundeven_nxv2f16:
98 ; ZVFH-NEXT: lui a1, %hi(.LCPI2_0)
99 ; ZVFH-NEXT: flh fa5, %lo(.LCPI2_0)(a1)
100 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
101 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
102 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
103 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
104 ; ZVFH-NEXT: fsrmi a0, 0
105 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
106 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
108 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
109 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
110 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
113 ; ZVFHMIN-LABEL: vp_roundeven_nxv2f16:
115 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
116 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
117 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
118 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
119 ; ZVFHMIN-NEXT: lui a0, 307200
120 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
121 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
122 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
123 ; ZVFHMIN-NEXT: fsrmi a0, 0
124 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
125 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
126 ; ZVFHMIN-NEXT: fsrm a0
127 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
128 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
129 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
130 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
131 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
133 %v = call <vscale x 2 x half> @llvm.vp.roundeven.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
134 ret <vscale x 2 x half> %v
137 define <vscale x 2 x half> @vp_roundeven_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
138 ; ZVFH-LABEL: vp_roundeven_nxv2f16_unmasked:
140 ; ZVFH-NEXT: lui a1, %hi(.LCPI3_0)
141 ; ZVFH-NEXT: flh fa5, %lo(.LCPI3_0)(a1)
142 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
143 ; ZVFH-NEXT: vfabs.v v9, v8
144 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
145 ; ZVFH-NEXT: fsrmi a0, 0
146 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
148 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
149 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
150 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
153 ; ZVFHMIN-LABEL: vp_roundeven_nxv2f16_unmasked:
155 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
156 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
157 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
158 ; ZVFHMIN-NEXT: vfabs.v v8, v9
159 ; ZVFHMIN-NEXT: lui a0, 307200
160 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
161 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
162 ; ZVFHMIN-NEXT: fsrmi a0, 0
163 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
164 ; ZVFHMIN-NEXT: fsrm a0
165 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
166 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
167 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
168 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
169 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
171 %v = call <vscale x 2 x half> @llvm.vp.roundeven.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
172 ret <vscale x 2 x half> %v
175 declare <vscale x 4 x half> @llvm.vp.roundeven.nxv4f16(<vscale x 4 x half>, <vscale x 4 x i1>, i32)
177 define <vscale x 4 x half> @vp_roundeven_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
178 ; ZVFH-LABEL: vp_roundeven_nxv4f16:
180 ; ZVFH-NEXT: lui a1, %hi(.LCPI4_0)
181 ; ZVFH-NEXT: flh fa5, %lo(.LCPI4_0)(a1)
182 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
183 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
184 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
185 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
186 ; ZVFH-NEXT: fsrmi a0, 0
187 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, ma
188 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
190 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
191 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
192 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
195 ; ZVFHMIN-LABEL: vp_roundeven_nxv4f16:
197 ; ZVFHMIN-NEXT: vmv1r.v v9, v0
198 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
199 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
200 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
201 ; ZVFHMIN-NEXT: vfabs.v v12, v10, v0.t
202 ; ZVFHMIN-NEXT: lui a0, 307200
203 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
204 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
205 ; ZVFHMIN-NEXT: vmflt.vf v9, v12, fa5, v0.t
206 ; ZVFHMIN-NEXT: fsrmi a0, 0
207 ; ZVFHMIN-NEXT: vmv1r.v v0, v9
208 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
209 ; ZVFHMIN-NEXT: vfcvt.x.f.v v12, v10, v0.t
210 ; ZVFHMIN-NEXT: fsrm a0
211 ; ZVFHMIN-NEXT: vfcvt.f.x.v v12, v12, v0.t
212 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
213 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v12, v10, v0.t
214 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
215 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
217 %v = call <vscale x 4 x half> @llvm.vp.roundeven.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 %evl)
218 ret <vscale x 4 x half> %v
221 define <vscale x 4 x half> @vp_roundeven_nxv4f16_unmasked(<vscale x 4 x half> %va, i32 zeroext %evl) {
222 ; ZVFH-LABEL: vp_roundeven_nxv4f16_unmasked:
224 ; ZVFH-NEXT: lui a1, %hi(.LCPI5_0)
225 ; ZVFH-NEXT: flh fa5, %lo(.LCPI5_0)(a1)
226 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
227 ; ZVFH-NEXT: vfabs.v v9, v8
228 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
229 ; ZVFH-NEXT: fsrmi a0, 0
230 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
232 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
233 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
234 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
237 ; ZVFHMIN-LABEL: vp_roundeven_nxv4f16_unmasked:
239 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
240 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
241 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
242 ; ZVFHMIN-NEXT: vfabs.v v8, v10
243 ; ZVFHMIN-NEXT: lui a0, 307200
244 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
245 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
246 ; ZVFHMIN-NEXT: fsrmi a0, 0
247 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v10, v0.t
248 ; ZVFHMIN-NEXT: fsrm a0
249 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
250 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
251 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v8, v10, v0.t
252 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
253 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
255 %v = call <vscale x 4 x half> @llvm.vp.roundeven.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
256 ret <vscale x 4 x half> %v
259 declare <vscale x 8 x half> @llvm.vp.roundeven.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, i32)
261 define <vscale x 8 x half> @vp_roundeven_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
262 ; ZVFH-LABEL: vp_roundeven_nxv8f16:
264 ; ZVFH-NEXT: lui a1, %hi(.LCPI6_0)
265 ; ZVFH-NEXT: flh fa5, %lo(.LCPI6_0)(a1)
266 ; ZVFH-NEXT: vmv1r.v v10, v0
267 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
268 ; ZVFH-NEXT: vfabs.v v12, v8, v0.t
269 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
270 ; ZVFH-NEXT: vmflt.vf v10, v12, fa5, v0.t
271 ; ZVFH-NEXT: fsrmi a0, 0
272 ; ZVFH-NEXT: vmv1r.v v0, v10
273 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, ma
274 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
276 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
277 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
278 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
281 ; ZVFHMIN-LABEL: vp_roundeven_nxv8f16:
283 ; ZVFHMIN-NEXT: vmv1r.v v10, v0
284 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
285 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
286 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
287 ; ZVFHMIN-NEXT: vfabs.v v16, v12, v0.t
288 ; ZVFHMIN-NEXT: lui a0, 307200
289 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
290 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
291 ; ZVFHMIN-NEXT: vmflt.vf v10, v16, fa5, v0.t
292 ; ZVFHMIN-NEXT: fsrmi a0, 0
293 ; ZVFHMIN-NEXT: vmv1r.v v0, v10
294 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
295 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v12, v0.t
296 ; ZVFHMIN-NEXT: fsrm a0
297 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
298 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
299 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v16, v12, v0.t
300 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
301 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
303 %v = call <vscale x 8 x half> @llvm.vp.roundeven.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 %evl)
304 ret <vscale x 8 x half> %v
307 define <vscale x 8 x half> @vp_roundeven_nxv8f16_unmasked(<vscale x 8 x half> %va, i32 zeroext %evl) {
308 ; ZVFH-LABEL: vp_roundeven_nxv8f16_unmasked:
310 ; ZVFH-NEXT: lui a1, %hi(.LCPI7_0)
311 ; ZVFH-NEXT: flh fa5, %lo(.LCPI7_0)(a1)
312 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
313 ; ZVFH-NEXT: vfabs.v v10, v8
314 ; ZVFH-NEXT: vmflt.vf v0, v10, fa5
315 ; ZVFH-NEXT: fsrmi a0, 0
316 ; ZVFH-NEXT: vfcvt.x.f.v v10, v8, v0.t
318 ; ZVFH-NEXT: vfcvt.f.x.v v10, v10, v0.t
319 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
320 ; ZVFH-NEXT: vfsgnj.vv v8, v10, v8, v0.t
323 ; ZVFHMIN-LABEL: vp_roundeven_nxv8f16_unmasked:
325 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
326 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
327 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
328 ; ZVFHMIN-NEXT: vfabs.v v8, v12
329 ; ZVFHMIN-NEXT: lui a0, 307200
330 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
331 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
332 ; ZVFHMIN-NEXT: fsrmi a0, 0
333 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v12, v0.t
334 ; ZVFHMIN-NEXT: fsrm a0
335 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
336 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
337 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v8, v12, v0.t
338 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
339 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
341 %v = call <vscale x 8 x half> @llvm.vp.roundeven.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
342 ret <vscale x 8 x half> %v
345 declare <vscale x 16 x half> @llvm.vp.roundeven.nxv16f16(<vscale x 16 x half>, <vscale x 16 x i1>, i32)
347 define <vscale x 16 x half> @vp_roundeven_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
348 ; ZVFH-LABEL: vp_roundeven_nxv16f16:
350 ; ZVFH-NEXT: lui a1, %hi(.LCPI8_0)
351 ; ZVFH-NEXT: flh fa5, %lo(.LCPI8_0)(a1)
352 ; ZVFH-NEXT: vmv1r.v v12, v0
353 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
354 ; ZVFH-NEXT: vfabs.v v16, v8, v0.t
355 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
356 ; ZVFH-NEXT: vmflt.vf v12, v16, fa5, v0.t
357 ; ZVFH-NEXT: fsrmi a0, 0
358 ; ZVFH-NEXT: vmv1r.v v0, v12
359 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, ma
360 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
362 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
363 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
364 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
367 ; ZVFHMIN-LABEL: vp_roundeven_nxv16f16:
369 ; ZVFHMIN-NEXT: vmv1r.v v12, v0
370 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
371 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
372 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
373 ; ZVFHMIN-NEXT: vfabs.v v24, v16, v0.t
374 ; ZVFHMIN-NEXT: lui a0, 307200
375 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
376 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
377 ; ZVFHMIN-NEXT: vmflt.vf v12, v24, fa5, v0.t
378 ; ZVFHMIN-NEXT: fsrmi a0, 0
379 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
380 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
381 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
382 ; ZVFHMIN-NEXT: fsrm a0
383 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
384 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
385 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
386 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
387 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
389 %v = call <vscale x 16 x half> @llvm.vp.roundeven.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 %evl)
390 ret <vscale x 16 x half> %v
393 define <vscale x 16 x half> @vp_roundeven_nxv16f16_unmasked(<vscale x 16 x half> %va, i32 zeroext %evl) {
394 ; ZVFH-LABEL: vp_roundeven_nxv16f16_unmasked:
396 ; ZVFH-NEXT: lui a1, %hi(.LCPI9_0)
397 ; ZVFH-NEXT: flh fa5, %lo(.LCPI9_0)(a1)
398 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
399 ; ZVFH-NEXT: vfabs.v v12, v8
400 ; ZVFH-NEXT: vmflt.vf v0, v12, fa5
401 ; ZVFH-NEXT: fsrmi a0, 0
402 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
404 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
405 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
406 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
409 ; ZVFHMIN-LABEL: vp_roundeven_nxv16f16_unmasked:
411 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
412 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
413 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
414 ; ZVFHMIN-NEXT: vfabs.v v8, v16
415 ; ZVFHMIN-NEXT: lui a0, 307200
416 ; ZVFHMIN-NEXT: fmv.w.x fa5, a0
417 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
418 ; ZVFHMIN-NEXT: fsrmi a0, 0
419 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v16, v0.t
420 ; ZVFHMIN-NEXT: fsrm a0
421 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
422 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
423 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v8, v16, v0.t
424 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
425 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
427 %v = call <vscale x 16 x half> @llvm.vp.roundeven.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
428 ret <vscale x 16 x half> %v
431 declare <vscale x 32 x half> @llvm.vp.roundeven.nxv32f16(<vscale x 32 x half>, <vscale x 32 x i1>, i32)
433 define <vscale x 32 x half> @vp_roundeven_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
434 ; ZVFH-LABEL: vp_roundeven_nxv32f16:
436 ; ZVFH-NEXT: lui a1, %hi(.LCPI10_0)
437 ; ZVFH-NEXT: flh fa5, %lo(.LCPI10_0)(a1)
438 ; ZVFH-NEXT: vmv1r.v v16, v0
439 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
440 ; ZVFH-NEXT: vfabs.v v24, v8, v0.t
441 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
442 ; ZVFH-NEXT: vmflt.vf v16, v24, fa5, v0.t
443 ; ZVFH-NEXT: fsrmi a0, 0
444 ; ZVFH-NEXT: vmv1r.v v0, v16
445 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, ma
446 ; ZVFH-NEXT: vfcvt.x.f.v v24, v8, v0.t
448 ; ZVFH-NEXT: vfcvt.f.x.v v24, v24, v0.t
449 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
450 ; ZVFH-NEXT: vfsgnj.vv v8, v24, v8, v0.t
453 ; ZVFHMIN-LABEL: vp_roundeven_nxv32f16:
455 ; ZVFHMIN-NEXT: addi sp, sp, -16
456 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
457 ; ZVFHMIN-NEXT: csrr a1, vlenb
458 ; ZVFHMIN-NEXT: slli a1, a1, 3
459 ; ZVFHMIN-NEXT: sub sp, sp, a1
460 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
461 ; ZVFHMIN-NEXT: csrr a2, vlenb
462 ; ZVFHMIN-NEXT: slli a1, a2, 1
463 ; ZVFHMIN-NEXT: sub a3, a0, a1
464 ; ZVFHMIN-NEXT: sltu a4, a0, a3
465 ; ZVFHMIN-NEXT: addi a4, a4, -1
466 ; ZVFHMIN-NEXT: and a3, a4, a3
467 ; ZVFHMIN-NEXT: srli a2, a2, 2
468 ; ZVFHMIN-NEXT: vmv1r.v v16, v0
469 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
470 ; ZVFHMIN-NEXT: vslidedown.vx v17, v0, a2
471 ; ZVFHMIN-NEXT: addi a2, sp, 16
472 ; ZVFHMIN-NEXT: vs8r.v v8, (a2) # Unknown-size Folded Spill
473 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
474 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
475 ; ZVFHMIN-NEXT: vmv1r.v v0, v17
476 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
477 ; ZVFHMIN-NEXT: vfabs.v v8, v24, v0.t
478 ; ZVFHMIN-NEXT: lui a2, 307200
479 ; ZVFHMIN-NEXT: fmv.w.x fa5, a2
480 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
481 ; ZVFHMIN-NEXT: vmflt.vf v17, v8, fa5, v0.t
482 ; ZVFHMIN-NEXT: fsrmi a2, 0
483 ; ZVFHMIN-NEXT: vmv1r.v v0, v17
484 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
485 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v24, v0.t
486 ; ZVFHMIN-NEXT: fsrm a2
487 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
488 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
489 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v8, v24, v0.t
490 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
491 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
492 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB10_2
493 ; ZVFHMIN-NEXT: # %bb.1:
494 ; ZVFHMIN-NEXT: mv a0, a1
495 ; ZVFHMIN-NEXT: .LBB10_2:
496 ; ZVFHMIN-NEXT: addi a1, sp, 16
497 ; ZVFHMIN-NEXT: vl8r.v v0, (a1) # Unknown-size Folded Reload
498 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v0
499 ; ZVFHMIN-NEXT: vmv1r.v v8, v16
500 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
501 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
502 ; ZVFHMIN-NEXT: vfabs.v v16, v24, v0.t
503 ; ZVFHMIN-NEXT: addi a0, sp, 16
504 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
505 ; ZVFHMIN-NEXT: vmv1r.v v0, v8
506 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
507 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
508 ; ZVFHMIN-NEXT: vmflt.vf v8, v16, fa5, v0.t
509 ; ZVFHMIN-NEXT: fsrmi a0, 0
510 ; ZVFHMIN-NEXT: vmv1r.v v0, v8
511 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
512 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v24, v0.t
513 ; ZVFHMIN-NEXT: vs8r.v v16, (a1) # Unknown-size Folded Spill
514 ; ZVFHMIN-NEXT: fsrm a0
515 ; ZVFHMIN-NEXT: addi a0, sp, 16
516 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
517 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
518 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
519 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v16, v24, v0.t
520 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
521 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
522 ; ZVFHMIN-NEXT: csrr a0, vlenb
523 ; ZVFHMIN-NEXT: slli a0, a0, 3
524 ; ZVFHMIN-NEXT: add sp, sp, a0
525 ; ZVFHMIN-NEXT: addi sp, sp, 16
527 %v = call <vscale x 32 x half> @llvm.vp.roundeven.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 %evl)
528 ret <vscale x 32 x half> %v
531 define <vscale x 32 x half> @vp_roundeven_nxv32f16_unmasked(<vscale x 32 x half> %va, i32 zeroext %evl) {
532 ; ZVFH-LABEL: vp_roundeven_nxv32f16_unmasked:
534 ; ZVFH-NEXT: lui a1, %hi(.LCPI11_0)
535 ; ZVFH-NEXT: flh fa5, %lo(.LCPI11_0)(a1)
536 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
537 ; ZVFH-NEXT: vfabs.v v16, v8
538 ; ZVFH-NEXT: vmflt.vf v0, v16, fa5
539 ; ZVFH-NEXT: fsrmi a0, 0
540 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
542 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
543 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
544 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
547 ; ZVFHMIN-LABEL: vp_roundeven_nxv32f16_unmasked:
549 ; ZVFHMIN-NEXT: addi sp, sp, -16
550 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
551 ; ZVFHMIN-NEXT: csrr a1, vlenb
552 ; ZVFHMIN-NEXT: slli a1, a1, 3
553 ; ZVFHMIN-NEXT: sub sp, sp, a1
554 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
555 ; ZVFHMIN-NEXT: csrr a2, vlenb
556 ; ZVFHMIN-NEXT: slli a1, a2, 1
557 ; ZVFHMIN-NEXT: sub a3, a0, a1
558 ; ZVFHMIN-NEXT: sltu a4, a0, a3
559 ; ZVFHMIN-NEXT: addi a4, a4, -1
560 ; ZVFHMIN-NEXT: and a3, a4, a3
561 ; ZVFHMIN-NEXT: srli a2, a2, 2
562 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, m4, ta, ma
563 ; ZVFHMIN-NEXT: vmset.m v16
564 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
565 ; ZVFHMIN-NEXT: vslidedown.vx v16, v16, a2
566 ; ZVFHMIN-NEXT: addi a2, sp, 16
567 ; ZVFHMIN-NEXT: vs8r.v v8, (a2) # Unknown-size Folded Spill
568 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
569 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
570 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
571 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
572 ; ZVFHMIN-NEXT: vfabs.v v8, v24, v0.t
573 ; ZVFHMIN-NEXT: lui a2, 307200
574 ; ZVFHMIN-NEXT: fmv.w.x fa5, a2
575 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
576 ; ZVFHMIN-NEXT: vmflt.vf v16, v8, fa5, v0.t
577 ; ZVFHMIN-NEXT: fsrmi a2, 0
578 ; ZVFHMIN-NEXT: vmv1r.v v0, v16
579 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
580 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v24, v0.t
581 ; ZVFHMIN-NEXT: fsrm a2
582 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
583 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
584 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v8, v24, v0.t
585 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
586 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
587 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB11_2
588 ; ZVFHMIN-NEXT: # %bb.1:
589 ; ZVFHMIN-NEXT: mv a0, a1
590 ; ZVFHMIN-NEXT: .LBB11_2:
591 ; ZVFHMIN-NEXT: addi a1, sp, 16
592 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
593 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
594 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
595 ; ZVFHMIN-NEXT: vfabs.v v24, v16
596 ; ZVFHMIN-NEXT: vmflt.vf v0, v24, fa5
597 ; ZVFHMIN-NEXT: fsrmi a0, 0
598 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
599 ; ZVFHMIN-NEXT: fsrm a0
600 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
601 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
602 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
603 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
604 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
605 ; ZVFHMIN-NEXT: csrr a0, vlenb
606 ; ZVFHMIN-NEXT: slli a0, a0, 3
607 ; ZVFHMIN-NEXT: add sp, sp, a0
608 ; ZVFHMIN-NEXT: addi sp, sp, 16
610 %v = call <vscale x 32 x half> @llvm.vp.roundeven.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> splat (i1 true), i32 %evl)
611 ret <vscale x 32 x half> %v
614 declare <vscale x 1 x float> @llvm.vp.roundeven.nxv1f32(<vscale x 1 x float>, <vscale x 1 x i1>, i32)
616 define <vscale x 1 x float> @vp_roundeven_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
617 ; CHECK-LABEL: vp_roundeven_nxv1f32:
619 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
620 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
621 ; CHECK-NEXT: lui a0, 307200
622 ; CHECK-NEXT: fmv.w.x fa5, a0
623 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
624 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
625 ; CHECK-NEXT: fsrmi a0, 0
626 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
627 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
628 ; CHECK-NEXT: fsrm a0
629 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
630 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
631 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
633 %v = call <vscale x 1 x float> @llvm.vp.roundeven.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 %evl)
634 ret <vscale x 1 x float> %v
637 define <vscale x 1 x float> @vp_roundeven_nxv1f32_unmasked(<vscale x 1 x float> %va, i32 zeroext %evl) {
638 ; CHECK-LABEL: vp_roundeven_nxv1f32_unmasked:
640 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
641 ; CHECK-NEXT: vfabs.v v9, v8
642 ; CHECK-NEXT: lui a0, 307200
643 ; CHECK-NEXT: fmv.w.x fa5, a0
644 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
645 ; CHECK-NEXT: fsrmi a0, 0
646 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
647 ; CHECK-NEXT: fsrm a0
648 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
649 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
650 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
652 %v = call <vscale x 1 x float> @llvm.vp.roundeven.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
653 ret <vscale x 1 x float> %v
656 declare <vscale x 2 x float> @llvm.vp.roundeven.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
658 define <vscale x 2 x float> @vp_roundeven_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
659 ; CHECK-LABEL: vp_roundeven_nxv2f32:
661 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
662 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
663 ; CHECK-NEXT: lui a0, 307200
664 ; CHECK-NEXT: fmv.w.x fa5, a0
665 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
666 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
667 ; CHECK-NEXT: fsrmi a0, 0
668 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
669 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
670 ; CHECK-NEXT: fsrm a0
671 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
672 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
673 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
675 %v = call <vscale x 2 x float> @llvm.vp.roundeven.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
676 ret <vscale x 2 x float> %v
679 define <vscale x 2 x float> @vp_roundeven_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
680 ; CHECK-LABEL: vp_roundeven_nxv2f32_unmasked:
682 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
683 ; CHECK-NEXT: vfabs.v v9, v8
684 ; CHECK-NEXT: lui a0, 307200
685 ; CHECK-NEXT: fmv.w.x fa5, a0
686 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
687 ; CHECK-NEXT: fsrmi a0, 0
688 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
689 ; CHECK-NEXT: fsrm a0
690 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
691 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
692 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
694 %v = call <vscale x 2 x float> @llvm.vp.roundeven.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
695 ret <vscale x 2 x float> %v
698 declare <vscale x 4 x float> @llvm.vp.roundeven.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, i32)
700 define <vscale x 4 x float> @vp_roundeven_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
701 ; CHECK-LABEL: vp_roundeven_nxv4f32:
703 ; CHECK-NEXT: vmv1r.v v10, v0
704 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
705 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
706 ; CHECK-NEXT: lui a0, 307200
707 ; CHECK-NEXT: fmv.w.x fa5, a0
708 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
709 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
710 ; CHECK-NEXT: fsrmi a0, 0
711 ; CHECK-NEXT: vmv1r.v v0, v10
712 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
713 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
714 ; CHECK-NEXT: fsrm a0
715 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
716 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
717 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
719 %v = call <vscale x 4 x float> @llvm.vp.roundeven.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 %evl)
720 ret <vscale x 4 x float> %v
723 define <vscale x 4 x float> @vp_roundeven_nxv4f32_unmasked(<vscale x 4 x float> %va, i32 zeroext %evl) {
724 ; CHECK-LABEL: vp_roundeven_nxv4f32_unmasked:
726 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
727 ; CHECK-NEXT: vfabs.v v10, v8
728 ; CHECK-NEXT: lui a0, 307200
729 ; CHECK-NEXT: fmv.w.x fa5, a0
730 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
731 ; CHECK-NEXT: fsrmi a0, 0
732 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
733 ; CHECK-NEXT: fsrm a0
734 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
735 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
736 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
738 %v = call <vscale x 4 x float> @llvm.vp.roundeven.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
739 ret <vscale x 4 x float> %v
742 declare <vscale x 8 x float> @llvm.vp.roundeven.nxv8f32(<vscale x 8 x float>, <vscale x 8 x i1>, i32)
744 define <vscale x 8 x float> @vp_roundeven_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
745 ; CHECK-LABEL: vp_roundeven_nxv8f32:
747 ; CHECK-NEXT: vmv1r.v v12, v0
748 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
749 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
750 ; CHECK-NEXT: lui a0, 307200
751 ; CHECK-NEXT: fmv.w.x fa5, a0
752 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
753 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
754 ; CHECK-NEXT: fsrmi a0, 0
755 ; CHECK-NEXT: vmv1r.v v0, v12
756 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
757 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
758 ; CHECK-NEXT: fsrm a0
759 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
760 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
761 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
763 %v = call <vscale x 8 x float> @llvm.vp.roundeven.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 %evl)
764 ret <vscale x 8 x float> %v
767 define <vscale x 8 x float> @vp_roundeven_nxv8f32_unmasked(<vscale x 8 x float> %va, i32 zeroext %evl) {
768 ; CHECK-LABEL: vp_roundeven_nxv8f32_unmasked:
770 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
771 ; CHECK-NEXT: vfabs.v v12, v8
772 ; CHECK-NEXT: lui a0, 307200
773 ; CHECK-NEXT: fmv.w.x fa5, a0
774 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
775 ; CHECK-NEXT: fsrmi a0, 0
776 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
777 ; CHECK-NEXT: fsrm a0
778 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
779 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
780 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
782 %v = call <vscale x 8 x float> @llvm.vp.roundeven.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
783 ret <vscale x 8 x float> %v
786 declare <vscale x 16 x float> @llvm.vp.roundeven.nxv16f32(<vscale x 16 x float>, <vscale x 16 x i1>, i32)
788 define <vscale x 16 x float> @vp_roundeven_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
789 ; CHECK-LABEL: vp_roundeven_nxv16f32:
791 ; CHECK-NEXT: vmv1r.v v16, v0
792 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
793 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
794 ; CHECK-NEXT: lui a0, 307200
795 ; CHECK-NEXT: fmv.w.x fa5, a0
796 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
797 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
798 ; CHECK-NEXT: fsrmi a0, 0
799 ; CHECK-NEXT: vmv1r.v v0, v16
800 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
801 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
802 ; CHECK-NEXT: fsrm a0
803 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
804 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
805 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
807 %v = call <vscale x 16 x float> @llvm.vp.roundeven.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 %evl)
808 ret <vscale x 16 x float> %v
811 define <vscale x 16 x float> @vp_roundeven_nxv16f32_unmasked(<vscale x 16 x float> %va, i32 zeroext %evl) {
812 ; CHECK-LABEL: vp_roundeven_nxv16f32_unmasked:
814 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
815 ; CHECK-NEXT: vfabs.v v16, v8
816 ; CHECK-NEXT: lui a0, 307200
817 ; CHECK-NEXT: fmv.w.x fa5, a0
818 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
819 ; CHECK-NEXT: fsrmi a0, 0
820 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
821 ; CHECK-NEXT: fsrm a0
822 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
823 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
824 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
826 %v = call <vscale x 16 x float> @llvm.vp.roundeven.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
827 ret <vscale x 16 x float> %v
830 declare <vscale x 1 x double> @llvm.vp.roundeven.nxv1f64(<vscale x 1 x double>, <vscale x 1 x i1>, i32)
832 define <vscale x 1 x double> @vp_roundeven_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
833 ; CHECK-LABEL: vp_roundeven_nxv1f64:
835 ; CHECK-NEXT: lui a1, %hi(.LCPI22_0)
836 ; CHECK-NEXT: fld fa5, %lo(.LCPI22_0)(a1)
837 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
838 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
839 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
840 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
841 ; CHECK-NEXT: fsrmi a0, 0
842 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
843 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
844 ; CHECK-NEXT: fsrm a0
845 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
846 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
847 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
849 %v = call <vscale x 1 x double> @llvm.vp.roundeven.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 %evl)
850 ret <vscale x 1 x double> %v
853 define <vscale x 1 x double> @vp_roundeven_nxv1f64_unmasked(<vscale x 1 x double> %va, i32 zeroext %evl) {
854 ; CHECK-LABEL: vp_roundeven_nxv1f64_unmasked:
856 ; CHECK-NEXT: lui a1, %hi(.LCPI23_0)
857 ; CHECK-NEXT: fld fa5, %lo(.LCPI23_0)(a1)
858 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
859 ; CHECK-NEXT: vfabs.v v9, v8
860 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
861 ; CHECK-NEXT: fsrmi a0, 0
862 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
863 ; CHECK-NEXT: fsrm a0
864 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
865 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
866 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
868 %v = call <vscale x 1 x double> @llvm.vp.roundeven.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
869 ret <vscale x 1 x double> %v
872 declare <vscale x 2 x double> @llvm.vp.roundeven.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
874 define <vscale x 2 x double> @vp_roundeven_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
875 ; CHECK-LABEL: vp_roundeven_nxv2f64:
877 ; CHECK-NEXT: lui a1, %hi(.LCPI24_0)
878 ; CHECK-NEXT: fld fa5, %lo(.LCPI24_0)(a1)
879 ; CHECK-NEXT: vmv1r.v v10, v0
880 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
881 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
882 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
883 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
884 ; CHECK-NEXT: fsrmi a0, 0
885 ; CHECK-NEXT: vmv1r.v v0, v10
886 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
887 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
888 ; CHECK-NEXT: fsrm a0
889 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
890 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
891 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
893 %v = call <vscale x 2 x double> @llvm.vp.roundeven.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
894 ret <vscale x 2 x double> %v
897 define <vscale x 2 x double> @vp_roundeven_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
898 ; CHECK-LABEL: vp_roundeven_nxv2f64_unmasked:
900 ; CHECK-NEXT: lui a1, %hi(.LCPI25_0)
901 ; CHECK-NEXT: fld fa5, %lo(.LCPI25_0)(a1)
902 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
903 ; CHECK-NEXT: vfabs.v v10, v8
904 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
905 ; CHECK-NEXT: fsrmi a0, 0
906 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
907 ; CHECK-NEXT: fsrm a0
908 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
909 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
910 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
912 %v = call <vscale x 2 x double> @llvm.vp.roundeven.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
913 ret <vscale x 2 x double> %v
916 declare <vscale x 4 x double> @llvm.vp.roundeven.nxv4f64(<vscale x 4 x double>, <vscale x 4 x i1>, i32)
918 define <vscale x 4 x double> @vp_roundeven_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
919 ; CHECK-LABEL: vp_roundeven_nxv4f64:
921 ; CHECK-NEXT: lui a1, %hi(.LCPI26_0)
922 ; CHECK-NEXT: fld fa5, %lo(.LCPI26_0)(a1)
923 ; CHECK-NEXT: vmv1r.v v12, v0
924 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
925 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
926 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
927 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
928 ; CHECK-NEXT: fsrmi a0, 0
929 ; CHECK-NEXT: vmv1r.v v0, v12
930 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
931 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
932 ; CHECK-NEXT: fsrm a0
933 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
934 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
935 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
937 %v = call <vscale x 4 x double> @llvm.vp.roundeven.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 %evl)
938 ret <vscale x 4 x double> %v
941 define <vscale x 4 x double> @vp_roundeven_nxv4f64_unmasked(<vscale x 4 x double> %va, i32 zeroext %evl) {
942 ; CHECK-LABEL: vp_roundeven_nxv4f64_unmasked:
944 ; CHECK-NEXT: lui a1, %hi(.LCPI27_0)
945 ; CHECK-NEXT: fld fa5, %lo(.LCPI27_0)(a1)
946 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
947 ; CHECK-NEXT: vfabs.v v12, v8
948 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
949 ; CHECK-NEXT: fsrmi a0, 0
950 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
951 ; CHECK-NEXT: fsrm a0
952 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
953 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
954 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
956 %v = call <vscale x 4 x double> @llvm.vp.roundeven.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
957 ret <vscale x 4 x double> %v
960 declare <vscale x 7 x double> @llvm.vp.roundeven.nxv7f64(<vscale x 7 x double>, <vscale x 7 x i1>, i32)
962 define <vscale x 7 x double> @vp_roundeven_nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 zeroext %evl) {
963 ; CHECK-LABEL: vp_roundeven_nxv7f64:
965 ; CHECK-NEXT: lui a1, %hi(.LCPI28_0)
966 ; CHECK-NEXT: fld fa5, %lo(.LCPI28_0)(a1)
967 ; CHECK-NEXT: vmv1r.v v16, v0
968 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
969 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
970 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
971 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
972 ; CHECK-NEXT: fsrmi a0, 0
973 ; CHECK-NEXT: vmv1r.v v0, v16
974 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
975 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
976 ; CHECK-NEXT: fsrm a0
977 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
978 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
979 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
981 %v = call <vscale x 7 x double> @llvm.vp.roundeven.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 %evl)
982 ret <vscale x 7 x double> %v
985 define <vscale x 7 x double> @vp_roundeven_nxv7f64_unmasked(<vscale x 7 x double> %va, i32 zeroext %evl) {
986 ; CHECK-LABEL: vp_roundeven_nxv7f64_unmasked:
988 ; CHECK-NEXT: lui a1, %hi(.LCPI29_0)
989 ; CHECK-NEXT: fld fa5, %lo(.LCPI29_0)(a1)
990 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
991 ; CHECK-NEXT: vfabs.v v16, v8
992 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
993 ; CHECK-NEXT: fsrmi a0, 0
994 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
995 ; CHECK-NEXT: fsrm a0
996 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
997 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
998 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1000 %v = call <vscale x 7 x double> @llvm.vp.roundeven.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> splat (i1 true), i32 %evl)
1001 ret <vscale x 7 x double> %v
1004 declare <vscale x 8 x double> @llvm.vp.roundeven.nxv8f64(<vscale x 8 x double>, <vscale x 8 x i1>, i32)
1006 define <vscale x 8 x double> @vp_roundeven_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1007 ; CHECK-LABEL: vp_roundeven_nxv8f64:
1009 ; CHECK-NEXT: lui a1, %hi(.LCPI30_0)
1010 ; CHECK-NEXT: fld fa5, %lo(.LCPI30_0)(a1)
1011 ; CHECK-NEXT: vmv1r.v v16, v0
1012 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1013 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1014 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1015 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
1016 ; CHECK-NEXT: fsrmi a0, 0
1017 ; CHECK-NEXT: vmv1r.v v0, v16
1018 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1019 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1020 ; CHECK-NEXT: fsrm a0
1021 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1022 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1023 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1025 %v = call <vscale x 8 x double> @llvm.vp.roundeven.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 %evl)
1026 ret <vscale x 8 x double> %v
1029 define <vscale x 8 x double> @vp_roundeven_nxv8f64_unmasked(<vscale x 8 x double> %va, i32 zeroext %evl) {
1030 ; CHECK-LABEL: vp_roundeven_nxv8f64_unmasked:
1032 ; CHECK-NEXT: lui a1, %hi(.LCPI31_0)
1033 ; CHECK-NEXT: fld fa5, %lo(.LCPI31_0)(a1)
1034 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1035 ; CHECK-NEXT: vfabs.v v16, v8
1036 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
1037 ; CHECK-NEXT: fsrmi a0, 0
1038 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1039 ; CHECK-NEXT: fsrm a0
1040 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1041 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1042 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1044 %v = call <vscale x 8 x double> @llvm.vp.roundeven.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1045 ret <vscale x 8 x double> %v
1049 declare <vscale x 16 x double> @llvm.vp.roundeven.nxv16f64(<vscale x 16 x double>, <vscale x 16 x i1>, i32)
1051 define <vscale x 16 x double> @vp_roundeven_nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1052 ; CHECK-LABEL: vp_roundeven_nxv16f64:
1054 ; CHECK-NEXT: addi sp, sp, -16
1055 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1056 ; CHECK-NEXT: csrr a1, vlenb
1057 ; CHECK-NEXT: slli a1, a1, 3
1058 ; CHECK-NEXT: sub sp, sp, a1
1059 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
1060 ; CHECK-NEXT: vmv1r.v v7, v0
1061 ; CHECK-NEXT: csrr a1, vlenb
1062 ; CHECK-NEXT: srli a2, a1, 3
1063 ; CHECK-NEXT: vsetvli a3, zero, e8, mf4, ta, ma
1064 ; CHECK-NEXT: vslidedown.vx v6, v0, a2
1065 ; CHECK-NEXT: sub a2, a0, a1
1066 ; CHECK-NEXT: lui a3, %hi(.LCPI32_0)
1067 ; CHECK-NEXT: fld fa5, %lo(.LCPI32_0)(a3)
1068 ; CHECK-NEXT: sltu a3, a0, a2
1069 ; CHECK-NEXT: addi a3, a3, -1
1070 ; CHECK-NEXT: and a2, a3, a2
1071 ; CHECK-NEXT: vmv1r.v v0, v6
1072 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1073 ; CHECK-NEXT: vfabs.v v24, v16, v0.t
1074 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1075 ; CHECK-NEXT: vmflt.vf v6, v24, fa5, v0.t
1076 ; CHECK-NEXT: fsrmi a2, 0
1077 ; CHECK-NEXT: vmv1r.v v0, v6
1078 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1079 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
1080 ; CHECK-NEXT: addi a3, sp, 16
1081 ; CHECK-NEXT: vs8r.v v24, (a3) # Unknown-size Folded Spill
1082 ; CHECK-NEXT: fsrm a2
1083 ; CHECK-NEXT: addi a2, sp, 16
1084 ; CHECK-NEXT: vl8r.v v24, (a2) # Unknown-size Folded Reload
1085 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1086 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1087 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
1088 ; CHECK-NEXT: bltu a0, a1, .LBB32_2
1089 ; CHECK-NEXT: # %bb.1:
1090 ; CHECK-NEXT: mv a0, a1
1091 ; CHECK-NEXT: .LBB32_2:
1092 ; CHECK-NEXT: vmv1r.v v0, v7
1093 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1094 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1095 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1096 ; CHECK-NEXT: vmflt.vf v7, v24, fa5, v0.t
1097 ; CHECK-NEXT: fsrmi a0, 0
1098 ; CHECK-NEXT: vmv1r.v v0, v7
1099 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1100 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1101 ; CHECK-NEXT: fsrm a0
1102 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1103 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1104 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1105 ; CHECK-NEXT: csrr a0, vlenb
1106 ; CHECK-NEXT: slli a0, a0, 3
1107 ; CHECK-NEXT: add sp, sp, a0
1108 ; CHECK-NEXT: addi sp, sp, 16
1110 %v = call <vscale x 16 x double> @llvm.vp.roundeven.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 %evl)
1111 ret <vscale x 16 x double> %v
1114 define <vscale x 16 x double> @vp_roundeven_nxv16f64_unmasked(<vscale x 16 x double> %va, i32 zeroext %evl) {
1115 ; CHECK-LABEL: vp_roundeven_nxv16f64_unmasked:
1117 ; CHECK-NEXT: csrr a1, vlenb
1118 ; CHECK-NEXT: sub a2, a0, a1
1119 ; CHECK-NEXT: lui a3, %hi(.LCPI33_0)
1120 ; CHECK-NEXT: fld fa5, %lo(.LCPI33_0)(a3)
1121 ; CHECK-NEXT: sltu a3, a0, a2
1122 ; CHECK-NEXT: addi a3, a3, -1
1123 ; CHECK-NEXT: and a2, a3, a2
1124 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1125 ; CHECK-NEXT: vfabs.v v24, v16
1126 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1127 ; CHECK-NEXT: fsrmi a2, 0
1128 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
1129 ; CHECK-NEXT: fsrm a2
1130 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1131 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1132 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
1133 ; CHECK-NEXT: bltu a0, a1, .LBB33_2
1134 ; CHECK-NEXT: # %bb.1:
1135 ; CHECK-NEXT: mv a0, a1
1136 ; CHECK-NEXT: .LBB33_2:
1137 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1138 ; CHECK-NEXT: vfabs.v v24, v8
1139 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1140 ; CHECK-NEXT: fsrmi a0, 0
1141 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1142 ; CHECK-NEXT: fsrm a0
1143 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1144 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1145 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1147 %v = call <vscale x 16 x double> @llvm.vp.roundeven.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1148 ret <vscale x 16 x double> %v