1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+zfbfmin,+zvfbfmin,+v \
3 ; RUN: -target-abi=ilp32d -verify-machineinstrs < %s | FileCheck %s \
4 ; RUN: --check-prefixes=CHECK,ZVFH
5 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+zfbfmin,+zvfbfmin,+v \
6 ; RUN: -target-abi=lp64d -verify-machineinstrs < %s | FileCheck %s \
7 ; RUN: --check-prefixes=CHECK,ZVFH
8 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfhmin,+zvfhmin,+zfbfmin,+zvfbfmin,+v \
9 ; RUN: -target-abi=ilp32d -verify-machineinstrs < %s | FileCheck %s \
10 ; RUN: --check-prefixes=CHECK,ZVFHMIN
11 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfhmin,+zvfhmin,+zfbfmin,+zvfbfmin,+v \
12 ; RUN: -target-abi=lp64d -verify-machineinstrs < %s | FileCheck %s \
13 ; RUN: --check-prefixes=CHECK,ZVFHMIN
15 declare <vscale x 1 x bfloat> @llvm.vp.rint.nxv1bf16(<vscale x 1 x bfloat>, <vscale x 1 x i1>, i32)
17 define <vscale x 1 x bfloat> @vp_rint_nxv1bf16(<vscale x 1 x bfloat> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
18 ; CHECK-LABEL: vp_rint_nxv1bf16:
20 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
21 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
22 ; CHECK-NEXT: lui a1, 307200
23 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
24 ; CHECK-NEXT: vfabs.v v8, v9, v0.t
25 ; CHECK-NEXT: fmv.w.x fa5, a1
26 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
27 ; CHECK-NEXT: vmflt.vf v0, v8, fa5, v0.t
28 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
29 ; CHECK-NEXT: vfcvt.x.f.v v8, v9, v0.t
30 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
31 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
32 ; CHECK-NEXT: vfsgnj.vv v9, v8, v9, v0.t
33 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
34 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
36 %v = call <vscale x 1 x bfloat> @llvm.vp.rint.nxv1bf16(<vscale x 1 x bfloat> %va, <vscale x 1 x i1> %m, i32 %evl)
37 ret <vscale x 1 x bfloat> %v
40 define <vscale x 1 x bfloat> @vp_rint_nxv1bf16_unmasked(<vscale x 1 x bfloat> %va, i32 zeroext %evl) {
41 ; CHECK-LABEL: vp_rint_nxv1bf16_unmasked:
43 ; CHECK-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
44 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
45 ; CHECK-NEXT: lui a1, 307200
46 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
47 ; CHECK-NEXT: vfabs.v v8, v9
48 ; CHECK-NEXT: fmv.w.x fa5, a1
49 ; CHECK-NEXT: vmflt.vf v0, v8, fa5
50 ; CHECK-NEXT: vfcvt.x.f.v v8, v9, v0.t
51 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
52 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
53 ; CHECK-NEXT: vfsgnj.vv v9, v8, v9, v0.t
54 ; CHECK-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
55 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
57 %v = call <vscale x 1 x bfloat> @llvm.vp.rint.nxv1bf16(<vscale x 1 x bfloat> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
58 ret <vscale x 1 x bfloat> %v
61 declare <vscale x 2 x bfloat> @llvm.vp.rint.nxv2bf16(<vscale x 2 x bfloat>, <vscale x 2 x i1>, i32)
63 define <vscale x 2 x bfloat> @vp_rint_nxv2bf16(<vscale x 2 x bfloat> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
64 ; CHECK-LABEL: vp_rint_nxv2bf16:
66 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
67 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
68 ; CHECK-NEXT: lui a1, 307200
69 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
70 ; CHECK-NEXT: vfabs.v v8, v9, v0.t
71 ; CHECK-NEXT: fmv.w.x fa5, a1
72 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
73 ; CHECK-NEXT: vmflt.vf v0, v8, fa5, v0.t
74 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
75 ; CHECK-NEXT: vfcvt.x.f.v v8, v9, v0.t
76 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
77 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
78 ; CHECK-NEXT: vfsgnj.vv v9, v8, v9, v0.t
79 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
80 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
82 %v = call <vscale x 2 x bfloat> @llvm.vp.rint.nxv2bf16(<vscale x 2 x bfloat> %va, <vscale x 2 x i1> %m, i32 %evl)
83 ret <vscale x 2 x bfloat> %v
86 define <vscale x 2 x bfloat> @vp_rint_nxv2bf16_unmasked(<vscale x 2 x bfloat> %va, i32 zeroext %evl) {
87 ; CHECK-LABEL: vp_rint_nxv2bf16_unmasked:
89 ; CHECK-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
90 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
91 ; CHECK-NEXT: lui a1, 307200
92 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
93 ; CHECK-NEXT: vfabs.v v8, v9
94 ; CHECK-NEXT: fmv.w.x fa5, a1
95 ; CHECK-NEXT: vmflt.vf v0, v8, fa5
96 ; CHECK-NEXT: vfcvt.x.f.v v8, v9, v0.t
97 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
98 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
99 ; CHECK-NEXT: vfsgnj.vv v9, v8, v9, v0.t
100 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
101 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
103 %v = call <vscale x 2 x bfloat> @llvm.vp.rint.nxv2bf16(<vscale x 2 x bfloat> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
104 ret <vscale x 2 x bfloat> %v
107 declare <vscale x 4 x bfloat> @llvm.vp.rint.nxv4bf16(<vscale x 4 x bfloat>, <vscale x 4 x i1>, i32)
109 define <vscale x 4 x bfloat> @vp_rint_nxv4bf16(<vscale x 4 x bfloat> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
110 ; CHECK-LABEL: vp_rint_nxv4bf16:
112 ; CHECK-NEXT: vmv1r.v v9, v0
113 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
114 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
115 ; CHECK-NEXT: lui a1, 307200
116 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
117 ; CHECK-NEXT: vfabs.v v12, v10, v0.t
118 ; CHECK-NEXT: fmv.w.x fa5, a1
119 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
120 ; CHECK-NEXT: vmflt.vf v9, v12, fa5, v0.t
121 ; CHECK-NEXT: vmv1r.v v0, v9
122 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
123 ; CHECK-NEXT: vfcvt.x.f.v v12, v10, v0.t
124 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
125 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
126 ; CHECK-NEXT: vfsgnj.vv v10, v12, v10, v0.t
127 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
128 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v10
130 %v = call <vscale x 4 x bfloat> @llvm.vp.rint.nxv4bf16(<vscale x 4 x bfloat> %va, <vscale x 4 x i1> %m, i32 %evl)
131 ret <vscale x 4 x bfloat> %v
134 define <vscale x 4 x bfloat> @vp_rint_nxv4bf16_unmasked(<vscale x 4 x bfloat> %va, i32 zeroext %evl) {
135 ; CHECK-LABEL: vp_rint_nxv4bf16_unmasked:
137 ; CHECK-NEXT: vsetvli a1, zero, e16, m1, ta, ma
138 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
139 ; CHECK-NEXT: lui a1, 307200
140 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
141 ; CHECK-NEXT: vfabs.v v8, v10
142 ; CHECK-NEXT: fmv.w.x fa5, a1
143 ; CHECK-NEXT: vmflt.vf v0, v8, fa5
144 ; CHECK-NEXT: vfcvt.x.f.v v8, v10, v0.t
145 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
146 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
147 ; CHECK-NEXT: vfsgnj.vv v10, v8, v10, v0.t
148 ; CHECK-NEXT: vsetvli a0, zero, e16, m1, ta, ma
149 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v10
151 %v = call <vscale x 4 x bfloat> @llvm.vp.rint.nxv4bf16(<vscale x 4 x bfloat> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
152 ret <vscale x 4 x bfloat> %v
155 declare <vscale x 8 x bfloat> @llvm.vp.rint.nxv8bf16(<vscale x 8 x bfloat>, <vscale x 8 x i1>, i32)
157 define <vscale x 8 x bfloat> @vp_rint_nxv8bf16(<vscale x 8 x bfloat> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
158 ; CHECK-LABEL: vp_rint_nxv8bf16:
160 ; CHECK-NEXT: vmv1r.v v10, v0
161 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
162 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
163 ; CHECK-NEXT: lui a1, 307200
164 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
165 ; CHECK-NEXT: vfabs.v v16, v12, v0.t
166 ; CHECK-NEXT: fmv.w.x fa5, a1
167 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
168 ; CHECK-NEXT: vmflt.vf v10, v16, fa5, v0.t
169 ; CHECK-NEXT: vmv1r.v v0, v10
170 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
171 ; CHECK-NEXT: vfcvt.x.f.v v16, v12, v0.t
172 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
173 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
174 ; CHECK-NEXT: vfsgnj.vv v12, v16, v12, v0.t
175 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
176 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v12
178 %v = call <vscale x 8 x bfloat> @llvm.vp.rint.nxv8bf16(<vscale x 8 x bfloat> %va, <vscale x 8 x i1> %m, i32 %evl)
179 ret <vscale x 8 x bfloat> %v
182 define <vscale x 8 x bfloat> @vp_rint_nxv8bf16_unmasked(<vscale x 8 x bfloat> %va, i32 zeroext %evl) {
183 ; CHECK-LABEL: vp_rint_nxv8bf16_unmasked:
185 ; CHECK-NEXT: vsetvli a1, zero, e16, m2, ta, ma
186 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
187 ; CHECK-NEXT: lui a1, 307200
188 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
189 ; CHECK-NEXT: vfabs.v v8, v12
190 ; CHECK-NEXT: fmv.w.x fa5, a1
191 ; CHECK-NEXT: vmflt.vf v0, v8, fa5
192 ; CHECK-NEXT: vfcvt.x.f.v v8, v12, v0.t
193 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
194 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
195 ; CHECK-NEXT: vfsgnj.vv v12, v8, v12, v0.t
196 ; CHECK-NEXT: vsetvli a0, zero, e16, m2, ta, ma
197 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v12
199 %v = call <vscale x 8 x bfloat> @llvm.vp.rint.nxv8bf16(<vscale x 8 x bfloat> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
200 ret <vscale x 8 x bfloat> %v
203 declare <vscale x 16 x bfloat> @llvm.vp.rint.nxv16bf16(<vscale x 16 x bfloat>, <vscale x 16 x i1>, i32)
205 define <vscale x 16 x bfloat> @vp_rint_nxv16bf16(<vscale x 16 x bfloat> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
206 ; CHECK-LABEL: vp_rint_nxv16bf16:
208 ; CHECK-NEXT: vmv1r.v v12, v0
209 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
210 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
211 ; CHECK-NEXT: lui a1, 307200
212 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
213 ; CHECK-NEXT: vfabs.v v24, v16, v0.t
214 ; CHECK-NEXT: fmv.w.x fa5, a1
215 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
216 ; CHECK-NEXT: vmflt.vf v12, v24, fa5, v0.t
217 ; CHECK-NEXT: vmv1r.v v0, v12
218 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
219 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
220 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
221 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
222 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
223 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
224 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v16
226 %v = call <vscale x 16 x bfloat> @llvm.vp.rint.nxv16bf16(<vscale x 16 x bfloat> %va, <vscale x 16 x i1> %m, i32 %evl)
227 ret <vscale x 16 x bfloat> %v
230 define <vscale x 16 x bfloat> @vp_rint_nxv16bf16_unmasked(<vscale x 16 x bfloat> %va, i32 zeroext %evl) {
231 ; CHECK-LABEL: vp_rint_nxv16bf16_unmasked:
233 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
234 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
235 ; CHECK-NEXT: lui a1, 307200
236 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
237 ; CHECK-NEXT: vfabs.v v8, v16
238 ; CHECK-NEXT: fmv.w.x fa5, a1
239 ; CHECK-NEXT: vmflt.vf v0, v8, fa5
240 ; CHECK-NEXT: vfcvt.x.f.v v8, v16, v0.t
241 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
242 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
243 ; CHECK-NEXT: vfsgnj.vv v16, v8, v16, v0.t
244 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
245 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v16
247 %v = call <vscale x 16 x bfloat> @llvm.vp.rint.nxv16bf16(<vscale x 16 x bfloat> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
248 ret <vscale x 16 x bfloat> %v
251 declare <vscale x 32 x bfloat> @llvm.vp.rint.nxv32bf16(<vscale x 32 x bfloat>, <vscale x 32 x i1>, i32)
253 define <vscale x 32 x bfloat> @vp_rint_nxv32bf16(<vscale x 32 x bfloat> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
254 ; CHECK-LABEL: vp_rint_nxv32bf16:
256 ; CHECK-NEXT: addi sp, sp, -16
257 ; CHECK-NEXT: .cfi_def_cfa_offset 16
258 ; CHECK-NEXT: csrr a1, vlenb
259 ; CHECK-NEXT: slli a1, a1, 3
260 ; CHECK-NEXT: sub sp, sp, a1
261 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
262 ; CHECK-NEXT: vmv1r.v v7, v0
263 ; CHECK-NEXT: csrr a2, vlenb
264 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
265 ; CHECK-NEXT: vfwcvtbf16.f.f.v v24, v12
266 ; CHECK-NEXT: lui a3, 307200
267 ; CHECK-NEXT: slli a1, a2, 1
268 ; CHECK-NEXT: srli a2, a2, 2
269 ; CHECK-NEXT: fmv.w.x fa5, a3
270 ; CHECK-NEXT: sub a3, a0, a1
271 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
272 ; CHECK-NEXT: vslidedown.vx v12, v0, a2
273 ; CHECK-NEXT: sltu a2, a0, a3
274 ; CHECK-NEXT: addi a2, a2, -1
275 ; CHECK-NEXT: and a2, a2, a3
276 ; CHECK-NEXT: vmv1r.v v0, v12
277 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
278 ; CHECK-NEXT: vfabs.v v16, v24, v0.t
279 ; CHECK-NEXT: addi a2, sp, 16
280 ; CHECK-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
281 ; CHECK-NEXT: vl8r.v v16, (a2) # Unknown-size Folded Reload
282 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
283 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
284 ; CHECK-NEXT: vmv1r.v v0, v12
285 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
286 ; CHECK-NEXT: vfcvt.x.f.v v16, v24, v0.t
287 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
288 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
289 ; CHECK-NEXT: vfsgnj.vv v24, v16, v24, v0.t
290 ; CHECK-NEXT: vsetvli a2, zero, e16, m4, ta, ma
291 ; CHECK-NEXT: vfncvtbf16.f.f.w v12, v24
292 ; CHECK-NEXT: bltu a0, a1, .LBB10_2
293 ; CHECK-NEXT: # %bb.1:
294 ; CHECK-NEXT: mv a0, a1
295 ; CHECK-NEXT: .LBB10_2:
296 ; CHECK-NEXT: vfwcvtbf16.f.f.v v24, v8
297 ; CHECK-NEXT: vmv1r.v v0, v7
298 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
299 ; CHECK-NEXT: vfabs.v v16, v24, v0.t
300 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
301 ; CHECK-NEXT: vmflt.vf v7, v16, fa5, v0.t
302 ; CHECK-NEXT: vmv1r.v v0, v7
303 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
304 ; CHECK-NEXT: vfcvt.x.f.v v16, v24, v0.t
305 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
306 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
307 ; CHECK-NEXT: vfsgnj.vv v24, v16, v24, v0.t
308 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
309 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v24
310 ; CHECK-NEXT: csrr a0, vlenb
311 ; CHECK-NEXT: slli a0, a0, 3
312 ; CHECK-NEXT: add sp, sp, a0
313 ; CHECK-NEXT: .cfi_def_cfa sp, 16
314 ; CHECK-NEXT: addi sp, sp, 16
315 ; CHECK-NEXT: .cfi_def_cfa_offset 0
317 %v = call <vscale x 32 x bfloat> @llvm.vp.rint.nxv32bf16(<vscale x 32 x bfloat> %va, <vscale x 32 x i1> %m, i32 %evl)
318 ret <vscale x 32 x bfloat> %v
321 define <vscale x 32 x bfloat> @vp_rint_nxv32bf16_unmasked(<vscale x 32 x bfloat> %va, i32 zeroext %evl) {
322 ; CHECK-LABEL: vp_rint_nxv32bf16_unmasked:
324 ; CHECK-NEXT: csrr a2, vlenb
325 ; CHECK-NEXT: vsetvli a1, zero, e8, m4, ta, ma
326 ; CHECK-NEXT: vmset.m v24
327 ; CHECK-NEXT: vsetvli a1, zero, e16, m4, ta, ma
328 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v12
329 ; CHECK-NEXT: lui a3, 307200
330 ; CHECK-NEXT: slli a1, a2, 1
331 ; CHECK-NEXT: srli a2, a2, 2
332 ; CHECK-NEXT: fmv.w.x fa5, a3
333 ; CHECK-NEXT: sub a3, a0, a1
334 ; CHECK-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
335 ; CHECK-NEXT: vslidedown.vx v12, v24, a2
336 ; CHECK-NEXT: sltu a2, a0, a3
337 ; CHECK-NEXT: addi a2, a2, -1
338 ; CHECK-NEXT: and a2, a2, a3
339 ; CHECK-NEXT: vmv1r.v v0, v12
340 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
341 ; CHECK-NEXT: vfabs.v v24, v16, v0.t
342 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
343 ; CHECK-NEXT: vmflt.vf v12, v24, fa5, v0.t
344 ; CHECK-NEXT: vmv1r.v v0, v12
345 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
346 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
347 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
348 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
349 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
350 ; CHECK-NEXT: vsetvli a2, zero, e16, m4, ta, ma
351 ; CHECK-NEXT: vfncvtbf16.f.f.w v12, v16
352 ; CHECK-NEXT: bltu a0, a1, .LBB11_2
353 ; CHECK-NEXT: # %bb.1:
354 ; CHECK-NEXT: mv a0, a1
355 ; CHECK-NEXT: .LBB11_2:
356 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
357 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
358 ; CHECK-NEXT: vfabs.v v24, v16
359 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
360 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
361 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
362 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
363 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
364 ; CHECK-NEXT: vsetvli a0, zero, e16, m4, ta, ma
365 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v16
367 %v = call <vscale x 32 x bfloat> @llvm.vp.rint.nxv32bf16(<vscale x 32 x bfloat> %va, <vscale x 32 x i1> splat (i1 true), i32 %evl)
368 ret <vscale x 32 x bfloat> %v
370 declare <vscale x 1 x half> @llvm.vp.rint.nxv1f16(<vscale x 1 x half>, <vscale x 1 x i1>, i32)
372 define <vscale x 1 x half> @vp_rint_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
373 ; ZVFH-LABEL: vp_rint_nxv1f16:
375 ; ZVFH-NEXT: lui a1, %hi(.LCPI12_0)
376 ; ZVFH-NEXT: flh fa5, %lo(.LCPI12_0)(a1)
377 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
378 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
379 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
380 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
381 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
382 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
383 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
384 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
385 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
388 ; ZVFHMIN-LABEL: vp_rint_nxv1f16:
390 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
391 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
392 ; ZVFHMIN-NEXT: lui a1, 307200
393 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
394 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
395 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
396 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
397 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
398 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
399 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
400 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
401 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
402 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
403 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
404 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
406 %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)
407 ret <vscale x 1 x half> %v
410 define <vscale x 1 x half> @vp_rint_nxv1f16_unmasked(<vscale x 1 x half> %va, i32 zeroext %evl) {
411 ; ZVFH-LABEL: vp_rint_nxv1f16_unmasked:
413 ; ZVFH-NEXT: lui a1, %hi(.LCPI13_0)
414 ; ZVFH-NEXT: flh fa5, %lo(.LCPI13_0)(a1)
415 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
416 ; ZVFH-NEXT: vfabs.v v9, v8
417 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
418 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
419 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
420 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
421 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
424 ; ZVFHMIN-LABEL: vp_rint_nxv1f16_unmasked:
426 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf4, ta, ma
427 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
428 ; ZVFHMIN-NEXT: lui a1, 307200
429 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
430 ; ZVFHMIN-NEXT: vfabs.v v8, v9
431 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
432 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
433 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
434 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
435 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
436 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
437 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
438 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
440 %v = call <vscale x 1 x half> @llvm.vp.rint.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
441 ret <vscale x 1 x half> %v
444 declare <vscale x 2 x half> @llvm.vp.rint.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
446 define <vscale x 2 x half> @vp_rint_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
447 ; ZVFH-LABEL: vp_rint_nxv2f16:
449 ; ZVFH-NEXT: lui a1, %hi(.LCPI14_0)
450 ; ZVFH-NEXT: flh fa5, %lo(.LCPI14_0)(a1)
451 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
452 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
453 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
454 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
455 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
456 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
457 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
458 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
459 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
462 ; ZVFHMIN-LABEL: vp_rint_nxv2f16:
464 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
465 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
466 ; ZVFHMIN-NEXT: lui a1, 307200
467 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
468 ; ZVFHMIN-NEXT: vfabs.v v8, v9, v0.t
469 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
470 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
471 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5, v0.t
472 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
473 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
474 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
475 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
476 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
477 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
478 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
480 %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)
481 ret <vscale x 2 x half> %v
484 define <vscale x 2 x half> @vp_rint_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
485 ; ZVFH-LABEL: vp_rint_nxv2f16_unmasked:
487 ; ZVFH-NEXT: lui a1, %hi(.LCPI15_0)
488 ; ZVFH-NEXT: flh fa5, %lo(.LCPI15_0)(a1)
489 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
490 ; ZVFH-NEXT: vfabs.v v9, v8
491 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
492 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
493 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
494 ; ZVFH-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
495 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
498 ; ZVFHMIN-LABEL: vp_rint_nxv2f16_unmasked:
500 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
501 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
502 ; ZVFHMIN-NEXT: lui a1, 307200
503 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
504 ; ZVFHMIN-NEXT: vfabs.v v8, v9
505 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
506 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
507 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v9, v0.t
508 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
509 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, mu
510 ; ZVFHMIN-NEXT: vfsgnj.vv v9, v8, v9, v0.t
511 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
512 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
514 %v = call <vscale x 2 x half> @llvm.vp.rint.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
515 ret <vscale x 2 x half> %v
518 declare <vscale x 4 x half> @llvm.vp.rint.nxv4f16(<vscale x 4 x half>, <vscale x 4 x i1>, i32)
520 define <vscale x 4 x half> @vp_rint_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
521 ; ZVFH-LABEL: vp_rint_nxv4f16:
523 ; ZVFH-NEXT: lui a1, %hi(.LCPI16_0)
524 ; ZVFH-NEXT: flh fa5, %lo(.LCPI16_0)(a1)
525 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
526 ; ZVFH-NEXT: vfabs.v v9, v8, v0.t
527 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
528 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5, v0.t
529 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, ma
530 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
531 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
532 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
533 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
536 ; ZVFHMIN-LABEL: vp_rint_nxv4f16:
538 ; ZVFHMIN-NEXT: vmv1r.v v9, v0
539 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
540 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
541 ; ZVFHMIN-NEXT: lui a1, 307200
542 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
543 ; ZVFHMIN-NEXT: vfabs.v v12, v10, v0.t
544 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
545 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
546 ; ZVFHMIN-NEXT: vmflt.vf v9, v12, fa5, v0.t
547 ; ZVFHMIN-NEXT: vmv1r.v v0, v9
548 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
549 ; ZVFHMIN-NEXT: vfcvt.x.f.v v12, v10, v0.t
550 ; ZVFHMIN-NEXT: vfcvt.f.x.v v12, v12, v0.t
551 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
552 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v12, v10, v0.t
553 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
554 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
556 %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)
557 ret <vscale x 4 x half> %v
560 define <vscale x 4 x half> @vp_rint_nxv4f16_unmasked(<vscale x 4 x half> %va, i32 zeroext %evl) {
561 ; ZVFH-LABEL: vp_rint_nxv4f16_unmasked:
563 ; ZVFH-NEXT: lui a1, %hi(.LCPI17_0)
564 ; ZVFH-NEXT: flh fa5, %lo(.LCPI17_0)(a1)
565 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
566 ; ZVFH-NEXT: vfabs.v v9, v8
567 ; ZVFH-NEXT: vmflt.vf v0, v9, fa5
568 ; ZVFH-NEXT: vfcvt.x.f.v v9, v8, v0.t
569 ; ZVFH-NEXT: vfcvt.f.x.v v9, v9, v0.t
570 ; ZVFH-NEXT: vsetvli zero, zero, e16, m1, ta, mu
571 ; ZVFH-NEXT: vfsgnj.vv v8, v9, v8, v0.t
574 ; ZVFHMIN-LABEL: vp_rint_nxv4f16_unmasked:
576 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
577 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
578 ; ZVFHMIN-NEXT: lui a1, 307200
579 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
580 ; ZVFHMIN-NEXT: vfabs.v v8, v10
581 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
582 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
583 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v10, v0.t
584 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
585 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, mu
586 ; ZVFHMIN-NEXT: vfsgnj.vv v10, v8, v10, v0.t
587 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
588 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
590 %v = call <vscale x 4 x half> @llvm.vp.rint.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
591 ret <vscale x 4 x half> %v
594 declare <vscale x 8 x half> @llvm.vp.rint.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, i32)
596 define <vscale x 8 x half> @vp_rint_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
597 ; ZVFH-LABEL: vp_rint_nxv8f16:
599 ; ZVFH-NEXT: vmv1r.v v10, v0
600 ; ZVFH-NEXT: lui a1, %hi(.LCPI18_0)
601 ; ZVFH-NEXT: flh fa5, %lo(.LCPI18_0)(a1)
602 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
603 ; ZVFH-NEXT: vfabs.v v12, v8, v0.t
604 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
605 ; ZVFH-NEXT: vmflt.vf v10, v12, fa5, v0.t
606 ; ZVFH-NEXT: vmv1r.v v0, v10
607 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, ma
608 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
609 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
610 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
611 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
614 ; ZVFHMIN-LABEL: vp_rint_nxv8f16:
616 ; ZVFHMIN-NEXT: vmv1r.v v10, v0
617 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
618 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
619 ; ZVFHMIN-NEXT: lui a1, 307200
620 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
621 ; ZVFHMIN-NEXT: vfabs.v v16, v12, v0.t
622 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
623 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
624 ; ZVFHMIN-NEXT: vmflt.vf v10, v16, fa5, v0.t
625 ; ZVFHMIN-NEXT: vmv1r.v v0, v10
626 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
627 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v12, v0.t
628 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
629 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
630 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v16, v12, v0.t
631 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
632 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
634 %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)
635 ret <vscale x 8 x half> %v
638 define <vscale x 8 x half> @vp_rint_nxv8f16_unmasked(<vscale x 8 x half> %va, i32 zeroext %evl) {
639 ; ZVFH-LABEL: vp_rint_nxv8f16_unmasked:
641 ; ZVFH-NEXT: lui a1, %hi(.LCPI19_0)
642 ; ZVFH-NEXT: flh fa5, %lo(.LCPI19_0)(a1)
643 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
644 ; ZVFH-NEXT: vfabs.v v10, v8
645 ; ZVFH-NEXT: vmflt.vf v0, v10, fa5
646 ; ZVFH-NEXT: vfcvt.x.f.v v10, v8, v0.t
647 ; ZVFH-NEXT: vfcvt.f.x.v v10, v10, v0.t
648 ; ZVFH-NEXT: vsetvli zero, zero, e16, m2, ta, mu
649 ; ZVFH-NEXT: vfsgnj.vv v8, v10, v8, v0.t
652 ; ZVFHMIN-LABEL: vp_rint_nxv8f16_unmasked:
654 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
655 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
656 ; ZVFHMIN-NEXT: lui a1, 307200
657 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
658 ; ZVFHMIN-NEXT: vfabs.v v8, v12
659 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
660 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
661 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v12, v0.t
662 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
663 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, mu
664 ; ZVFHMIN-NEXT: vfsgnj.vv v12, v8, v12, v0.t
665 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
666 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
668 %v = call <vscale x 8 x half> @llvm.vp.rint.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
669 ret <vscale x 8 x half> %v
672 declare <vscale x 16 x half> @llvm.vp.rint.nxv16f16(<vscale x 16 x half>, <vscale x 16 x i1>, i32)
674 define <vscale x 16 x half> @vp_rint_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
675 ; ZVFH-LABEL: vp_rint_nxv16f16:
677 ; ZVFH-NEXT: vmv1r.v v12, v0
678 ; ZVFH-NEXT: lui a1, %hi(.LCPI20_0)
679 ; ZVFH-NEXT: flh fa5, %lo(.LCPI20_0)(a1)
680 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
681 ; ZVFH-NEXT: vfabs.v v16, v8, v0.t
682 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
683 ; ZVFH-NEXT: vmflt.vf v12, v16, fa5, v0.t
684 ; ZVFH-NEXT: vmv1r.v v0, v12
685 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, ma
686 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
687 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
688 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
689 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
692 ; ZVFHMIN-LABEL: vp_rint_nxv16f16:
694 ; ZVFHMIN-NEXT: vmv1r.v v12, v0
695 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
696 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
697 ; ZVFHMIN-NEXT: lui a1, 307200
698 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
699 ; ZVFHMIN-NEXT: vfabs.v v24, v16, v0.t
700 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
701 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
702 ; ZVFHMIN-NEXT: vmflt.vf v12, v24, fa5, v0.t
703 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
704 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
705 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
706 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
707 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
708 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
709 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
710 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
712 %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)
713 ret <vscale x 16 x half> %v
716 define <vscale x 16 x half> @vp_rint_nxv16f16_unmasked(<vscale x 16 x half> %va, i32 zeroext %evl) {
717 ; ZVFH-LABEL: vp_rint_nxv16f16_unmasked:
719 ; ZVFH-NEXT: lui a1, %hi(.LCPI21_0)
720 ; ZVFH-NEXT: flh fa5, %lo(.LCPI21_0)(a1)
721 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
722 ; ZVFH-NEXT: vfabs.v v12, v8
723 ; ZVFH-NEXT: vmflt.vf v0, v12, fa5
724 ; ZVFH-NEXT: vfcvt.x.f.v v12, v8, v0.t
725 ; ZVFH-NEXT: vfcvt.f.x.v v12, v12, v0.t
726 ; ZVFH-NEXT: vsetvli zero, zero, e16, m4, ta, mu
727 ; ZVFH-NEXT: vfsgnj.vv v8, v12, v8, v0.t
730 ; ZVFHMIN-LABEL: vp_rint_nxv16f16_unmasked:
732 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
733 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
734 ; ZVFHMIN-NEXT: lui a1, 307200
735 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
736 ; ZVFHMIN-NEXT: vfabs.v v8, v16
737 ; ZVFHMIN-NEXT: fmv.w.x fa5, a1
738 ; ZVFHMIN-NEXT: vmflt.vf v0, v8, fa5
739 ; ZVFHMIN-NEXT: vfcvt.x.f.v v8, v16, v0.t
740 ; ZVFHMIN-NEXT: vfcvt.f.x.v v8, v8, v0.t
741 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
742 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v8, v16, v0.t
743 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
744 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
746 %v = call <vscale x 16 x half> @llvm.vp.rint.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
747 ret <vscale x 16 x half> %v
750 declare <vscale x 32 x half> @llvm.vp.rint.nxv32f16(<vscale x 32 x half>, <vscale x 32 x i1>, i32)
752 define <vscale x 32 x half> @vp_rint_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
753 ; ZVFH-LABEL: vp_rint_nxv32f16:
755 ; ZVFH-NEXT: vmv1r.v v16, v0
756 ; ZVFH-NEXT: lui a1, %hi(.LCPI22_0)
757 ; ZVFH-NEXT: flh fa5, %lo(.LCPI22_0)(a1)
758 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
759 ; ZVFH-NEXT: vfabs.v v24, v8, v0.t
760 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
761 ; ZVFH-NEXT: vmflt.vf v16, v24, fa5, v0.t
762 ; ZVFH-NEXT: vmv1r.v v0, v16
763 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, ma
764 ; ZVFH-NEXT: vfcvt.x.f.v v24, v8, v0.t
765 ; ZVFH-NEXT: vfcvt.f.x.v v24, v24, v0.t
766 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
767 ; ZVFH-NEXT: vfsgnj.vv v8, v24, v8, v0.t
770 ; ZVFHMIN-LABEL: vp_rint_nxv32f16:
772 ; ZVFHMIN-NEXT: addi sp, sp, -16
773 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
774 ; ZVFHMIN-NEXT: csrr a1, vlenb
775 ; ZVFHMIN-NEXT: slli a1, a1, 3
776 ; ZVFHMIN-NEXT: sub sp, sp, a1
777 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
778 ; ZVFHMIN-NEXT: vmv1r.v v7, v0
779 ; ZVFHMIN-NEXT: csrr a2, vlenb
780 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
781 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
782 ; ZVFHMIN-NEXT: lui a3, 307200
783 ; ZVFHMIN-NEXT: slli a1, a2, 1
784 ; ZVFHMIN-NEXT: srli a2, a2, 2
785 ; ZVFHMIN-NEXT: fmv.w.x fa5, a3
786 ; ZVFHMIN-NEXT: sub a3, a0, a1
787 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
788 ; ZVFHMIN-NEXT: vslidedown.vx v12, v0, a2
789 ; ZVFHMIN-NEXT: sltu a2, a0, a3
790 ; ZVFHMIN-NEXT: addi a2, a2, -1
791 ; ZVFHMIN-NEXT: and a2, a2, a3
792 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
793 ; ZVFHMIN-NEXT: vsetvli zero, a2, e32, m8, ta, ma
794 ; ZVFHMIN-NEXT: vfabs.v v16, v24, v0.t
795 ; ZVFHMIN-NEXT: addi a2, sp, 16
796 ; ZVFHMIN-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
797 ; ZVFHMIN-NEXT: vl8r.v v16, (a2) # Unknown-size Folded Reload
798 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
799 ; ZVFHMIN-NEXT: vmflt.vf v12, v16, fa5, v0.t
800 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
801 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
802 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v24, v0.t
803 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
804 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
805 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v16, v24, v0.t
806 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
807 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
808 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB22_2
809 ; ZVFHMIN-NEXT: # %bb.1:
810 ; ZVFHMIN-NEXT: mv a0, a1
811 ; ZVFHMIN-NEXT: .LBB22_2:
812 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
813 ; ZVFHMIN-NEXT: vmv1r.v v0, v7
814 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
815 ; ZVFHMIN-NEXT: vfabs.v v16, v24, v0.t
816 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
817 ; ZVFHMIN-NEXT: vmflt.vf v7, v16, fa5, v0.t
818 ; ZVFHMIN-NEXT: vmv1r.v v0, v7
819 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
820 ; ZVFHMIN-NEXT: vfcvt.x.f.v v16, v24, v0.t
821 ; ZVFHMIN-NEXT: vfcvt.f.x.v v16, v16, v0.t
822 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
823 ; ZVFHMIN-NEXT: vfsgnj.vv v24, v16, v24, v0.t
824 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
825 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
826 ; ZVFHMIN-NEXT: csrr a0, vlenb
827 ; ZVFHMIN-NEXT: slli a0, a0, 3
828 ; ZVFHMIN-NEXT: add sp, sp, a0
829 ; ZVFHMIN-NEXT: .cfi_def_cfa sp, 16
830 ; ZVFHMIN-NEXT: addi sp, sp, 16
831 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 0
833 %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)
834 ret <vscale x 32 x half> %v
837 define <vscale x 32 x half> @vp_rint_nxv32f16_unmasked(<vscale x 32 x half> %va, i32 zeroext %evl) {
838 ; ZVFH-LABEL: vp_rint_nxv32f16_unmasked:
840 ; ZVFH-NEXT: lui a1, %hi(.LCPI23_0)
841 ; ZVFH-NEXT: flh fa5, %lo(.LCPI23_0)(a1)
842 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
843 ; ZVFH-NEXT: vfabs.v v16, v8
844 ; ZVFH-NEXT: vmflt.vf v0, v16, fa5
845 ; ZVFH-NEXT: vfcvt.x.f.v v16, v8, v0.t
846 ; ZVFH-NEXT: vfcvt.f.x.v v16, v16, v0.t
847 ; ZVFH-NEXT: vsetvli zero, zero, e16, m8, ta, mu
848 ; ZVFH-NEXT: vfsgnj.vv v8, v16, v8, v0.t
851 ; ZVFHMIN-LABEL: vp_rint_nxv32f16_unmasked:
853 ; ZVFHMIN-NEXT: csrr a2, vlenb
854 ; ZVFHMIN-NEXT: vsetvli a1, zero, e8, m4, ta, ma
855 ; ZVFHMIN-NEXT: vmset.m v24
856 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
857 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
858 ; ZVFHMIN-NEXT: lui a3, 307200
859 ; ZVFHMIN-NEXT: slli a1, a2, 1
860 ; ZVFHMIN-NEXT: srli a2, a2, 2
861 ; ZVFHMIN-NEXT: fmv.w.x fa5, a3
862 ; ZVFHMIN-NEXT: sub a3, a0, a1
863 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
864 ; ZVFHMIN-NEXT: vslidedown.vx v12, v24, a2
865 ; ZVFHMIN-NEXT: sltu a2, a0, a3
866 ; ZVFHMIN-NEXT: addi a2, a2, -1
867 ; ZVFHMIN-NEXT: and a2, a2, a3
868 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
869 ; ZVFHMIN-NEXT: vsetvli zero, a2, e32, m8, ta, ma
870 ; ZVFHMIN-NEXT: vfabs.v v24, v16, v0.t
871 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
872 ; ZVFHMIN-NEXT: vmflt.vf v12, v24, fa5, v0.t
873 ; ZVFHMIN-NEXT: vmv1r.v v0, v12
874 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
875 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
876 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
877 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
878 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
879 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
880 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
881 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB23_2
882 ; ZVFHMIN-NEXT: # %bb.1:
883 ; ZVFHMIN-NEXT: mv a0, a1
884 ; ZVFHMIN-NEXT: .LBB23_2:
885 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
886 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
887 ; ZVFHMIN-NEXT: vfabs.v v24, v16
888 ; ZVFHMIN-NEXT: vmflt.vf v0, v24, fa5
889 ; ZVFHMIN-NEXT: vfcvt.x.f.v v24, v16, v0.t
890 ; ZVFHMIN-NEXT: vfcvt.f.x.v v24, v24, v0.t
891 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, mu
892 ; ZVFHMIN-NEXT: vfsgnj.vv v16, v24, v16, v0.t
893 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
894 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
896 %v = call <vscale x 32 x half> @llvm.vp.rint.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> splat (i1 true), i32 %evl)
897 ret <vscale x 32 x half> %v
900 declare <vscale x 1 x float> @llvm.vp.rint.nxv1f32(<vscale x 1 x float>, <vscale x 1 x i1>, i32)
902 define <vscale x 1 x float> @vp_rint_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
903 ; CHECK-LABEL: vp_rint_nxv1f32:
905 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
906 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
907 ; CHECK-NEXT: lui a0, 307200
908 ; CHECK-NEXT: fmv.w.x fa5, a0
909 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
910 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
911 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
912 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
913 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
914 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
915 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
917 %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)
918 ret <vscale x 1 x float> %v
921 define <vscale x 1 x float> @vp_rint_nxv1f32_unmasked(<vscale x 1 x float> %va, i32 zeroext %evl) {
922 ; CHECK-LABEL: vp_rint_nxv1f32_unmasked:
924 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
925 ; CHECK-NEXT: vfabs.v v9, v8
926 ; CHECK-NEXT: lui a0, 307200
927 ; CHECK-NEXT: fmv.w.x fa5, a0
928 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
929 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
930 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
931 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
932 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
934 %v = call <vscale x 1 x float> @llvm.vp.rint.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
935 ret <vscale x 1 x float> %v
938 declare <vscale x 2 x float> @llvm.vp.rint.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
940 define <vscale x 2 x float> @vp_rint_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
941 ; CHECK-LABEL: vp_rint_nxv2f32:
943 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
944 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
945 ; CHECK-NEXT: lui a0, 307200
946 ; CHECK-NEXT: fmv.w.x fa5, a0
947 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
948 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
949 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
950 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
951 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
952 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
953 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
955 %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)
956 ret <vscale x 2 x float> %v
959 define <vscale x 2 x float> @vp_rint_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
960 ; CHECK-LABEL: vp_rint_nxv2f32_unmasked:
962 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
963 ; CHECK-NEXT: vfabs.v v9, v8
964 ; CHECK-NEXT: lui a0, 307200
965 ; CHECK-NEXT: fmv.w.x fa5, a0
966 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
967 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
968 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
969 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
970 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
972 %v = call <vscale x 2 x float> @llvm.vp.rint.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
973 ret <vscale x 2 x float> %v
976 declare <vscale x 4 x float> @llvm.vp.rint.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, i32)
978 define <vscale x 4 x float> @vp_rint_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
979 ; CHECK-LABEL: vp_rint_nxv4f32:
981 ; CHECK-NEXT: vmv1r.v v10, v0
982 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
983 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
984 ; CHECK-NEXT: lui a0, 307200
985 ; CHECK-NEXT: fmv.w.x fa5, a0
986 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
987 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
988 ; CHECK-NEXT: vmv1r.v v0, v10
989 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
990 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
991 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
992 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
993 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
995 %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)
996 ret <vscale x 4 x float> %v
999 define <vscale x 4 x float> @vp_rint_nxv4f32_unmasked(<vscale x 4 x float> %va, i32 zeroext %evl) {
1000 ; CHECK-LABEL: vp_rint_nxv4f32_unmasked:
1002 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
1003 ; CHECK-NEXT: vfabs.v v10, v8
1004 ; CHECK-NEXT: lui a0, 307200
1005 ; CHECK-NEXT: fmv.w.x fa5, a0
1006 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
1007 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
1008 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
1009 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
1010 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
1012 %v = call <vscale x 4 x float> @llvm.vp.rint.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1013 ret <vscale x 4 x float> %v
1016 declare <vscale x 8 x float> @llvm.vp.rint.nxv8f32(<vscale x 8 x float>, <vscale x 8 x i1>, i32)
1018 define <vscale x 8 x float> @vp_rint_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1019 ; CHECK-LABEL: vp_rint_nxv8f32:
1021 ; CHECK-NEXT: vmv1r.v v12, v0
1022 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1023 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
1024 ; CHECK-NEXT: lui a0, 307200
1025 ; CHECK-NEXT: fmv.w.x fa5, a0
1026 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
1027 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
1028 ; CHECK-NEXT: vmv1r.v v0, v12
1029 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
1030 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1031 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1032 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
1033 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1035 %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)
1036 ret <vscale x 8 x float> %v
1039 define <vscale x 8 x float> @vp_rint_nxv8f32_unmasked(<vscale x 8 x float> %va, i32 zeroext %evl) {
1040 ; CHECK-LABEL: vp_rint_nxv8f32_unmasked:
1042 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
1043 ; CHECK-NEXT: vfabs.v v12, v8
1044 ; CHECK-NEXT: lui a0, 307200
1045 ; CHECK-NEXT: fmv.w.x fa5, a0
1046 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
1047 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
1048 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
1049 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
1050 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1052 %v = call <vscale x 8 x float> @llvm.vp.rint.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1053 ret <vscale x 8 x float> %v
1056 declare <vscale x 16 x float> @llvm.vp.rint.nxv16f32(<vscale x 16 x float>, <vscale x 16 x i1>, i32)
1058 define <vscale x 16 x float> @vp_rint_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1059 ; CHECK-LABEL: vp_rint_nxv16f32:
1061 ; CHECK-NEXT: vmv1r.v v16, v0
1062 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1063 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1064 ; CHECK-NEXT: lui a0, 307200
1065 ; CHECK-NEXT: fmv.w.x fa5, a0
1066 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
1067 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
1068 ; CHECK-NEXT: vmv1r.v v0, v16
1069 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
1070 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1071 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1072 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
1073 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1075 %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)
1076 ret <vscale x 16 x float> %v
1079 define <vscale x 16 x float> @vp_rint_nxv16f32_unmasked(<vscale x 16 x float> %va, i32 zeroext %evl) {
1080 ; CHECK-LABEL: vp_rint_nxv16f32_unmasked:
1082 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1083 ; CHECK-NEXT: vfabs.v v16, v8
1084 ; CHECK-NEXT: lui a0, 307200
1085 ; CHECK-NEXT: fmv.w.x fa5, a0
1086 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
1087 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1088 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1089 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
1090 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1092 %v = call <vscale x 16 x float> @llvm.vp.rint.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1093 ret <vscale x 16 x float> %v
1096 declare <vscale x 1 x double> @llvm.vp.rint.nxv1f64(<vscale x 1 x double>, <vscale x 1 x i1>, i32)
1098 define <vscale x 1 x double> @vp_rint_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1099 ; CHECK-LABEL: vp_rint_nxv1f64:
1101 ; CHECK-NEXT: lui a1, %hi(.LCPI34_0)
1102 ; CHECK-NEXT: fld fa5, %lo(.LCPI34_0)(a1)
1103 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1104 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
1105 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1106 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
1107 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1108 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
1109 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
1110 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1111 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1113 %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)
1114 ret <vscale x 1 x double> %v
1117 define <vscale x 1 x double> @vp_rint_nxv1f64_unmasked(<vscale x 1 x double> %va, i32 zeroext %evl) {
1118 ; CHECK-LABEL: vp_rint_nxv1f64_unmasked:
1120 ; CHECK-NEXT: lui a1, %hi(.LCPI35_0)
1121 ; CHECK-NEXT: fld fa5, %lo(.LCPI35_0)(a1)
1122 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1123 ; CHECK-NEXT: vfabs.v v9, v8
1124 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
1125 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
1126 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
1127 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
1128 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
1130 %v = call <vscale x 1 x double> @llvm.vp.rint.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> splat (i1 true), i32 %evl)
1131 ret <vscale x 1 x double> %v
1134 declare <vscale x 2 x double> @llvm.vp.rint.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
1136 define <vscale x 2 x double> @vp_rint_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1137 ; CHECK-LABEL: vp_rint_nxv2f64:
1139 ; CHECK-NEXT: vmv1r.v v10, v0
1140 ; CHECK-NEXT: lui a1, %hi(.LCPI36_0)
1141 ; CHECK-NEXT: fld fa5, %lo(.LCPI36_0)(a1)
1142 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1143 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
1144 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
1145 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
1146 ; CHECK-NEXT: vmv1r.v v0, v10
1147 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
1148 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
1149 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
1150 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
1151 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1153 %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)
1154 ret <vscale x 2 x double> %v
1157 define <vscale x 2 x double> @vp_rint_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
1158 ; CHECK-LABEL: vp_rint_nxv2f64_unmasked:
1160 ; CHECK-NEXT: lui a1, %hi(.LCPI37_0)
1161 ; CHECK-NEXT: fld fa5, %lo(.LCPI37_0)(a1)
1162 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1163 ; CHECK-NEXT: vfabs.v v10, v8
1164 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
1165 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
1166 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
1167 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
1168 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
1170 %v = call <vscale x 2 x double> @llvm.vp.rint.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
1171 ret <vscale x 2 x double> %v
1174 declare <vscale x 4 x double> @llvm.vp.rint.nxv4f64(<vscale x 4 x double>, <vscale x 4 x i1>, i32)
1176 define <vscale x 4 x double> @vp_rint_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1177 ; CHECK-LABEL: vp_rint_nxv4f64:
1179 ; CHECK-NEXT: vmv1r.v v12, v0
1180 ; CHECK-NEXT: lui a1, %hi(.LCPI38_0)
1181 ; CHECK-NEXT: fld fa5, %lo(.LCPI38_0)(a1)
1182 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1183 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
1184 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1185 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
1186 ; CHECK-NEXT: vmv1r.v v0, v12
1187 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
1188 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1189 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1190 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1191 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1193 %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)
1194 ret <vscale x 4 x double> %v
1197 define <vscale x 4 x double> @vp_rint_nxv4f64_unmasked(<vscale x 4 x double> %va, i32 zeroext %evl) {
1198 ; CHECK-LABEL: vp_rint_nxv4f64_unmasked:
1200 ; CHECK-NEXT: lui a1, %hi(.LCPI39_0)
1201 ; CHECK-NEXT: fld fa5, %lo(.LCPI39_0)(a1)
1202 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1203 ; CHECK-NEXT: vfabs.v v12, v8
1204 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
1205 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
1206 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
1207 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
1208 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
1210 %v = call <vscale x 4 x double> @llvm.vp.rint.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> splat (i1 true), i32 %evl)
1211 ret <vscale x 4 x double> %v
1214 declare <vscale x 7 x double> @llvm.vp.rint.nxv7f64(<vscale x 7 x double>, <vscale x 7 x i1>, i32)
1216 define <vscale x 7 x double> @vp_rint_nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 zeroext %evl) {
1217 ; CHECK-LABEL: vp_rint_nxv7f64:
1219 ; CHECK-NEXT: vmv1r.v v16, v0
1220 ; CHECK-NEXT: lui a1, %hi(.LCPI40_0)
1221 ; CHECK-NEXT: fld fa5, %lo(.LCPI40_0)(a1)
1222 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1223 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1224 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1225 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
1226 ; CHECK-NEXT: vmv1r.v v0, v16
1227 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1228 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1229 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1230 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1231 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1233 %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)
1234 ret <vscale x 7 x double> %v
1237 define <vscale x 7 x double> @vp_rint_nxv7f64_unmasked(<vscale x 7 x double> %va, i32 zeroext %evl) {
1238 ; CHECK-LABEL: vp_rint_nxv7f64_unmasked:
1240 ; CHECK-NEXT: lui a1, %hi(.LCPI41_0)
1241 ; CHECK-NEXT: fld fa5, %lo(.LCPI41_0)(a1)
1242 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1243 ; CHECK-NEXT: vfabs.v v16, v8
1244 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
1245 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1246 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1247 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1248 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1250 %v = call <vscale x 7 x double> @llvm.vp.rint.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> splat (i1 true), i32 %evl)
1251 ret <vscale x 7 x double> %v
1254 declare <vscale x 8 x double> @llvm.vp.rint.nxv8f64(<vscale x 8 x double>, <vscale x 8 x i1>, i32)
1256 define <vscale x 8 x double> @vp_rint_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1257 ; CHECK-LABEL: vp_rint_nxv8f64:
1259 ; CHECK-NEXT: vmv1r.v v16, v0
1260 ; CHECK-NEXT: lui a1, %hi(.LCPI42_0)
1261 ; CHECK-NEXT: fld fa5, %lo(.LCPI42_0)(a1)
1262 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1263 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1264 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1265 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
1266 ; CHECK-NEXT: vmv1r.v v0, v16
1267 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1268 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1269 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1270 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1271 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1273 %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)
1274 ret <vscale x 8 x double> %v
1277 define <vscale x 8 x double> @vp_rint_nxv8f64_unmasked(<vscale x 8 x double> %va, i32 zeroext %evl) {
1278 ; CHECK-LABEL: vp_rint_nxv8f64_unmasked:
1280 ; CHECK-NEXT: lui a1, %hi(.LCPI43_0)
1281 ; CHECK-NEXT: fld fa5, %lo(.LCPI43_0)(a1)
1282 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1283 ; CHECK-NEXT: vfabs.v v16, v8
1284 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
1285 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
1286 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
1287 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1288 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
1290 %v = call <vscale x 8 x double> @llvm.vp.rint.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> splat (i1 true), i32 %evl)
1291 ret <vscale x 8 x double> %v
1295 declare <vscale x 16 x double> @llvm.vp.rint.nxv16f64(<vscale x 16 x double>, <vscale x 16 x i1>, i32)
1297 define <vscale x 16 x double> @vp_rint_nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1298 ; CHECK-LABEL: vp_rint_nxv16f64:
1300 ; CHECK-NEXT: addi sp, sp, -16
1301 ; CHECK-NEXT: .cfi_def_cfa_offset 16
1302 ; CHECK-NEXT: csrr a1, vlenb
1303 ; CHECK-NEXT: slli a1, a1, 3
1304 ; CHECK-NEXT: sub sp, sp, a1
1305 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
1306 ; CHECK-NEXT: vmv1r.v v7, v0
1307 ; CHECK-NEXT: csrr a1, vlenb
1308 ; CHECK-NEXT: lui a2, %hi(.LCPI44_0)
1309 ; CHECK-NEXT: srli a3, a1, 3
1310 ; CHECK-NEXT: fld fa5, %lo(.LCPI44_0)(a2)
1311 ; CHECK-NEXT: sub a2, a0, a1
1312 ; CHECK-NEXT: vsetvli a4, zero, e8, mf4, ta, ma
1313 ; CHECK-NEXT: vslidedown.vx v6, v0, a3
1314 ; CHECK-NEXT: sltu a3, a0, a2
1315 ; CHECK-NEXT: addi a3, a3, -1
1316 ; CHECK-NEXT: and a2, a3, a2
1317 ; CHECK-NEXT: vmv1r.v v0, v6
1318 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1319 ; CHECK-NEXT: vfabs.v v24, v16, v0.t
1320 ; CHECK-NEXT: addi a2, sp, 16
1321 ; CHECK-NEXT: vs8r.v v24, (a2) # Unknown-size Folded Spill
1322 ; CHECK-NEXT: vl8r.v v24, (a2) # Unknown-size Folded Reload
1323 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1324 ; CHECK-NEXT: vmflt.vf v6, v24, fa5, v0.t
1325 ; CHECK-NEXT: vmv1r.v v0, v6
1326 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1327 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
1328 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1329 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1330 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
1331 ; CHECK-NEXT: bltu a0, a1, .LBB44_2
1332 ; CHECK-NEXT: # %bb.1:
1333 ; CHECK-NEXT: mv a0, a1
1334 ; CHECK-NEXT: .LBB44_2:
1335 ; CHECK-NEXT: vmv1r.v v0, v7
1336 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1337 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
1338 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1339 ; CHECK-NEXT: vmflt.vf v7, v24, fa5, v0.t
1340 ; CHECK-NEXT: vmv1r.v v0, v7
1341 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
1342 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1343 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1344 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1345 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1346 ; CHECK-NEXT: csrr a0, vlenb
1347 ; CHECK-NEXT: slli a0, a0, 3
1348 ; CHECK-NEXT: add sp, sp, a0
1349 ; CHECK-NEXT: .cfi_def_cfa sp, 16
1350 ; CHECK-NEXT: addi sp, sp, 16
1351 ; CHECK-NEXT: .cfi_def_cfa_offset 0
1353 %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)
1354 ret <vscale x 16 x double> %v
1357 define <vscale x 16 x double> @vp_rint_nxv16f64_unmasked(<vscale x 16 x double> %va, i32 zeroext %evl) {
1358 ; CHECK-LABEL: vp_rint_nxv16f64_unmasked:
1360 ; CHECK-NEXT: csrr a1, vlenb
1361 ; CHECK-NEXT: lui a2, %hi(.LCPI45_0)
1362 ; CHECK-NEXT: sub a3, a0, a1
1363 ; CHECK-NEXT: fld fa5, %lo(.LCPI45_0)(a2)
1364 ; CHECK-NEXT: sltu a2, a0, a3
1365 ; CHECK-NEXT: addi a2, a2, -1
1366 ; CHECK-NEXT: and a2, a2, a3
1367 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
1368 ; CHECK-NEXT: vfabs.v v24, v16
1369 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1370 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
1371 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1372 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1373 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
1374 ; CHECK-NEXT: bltu a0, a1, .LBB45_2
1375 ; CHECK-NEXT: # %bb.1:
1376 ; CHECK-NEXT: mv a0, a1
1377 ; CHECK-NEXT: .LBB45_2:
1378 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1379 ; CHECK-NEXT: vfabs.v v24, v8
1380 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
1381 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
1382 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
1383 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
1384 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
1386 %v = call <vscale x 16 x double> @llvm.vp.rint.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> splat (i1 true), i32 %evl)
1387 ret <vscale x 16 x double> %v