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
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare <vscale x 1 x half> @llvm.vp.floor.nxv1f16(<vscale x 1 x half>, <vscale x 1 x i1>, i32)
9 define <vscale x 1 x half> @vp_floor_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
10 ; CHECK-LABEL: vp_floor_nxv1f16:
12 ; CHECK-NEXT: lui a1, %hi(.LCPI0_0)
13 ; CHECK-NEXT: flh fa5, %lo(.LCPI0_0)(a1)
14 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
15 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
16 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
17 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
18 ; CHECK-NEXT: fsrmi a0, 2
19 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
20 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
22 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
23 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
24 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
26 %v = call <vscale x 1 x half> @llvm.vp.floor.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
27 ret <vscale x 1 x half> %v
30 define <vscale x 1 x half> @vp_floor_nxv1f16_unmasked(<vscale x 1 x half> %va, i32 zeroext %evl) {
31 ; CHECK-LABEL: vp_floor_nxv1f16_unmasked:
33 ; CHECK-NEXT: lui a1, %hi(.LCPI1_0)
34 ; CHECK-NEXT: flh fa5, %lo(.LCPI1_0)(a1)
35 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
36 ; CHECK-NEXT: vfabs.v v9, v8
37 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
38 ; CHECK-NEXT: fsrmi a0, 2
39 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
41 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
42 ; CHECK-NEXT: vsetvli zero, zero, e16, mf4, ta, mu
43 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
45 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
46 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
47 %v = call <vscale x 1 x half> @llvm.vp.floor.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
48 ret <vscale x 1 x half> %v
51 declare <vscale x 2 x half> @llvm.vp.floor.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
53 define <vscale x 2 x half> @vp_floor_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
54 ; CHECK-LABEL: vp_floor_nxv2f16:
56 ; CHECK-NEXT: lui a1, %hi(.LCPI2_0)
57 ; CHECK-NEXT: flh fa5, %lo(.LCPI2_0)(a1)
58 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
59 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
60 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
61 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
62 ; CHECK-NEXT: fsrmi a0, 2
63 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
64 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
66 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
67 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
68 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
70 %v = call <vscale x 2 x half> @llvm.vp.floor.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
71 ret <vscale x 2 x half> %v
74 define <vscale x 2 x half> @vp_floor_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
75 ; CHECK-LABEL: vp_floor_nxv2f16_unmasked:
77 ; CHECK-NEXT: lui a1, %hi(.LCPI3_0)
78 ; CHECK-NEXT: flh fa5, %lo(.LCPI3_0)(a1)
79 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
80 ; CHECK-NEXT: vfabs.v v9, v8
81 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
82 ; CHECK-NEXT: fsrmi a0, 2
83 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
85 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
86 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, mu
87 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
89 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
90 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
91 %v = call <vscale x 2 x half> @llvm.vp.floor.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
92 ret <vscale x 2 x half> %v
95 declare <vscale x 4 x half> @llvm.vp.floor.nxv4f16(<vscale x 4 x half>, <vscale x 4 x i1>, i32)
97 define <vscale x 4 x half> @vp_floor_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
98 ; CHECK-LABEL: vp_floor_nxv4f16:
100 ; CHECK-NEXT: lui a1, %hi(.LCPI4_0)
101 ; CHECK-NEXT: flh fa5, %lo(.LCPI4_0)(a1)
102 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
103 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
104 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, ta, mu
105 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
106 ; CHECK-NEXT: fsrmi a0, 2
107 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, ta, ma
108 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
109 ; CHECK-NEXT: fsrm a0
110 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
111 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, ta, mu
112 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
114 %v = call <vscale x 4 x half> @llvm.vp.floor.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 %evl)
115 ret <vscale x 4 x half> %v
118 define <vscale x 4 x half> @vp_floor_nxv4f16_unmasked(<vscale x 4 x half> %va, i32 zeroext %evl) {
119 ; CHECK-LABEL: vp_floor_nxv4f16_unmasked:
121 ; CHECK-NEXT: lui a1, %hi(.LCPI5_0)
122 ; CHECK-NEXT: flh fa5, %lo(.LCPI5_0)(a1)
123 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
124 ; CHECK-NEXT: vfabs.v v9, v8
125 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
126 ; CHECK-NEXT: fsrmi a0, 2
127 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
128 ; CHECK-NEXT: fsrm a0
129 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
130 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, ta, mu
131 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
133 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
134 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
135 %v = call <vscale x 4 x half> @llvm.vp.floor.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x i1> %m, i32 %evl)
136 ret <vscale x 4 x half> %v
139 declare <vscale x 8 x half> @llvm.vp.floor.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, i32)
141 define <vscale x 8 x half> @vp_floor_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
142 ; CHECK-LABEL: vp_floor_nxv8f16:
144 ; CHECK-NEXT: vmv1r.v v10, v0
145 ; CHECK-NEXT: lui a1, %hi(.LCPI6_0)
146 ; CHECK-NEXT: flh fa5, %lo(.LCPI6_0)(a1)
147 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
148 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
149 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, mu
150 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
151 ; CHECK-NEXT: fsrmi a0, 2
152 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma
153 ; CHECK-NEXT: vmv1r.v v0, v10
154 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
155 ; CHECK-NEXT: fsrm a0
156 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
157 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, mu
158 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
160 %v = call <vscale x 8 x half> @llvm.vp.floor.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 %evl)
161 ret <vscale x 8 x half> %v
164 define <vscale x 8 x half> @vp_floor_nxv8f16_unmasked(<vscale x 8 x half> %va, i32 zeroext %evl) {
165 ; CHECK-LABEL: vp_floor_nxv8f16_unmasked:
167 ; CHECK-NEXT: lui a1, %hi(.LCPI7_0)
168 ; CHECK-NEXT: flh fa5, %lo(.LCPI7_0)(a1)
169 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
170 ; CHECK-NEXT: vfabs.v v10, v8
171 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
172 ; CHECK-NEXT: fsrmi a0, 2
173 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
174 ; CHECK-NEXT: fsrm a0
175 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
176 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, mu
177 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
179 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
180 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
181 %v = call <vscale x 8 x half> @llvm.vp.floor.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x i1> %m, i32 %evl)
182 ret <vscale x 8 x half> %v
185 declare <vscale x 16 x half> @llvm.vp.floor.nxv16f16(<vscale x 16 x half>, <vscale x 16 x i1>, i32)
187 define <vscale x 16 x half> @vp_floor_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
188 ; CHECK-LABEL: vp_floor_nxv16f16:
190 ; CHECK-NEXT: vmv1r.v v12, v0
191 ; CHECK-NEXT: lui a1, %hi(.LCPI8_0)
192 ; CHECK-NEXT: flh fa5, %lo(.LCPI8_0)(a1)
193 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
194 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
195 ; CHECK-NEXT: vsetvli zero, zero, e16, m4, ta, mu
196 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
197 ; CHECK-NEXT: fsrmi a0, 2
198 ; CHECK-NEXT: vsetvli zero, zero, e16, m4, ta, ma
199 ; CHECK-NEXT: vmv1r.v v0, v12
200 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
201 ; CHECK-NEXT: fsrm a0
202 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
203 ; CHECK-NEXT: vsetvli zero, zero, e16, m4, ta, mu
204 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
206 %v = call <vscale x 16 x half> @llvm.vp.floor.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 %evl)
207 ret <vscale x 16 x half> %v
210 define <vscale x 16 x half> @vp_floor_nxv16f16_unmasked(<vscale x 16 x half> %va, i32 zeroext %evl) {
211 ; CHECK-LABEL: vp_floor_nxv16f16_unmasked:
213 ; CHECK-NEXT: lui a1, %hi(.LCPI9_0)
214 ; CHECK-NEXT: flh fa5, %lo(.LCPI9_0)(a1)
215 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
216 ; CHECK-NEXT: vfabs.v v12, v8
217 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
218 ; CHECK-NEXT: fsrmi a0, 2
219 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
220 ; CHECK-NEXT: fsrm a0
221 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
222 ; CHECK-NEXT: vsetvli zero, zero, e16, m4, ta, mu
223 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
225 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
226 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
227 %v = call <vscale x 16 x half> @llvm.vp.floor.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x i1> %m, i32 %evl)
228 ret <vscale x 16 x half> %v
231 declare <vscale x 32 x half> @llvm.vp.floor.nxv32f16(<vscale x 32 x half>, <vscale x 32 x i1>, i32)
233 define <vscale x 32 x half> @vp_floor_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
234 ; CHECK-LABEL: vp_floor_nxv32f16:
236 ; CHECK-NEXT: vmv1r.v v16, v0
237 ; CHECK-NEXT: lui a1, %hi(.LCPI10_0)
238 ; CHECK-NEXT: flh fa5, %lo(.LCPI10_0)(a1)
239 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
240 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
241 ; CHECK-NEXT: vsetvli zero, zero, e16, m8, ta, mu
242 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
243 ; CHECK-NEXT: fsrmi a0, 2
244 ; CHECK-NEXT: vsetvli zero, zero, e16, m8, ta, ma
245 ; CHECK-NEXT: vmv1r.v v0, v16
246 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
247 ; CHECK-NEXT: fsrm a0
248 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
249 ; CHECK-NEXT: vsetvli zero, zero, e16, m8, ta, mu
250 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
252 %v = call <vscale x 32 x half> @llvm.vp.floor.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 %evl)
253 ret <vscale x 32 x half> %v
256 define <vscale x 32 x half> @vp_floor_nxv32f16_unmasked(<vscale x 32 x half> %va, i32 zeroext %evl) {
257 ; CHECK-LABEL: vp_floor_nxv32f16_unmasked:
259 ; CHECK-NEXT: lui a1, %hi(.LCPI11_0)
260 ; CHECK-NEXT: flh fa5, %lo(.LCPI11_0)(a1)
261 ; CHECK-NEXT: vsetvli zero, a0, e16, m8, ta, ma
262 ; CHECK-NEXT: vfabs.v v16, v8
263 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
264 ; CHECK-NEXT: fsrmi a0, 2
265 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
266 ; CHECK-NEXT: fsrm a0
267 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
268 ; CHECK-NEXT: vsetvli zero, zero, e16, m8, ta, mu
269 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
271 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
272 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
273 %v = call <vscale x 32 x half> @llvm.vp.floor.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x i1> %m, i32 %evl)
274 ret <vscale x 32 x half> %v
277 declare <vscale x 1 x float> @llvm.vp.floor.nxv1f32(<vscale x 1 x float>, <vscale x 1 x i1>, i32)
279 define <vscale x 1 x float> @vp_floor_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
280 ; CHECK-LABEL: vp_floor_nxv1f32:
282 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
283 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
284 ; CHECK-NEXT: lui a0, 307200
285 ; CHECK-NEXT: fmv.w.x fa5, a0
286 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
287 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
288 ; CHECK-NEXT: fsrmi a0, 2
289 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
290 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
291 ; CHECK-NEXT: fsrm a0
292 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
293 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
294 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
296 %v = call <vscale x 1 x float> @llvm.vp.floor.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 %evl)
297 ret <vscale x 1 x float> %v
300 define <vscale x 1 x float> @vp_floor_nxv1f32_unmasked(<vscale x 1 x float> %va, i32 zeroext %evl) {
301 ; CHECK-LABEL: vp_floor_nxv1f32_unmasked:
303 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
304 ; CHECK-NEXT: vfabs.v v9, v8
305 ; CHECK-NEXT: lui a0, 307200
306 ; CHECK-NEXT: fmv.w.x fa5, a0
307 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
308 ; CHECK-NEXT: fsrmi a0, 2
309 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
310 ; CHECK-NEXT: fsrm a0
311 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
312 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, mu
313 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
315 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
316 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
317 %v = call <vscale x 1 x float> @llvm.vp.floor.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x i1> %m, i32 %evl)
318 ret <vscale x 1 x float> %v
321 declare <vscale x 2 x float> @llvm.vp.floor.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
323 define <vscale x 2 x float> @vp_floor_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
324 ; CHECK-LABEL: vp_floor_nxv2f32:
326 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
327 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
328 ; CHECK-NEXT: lui a0, 307200
329 ; CHECK-NEXT: fmv.w.x fa5, a0
330 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
331 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
332 ; CHECK-NEXT: fsrmi a0, 2
333 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, ma
334 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
335 ; CHECK-NEXT: fsrm a0
336 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
337 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
338 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
340 %v = call <vscale x 2 x float> @llvm.vp.floor.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
341 ret <vscale x 2 x float> %v
344 define <vscale x 2 x float> @vp_floor_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
345 ; CHECK-LABEL: vp_floor_nxv2f32_unmasked:
347 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
348 ; CHECK-NEXT: vfabs.v v9, v8
349 ; CHECK-NEXT: lui a0, 307200
350 ; CHECK-NEXT: fmv.w.x fa5, a0
351 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
352 ; CHECK-NEXT: fsrmi a0, 2
353 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
354 ; CHECK-NEXT: fsrm a0
355 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
356 ; CHECK-NEXT: vsetvli zero, zero, e32, m1, ta, mu
357 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
359 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
360 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
361 %v = call <vscale x 2 x float> @llvm.vp.floor.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
362 ret <vscale x 2 x float> %v
365 declare <vscale x 4 x float> @llvm.vp.floor.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, i32)
367 define <vscale x 4 x float> @vp_floor_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
368 ; CHECK-LABEL: vp_floor_nxv4f32:
370 ; CHECK-NEXT: vmv1r.v v10, v0
371 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
372 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
373 ; CHECK-NEXT: lui a0, 307200
374 ; CHECK-NEXT: fmv.w.x fa5, a0
375 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
376 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
377 ; CHECK-NEXT: fsrmi a0, 2
378 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, ma
379 ; CHECK-NEXT: vmv1r.v v0, v10
380 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
381 ; CHECK-NEXT: fsrm a0
382 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
383 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
384 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
386 %v = call <vscale x 4 x float> @llvm.vp.floor.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 %evl)
387 ret <vscale x 4 x float> %v
390 define <vscale x 4 x float> @vp_floor_nxv4f32_unmasked(<vscale x 4 x float> %va, i32 zeroext %evl) {
391 ; CHECK-LABEL: vp_floor_nxv4f32_unmasked:
393 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
394 ; CHECK-NEXT: vfabs.v v10, v8
395 ; CHECK-NEXT: lui a0, 307200
396 ; CHECK-NEXT: fmv.w.x fa5, a0
397 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
398 ; CHECK-NEXT: fsrmi a0, 2
399 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
400 ; CHECK-NEXT: fsrm a0
401 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
402 ; CHECK-NEXT: vsetvli zero, zero, e32, m2, ta, mu
403 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
405 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
406 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
407 %v = call <vscale x 4 x float> @llvm.vp.floor.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x i1> %m, i32 %evl)
408 ret <vscale x 4 x float> %v
411 declare <vscale x 8 x float> @llvm.vp.floor.nxv8f32(<vscale x 8 x float>, <vscale x 8 x i1>, i32)
413 define <vscale x 8 x float> @vp_floor_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
414 ; CHECK-LABEL: vp_floor_nxv8f32:
416 ; CHECK-NEXT: vmv1r.v v12, v0
417 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
418 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
419 ; CHECK-NEXT: lui a0, 307200
420 ; CHECK-NEXT: fmv.w.x fa5, a0
421 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
422 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
423 ; CHECK-NEXT: fsrmi a0, 2
424 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, ma
425 ; CHECK-NEXT: vmv1r.v v0, v12
426 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
427 ; CHECK-NEXT: fsrm a0
428 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
429 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
430 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
432 %v = call <vscale x 8 x float> @llvm.vp.floor.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 %evl)
433 ret <vscale x 8 x float> %v
436 define <vscale x 8 x float> @vp_floor_nxv8f32_unmasked(<vscale x 8 x float> %va, i32 zeroext %evl) {
437 ; CHECK-LABEL: vp_floor_nxv8f32_unmasked:
439 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
440 ; CHECK-NEXT: vfabs.v v12, v8
441 ; CHECK-NEXT: lui a0, 307200
442 ; CHECK-NEXT: fmv.w.x fa5, a0
443 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
444 ; CHECK-NEXT: fsrmi a0, 2
445 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
446 ; CHECK-NEXT: fsrm a0
447 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
448 ; CHECK-NEXT: vsetvli zero, zero, e32, m4, ta, mu
449 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
451 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
452 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
453 %v = call <vscale x 8 x float> @llvm.vp.floor.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x i1> %m, i32 %evl)
454 ret <vscale x 8 x float> %v
457 declare <vscale x 16 x float> @llvm.vp.floor.nxv16f32(<vscale x 16 x float>, <vscale x 16 x i1>, i32)
459 define <vscale x 16 x float> @vp_floor_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
460 ; CHECK-LABEL: vp_floor_nxv16f32:
462 ; CHECK-NEXT: vmv1r.v v16, v0
463 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
464 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
465 ; CHECK-NEXT: lui a0, 307200
466 ; CHECK-NEXT: fmv.w.x fa5, a0
467 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
468 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
469 ; CHECK-NEXT: fsrmi a0, 2
470 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
471 ; CHECK-NEXT: vmv1r.v v0, v16
472 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
473 ; CHECK-NEXT: fsrm a0
474 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
475 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
476 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
478 %v = call <vscale x 16 x float> @llvm.vp.floor.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 %evl)
479 ret <vscale x 16 x float> %v
482 define <vscale x 16 x float> @vp_floor_nxv16f32_unmasked(<vscale x 16 x float> %va, i32 zeroext %evl) {
483 ; CHECK-LABEL: vp_floor_nxv16f32_unmasked:
485 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
486 ; CHECK-NEXT: vfabs.v v16, v8
487 ; CHECK-NEXT: lui a0, 307200
488 ; CHECK-NEXT: fmv.w.x fa5, a0
489 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
490 ; CHECK-NEXT: fsrmi a0, 2
491 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
492 ; CHECK-NEXT: fsrm a0
493 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
494 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, mu
495 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
497 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
498 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
499 %v = call <vscale x 16 x float> @llvm.vp.floor.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x i1> %m, i32 %evl)
500 ret <vscale x 16 x float> %v
503 declare <vscale x 1 x double> @llvm.vp.floor.nxv1f64(<vscale x 1 x double>, <vscale x 1 x i1>, i32)
505 define <vscale x 1 x double> @vp_floor_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 zeroext %evl) {
506 ; CHECK-LABEL: vp_floor_nxv1f64:
508 ; CHECK-NEXT: lui a1, %hi(.LCPI22_0)
509 ; CHECK-NEXT: fld fa5, %lo(.LCPI22_0)(a1)
510 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
511 ; CHECK-NEXT: vfabs.v v9, v8, v0.t
512 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
513 ; CHECK-NEXT: vmflt.vf v0, v9, fa5, v0.t
514 ; CHECK-NEXT: fsrmi a0, 2
515 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, ma
516 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
517 ; CHECK-NEXT: fsrm a0
518 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
519 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
520 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
522 %v = call <vscale x 1 x double> @llvm.vp.floor.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 %evl)
523 ret <vscale x 1 x double> %v
526 define <vscale x 1 x double> @vp_floor_nxv1f64_unmasked(<vscale x 1 x double> %va, i32 zeroext %evl) {
527 ; CHECK-LABEL: vp_floor_nxv1f64_unmasked:
529 ; CHECK-NEXT: lui a1, %hi(.LCPI23_0)
530 ; CHECK-NEXT: fld fa5, %lo(.LCPI23_0)(a1)
531 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
532 ; CHECK-NEXT: vfabs.v v9, v8
533 ; CHECK-NEXT: vmflt.vf v0, v9, fa5
534 ; CHECK-NEXT: fsrmi a0, 2
535 ; CHECK-NEXT: vfcvt.x.f.v v9, v8, v0.t
536 ; CHECK-NEXT: fsrm a0
537 ; CHECK-NEXT: vfcvt.f.x.v v9, v9, v0.t
538 ; CHECK-NEXT: vsetvli zero, zero, e64, m1, ta, mu
539 ; CHECK-NEXT: vfsgnj.vv v8, v9, v8, v0.t
541 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
542 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
543 %v = call <vscale x 1 x double> @llvm.vp.floor.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x i1> %m, i32 %evl)
544 ret <vscale x 1 x double> %v
547 declare <vscale x 2 x double> @llvm.vp.floor.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
549 define <vscale x 2 x double> @vp_floor_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
550 ; CHECK-LABEL: vp_floor_nxv2f64:
552 ; CHECK-NEXT: vmv1r.v v10, v0
553 ; CHECK-NEXT: lui a1, %hi(.LCPI24_0)
554 ; CHECK-NEXT: fld fa5, %lo(.LCPI24_0)(a1)
555 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
556 ; CHECK-NEXT: vfabs.v v12, v8, v0.t
557 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
558 ; CHECK-NEXT: vmflt.vf v10, v12, fa5, v0.t
559 ; CHECK-NEXT: fsrmi a0, 2
560 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, ma
561 ; CHECK-NEXT: vmv1r.v v0, v10
562 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
563 ; CHECK-NEXT: fsrm a0
564 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
565 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
566 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
568 %v = call <vscale x 2 x double> @llvm.vp.floor.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
569 ret <vscale x 2 x double> %v
572 define <vscale x 2 x double> @vp_floor_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
573 ; CHECK-LABEL: vp_floor_nxv2f64_unmasked:
575 ; CHECK-NEXT: lui a1, %hi(.LCPI25_0)
576 ; CHECK-NEXT: fld fa5, %lo(.LCPI25_0)(a1)
577 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
578 ; CHECK-NEXT: vfabs.v v10, v8
579 ; CHECK-NEXT: vmflt.vf v0, v10, fa5
580 ; CHECK-NEXT: fsrmi a0, 2
581 ; CHECK-NEXT: vfcvt.x.f.v v10, v8, v0.t
582 ; CHECK-NEXT: fsrm a0
583 ; CHECK-NEXT: vfcvt.f.x.v v10, v10, v0.t
584 ; CHECK-NEXT: vsetvli zero, zero, e64, m2, ta, mu
585 ; CHECK-NEXT: vfsgnj.vv v8, v10, v8, v0.t
587 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
588 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
589 %v = call <vscale x 2 x double> @llvm.vp.floor.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
590 ret <vscale x 2 x double> %v
593 declare <vscale x 4 x double> @llvm.vp.floor.nxv4f64(<vscale x 4 x double>, <vscale x 4 x i1>, i32)
595 define <vscale x 4 x double> @vp_floor_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 zeroext %evl) {
596 ; CHECK-LABEL: vp_floor_nxv4f64:
598 ; CHECK-NEXT: vmv1r.v v12, v0
599 ; CHECK-NEXT: lui a1, %hi(.LCPI26_0)
600 ; CHECK-NEXT: fld fa5, %lo(.LCPI26_0)(a1)
601 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
602 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
603 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
604 ; CHECK-NEXT: vmflt.vf v12, v16, fa5, v0.t
605 ; CHECK-NEXT: fsrmi a0, 2
606 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, ma
607 ; CHECK-NEXT: vmv1r.v v0, v12
608 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
609 ; CHECK-NEXT: fsrm a0
610 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
611 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
612 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
614 %v = call <vscale x 4 x double> @llvm.vp.floor.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 %evl)
615 ret <vscale x 4 x double> %v
618 define <vscale x 4 x double> @vp_floor_nxv4f64_unmasked(<vscale x 4 x double> %va, i32 zeroext %evl) {
619 ; CHECK-LABEL: vp_floor_nxv4f64_unmasked:
621 ; CHECK-NEXT: lui a1, %hi(.LCPI27_0)
622 ; CHECK-NEXT: fld fa5, %lo(.LCPI27_0)(a1)
623 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
624 ; CHECK-NEXT: vfabs.v v12, v8
625 ; CHECK-NEXT: vmflt.vf v0, v12, fa5
626 ; CHECK-NEXT: fsrmi a0, 2
627 ; CHECK-NEXT: vfcvt.x.f.v v12, v8, v0.t
628 ; CHECK-NEXT: fsrm a0
629 ; CHECK-NEXT: vfcvt.f.x.v v12, v12, v0.t
630 ; CHECK-NEXT: vsetvli zero, zero, e64, m4, ta, mu
631 ; CHECK-NEXT: vfsgnj.vv v8, v12, v8, v0.t
633 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
634 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
635 %v = call <vscale x 4 x double> @llvm.vp.floor.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x i1> %m, i32 %evl)
636 ret <vscale x 4 x double> %v
639 declare <vscale x 7 x double> @llvm.vp.floor.nxv7f64(<vscale x 7 x double>, <vscale x 7 x i1>, i32)
641 define <vscale x 7 x double> @vp_floor_nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 zeroext %evl) {
642 ; CHECK-LABEL: vp_floor_nxv7f64:
644 ; CHECK-NEXT: vmv1r.v v16, v0
645 ; CHECK-NEXT: lui a1, %hi(.LCPI28_0)
646 ; CHECK-NEXT: fld fa5, %lo(.LCPI28_0)(a1)
647 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
648 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
649 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
650 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
651 ; CHECK-NEXT: fsrmi a0, 2
652 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
653 ; CHECK-NEXT: vmv1r.v v0, v16
654 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
655 ; CHECK-NEXT: fsrm a0
656 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
657 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
658 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
660 %v = call <vscale x 7 x double> @llvm.vp.floor.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 %evl)
661 ret <vscale x 7 x double> %v
664 define <vscale x 7 x double> @vp_floor_nxv7f64_unmasked(<vscale x 7 x double> %va, i32 zeroext %evl) {
665 ; CHECK-LABEL: vp_floor_nxv7f64_unmasked:
667 ; CHECK-NEXT: lui a1, %hi(.LCPI29_0)
668 ; CHECK-NEXT: fld fa5, %lo(.LCPI29_0)(a1)
669 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
670 ; CHECK-NEXT: vfabs.v v16, v8
671 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
672 ; CHECK-NEXT: fsrmi a0, 2
673 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
674 ; CHECK-NEXT: fsrm a0
675 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
676 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
677 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
679 %head = insertelement <vscale x 7 x i1> poison, i1 true, i32 0
680 %m = shufflevector <vscale x 7 x i1> %head, <vscale x 7 x i1> poison, <vscale x 7 x i32> zeroinitializer
681 %v = call <vscale x 7 x double> @llvm.vp.floor.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x i1> %m, i32 %evl)
682 ret <vscale x 7 x double> %v
685 declare <vscale x 8 x double> @llvm.vp.floor.nxv8f64(<vscale x 8 x double>, <vscale x 8 x i1>, i32)
687 define <vscale x 8 x double> @vp_floor_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 zeroext %evl) {
688 ; CHECK-LABEL: vp_floor_nxv8f64:
690 ; CHECK-NEXT: vmv1r.v v16, v0
691 ; CHECK-NEXT: lui a1, %hi(.LCPI30_0)
692 ; CHECK-NEXT: fld fa5, %lo(.LCPI30_0)(a1)
693 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
694 ; CHECK-NEXT: vfabs.v v24, v8, v0.t
695 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
696 ; CHECK-NEXT: vmflt.vf v16, v24, fa5, v0.t
697 ; CHECK-NEXT: fsrmi a0, 2
698 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
699 ; CHECK-NEXT: vmv1r.v v0, v16
700 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
701 ; CHECK-NEXT: fsrm a0
702 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
703 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
704 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
706 %v = call <vscale x 8 x double> @llvm.vp.floor.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 %evl)
707 ret <vscale x 8 x double> %v
710 define <vscale x 8 x double> @vp_floor_nxv8f64_unmasked(<vscale x 8 x double> %va, i32 zeroext %evl) {
711 ; CHECK-LABEL: vp_floor_nxv8f64_unmasked:
713 ; CHECK-NEXT: lui a1, %hi(.LCPI31_0)
714 ; CHECK-NEXT: fld fa5, %lo(.LCPI31_0)(a1)
715 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
716 ; CHECK-NEXT: vfabs.v v16, v8
717 ; CHECK-NEXT: vmflt.vf v0, v16, fa5
718 ; CHECK-NEXT: fsrmi a0, 2
719 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
720 ; CHECK-NEXT: fsrm a0
721 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
722 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
723 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
725 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
726 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
727 %v = call <vscale x 8 x double> @llvm.vp.floor.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x i1> %m, i32 %evl)
728 ret <vscale x 8 x double> %v
732 declare <vscale x 16 x double> @llvm.vp.floor.nxv16f64(<vscale x 16 x double>, <vscale x 16 x i1>, i32)
734 define <vscale x 16 x double> @vp_floor_nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 zeroext %evl) {
735 ; CHECK-LABEL: vp_floor_nxv16f64:
737 ; CHECK-NEXT: addi sp, sp, -16
738 ; CHECK-NEXT: .cfi_def_cfa_offset 16
739 ; CHECK-NEXT: csrr a1, vlenb
740 ; CHECK-NEXT: slli a1, a1, 4
741 ; CHECK-NEXT: sub sp, sp, a1
742 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
743 ; CHECK-NEXT: vmv1r.v v24, v0
744 ; CHECK-NEXT: addi a1, sp, 16
745 ; CHECK-NEXT: vs8r.v v8, (a1) # Unknown-size Folded Spill
746 ; CHECK-NEXT: csrr a1, vlenb
747 ; CHECK-NEXT: srli a2, a1, 3
748 ; CHECK-NEXT: vsetvli a3, zero, e8, mf4, ta, ma
749 ; CHECK-NEXT: vslidedown.vx v25, v0, a2
750 ; CHECK-NEXT: sub a2, a0, a1
751 ; CHECK-NEXT: sltu a3, a0, a2
752 ; CHECK-NEXT: addi a3, a3, -1
753 ; CHECK-NEXT: and a2, a3, a2
754 ; CHECK-NEXT: lui a3, %hi(.LCPI32_0)
755 ; CHECK-NEXT: fld fa5, %lo(.LCPI32_0)(a3)
756 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
757 ; CHECK-NEXT: vmv1r.v v0, v25
758 ; CHECK-NEXT: vfabs.v v8, v16, v0.t
759 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
760 ; CHECK-NEXT: vmflt.vf v25, v8, fa5, v0.t
761 ; CHECK-NEXT: fsrmi a2, 2
762 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
763 ; CHECK-NEXT: vmv1r.v v0, v25
764 ; CHECK-NEXT: vfcvt.x.f.v v8, v16, v0.t
765 ; CHECK-NEXT: fsrm a2
766 ; CHECK-NEXT: vfcvt.f.x.v v8, v8, v0.t
767 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
768 ; CHECK-NEXT: vfsgnj.vv v16, v8, v16, v0.t
769 ; CHECK-NEXT: csrr a2, vlenb
770 ; CHECK-NEXT: slli a2, a2, 3
771 ; CHECK-NEXT: add a2, sp, a2
772 ; CHECK-NEXT: addi a2, a2, 16
773 ; CHECK-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
774 ; CHECK-NEXT: bltu a0, a1, .LBB32_2
775 ; CHECK-NEXT: # %bb.1:
776 ; CHECK-NEXT: mv a0, a1
777 ; CHECK-NEXT: .LBB32_2:
778 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
779 ; CHECK-NEXT: vmv1r.v v0, v24
780 ; CHECK-NEXT: addi a0, sp, 16
781 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
782 ; CHECK-NEXT: vfabs.v v16, v8, v0.t
783 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
784 ; CHECK-NEXT: vmflt.vf v24, v16, fa5, v0.t
785 ; CHECK-NEXT: fsrmi a0, 2
786 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, ma
787 ; CHECK-NEXT: vmv1r.v v0, v24
788 ; CHECK-NEXT: vfcvt.x.f.v v16, v8, v0.t
789 ; CHECK-NEXT: fsrm a0
790 ; CHECK-NEXT: vfcvt.f.x.v v16, v16, v0.t
791 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
792 ; CHECK-NEXT: vfsgnj.vv v8, v16, v8, v0.t
793 ; CHECK-NEXT: csrr a0, vlenb
794 ; CHECK-NEXT: slli a0, a0, 3
795 ; CHECK-NEXT: add a0, sp, a0
796 ; CHECK-NEXT: addi a0, a0, 16
797 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
798 ; CHECK-NEXT: csrr a0, vlenb
799 ; CHECK-NEXT: slli a0, a0, 4
800 ; CHECK-NEXT: add sp, sp, a0
801 ; CHECK-NEXT: addi sp, sp, 16
803 %v = call <vscale x 16 x double> @llvm.vp.floor.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 %evl)
804 ret <vscale x 16 x double> %v
807 define <vscale x 16 x double> @vp_floor_nxv16f64_unmasked(<vscale x 16 x double> %va, i32 zeroext %evl) {
808 ; CHECK-LABEL: vp_floor_nxv16f64_unmasked:
810 ; CHECK-NEXT: csrr a1, vlenb
811 ; CHECK-NEXT: sub a2, a0, a1
812 ; CHECK-NEXT: lui a3, %hi(.LCPI33_0)
813 ; CHECK-NEXT: fld fa5, %lo(.LCPI33_0)(a3)
814 ; CHECK-NEXT: sltu a3, a0, a2
815 ; CHECK-NEXT: addi a3, a3, -1
816 ; CHECK-NEXT: and a2, a3, a2
817 ; CHECK-NEXT: vsetvli zero, a2, e64, m8, ta, ma
818 ; CHECK-NEXT: vfabs.v v24, v16
819 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
820 ; CHECK-NEXT: fsrmi a2, 2
821 ; CHECK-NEXT: vfcvt.x.f.v v24, v16, v0.t
822 ; CHECK-NEXT: fsrm a2
823 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
824 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
825 ; CHECK-NEXT: vfsgnj.vv v16, v24, v16, v0.t
826 ; CHECK-NEXT: bltu a0, a1, .LBB33_2
827 ; CHECK-NEXT: # %bb.1:
828 ; CHECK-NEXT: mv a0, a1
829 ; CHECK-NEXT: .LBB33_2:
830 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
831 ; CHECK-NEXT: vfabs.v v24, v8
832 ; CHECK-NEXT: vmflt.vf v0, v24, fa5
833 ; CHECK-NEXT: fsrmi a0, 2
834 ; CHECK-NEXT: vfcvt.x.f.v v24, v8, v0.t
835 ; CHECK-NEXT: fsrm a0
836 ; CHECK-NEXT: vfcvt.f.x.v v24, v24, v0.t
837 ; CHECK-NEXT: vsetvli zero, zero, e64, m8, ta, mu
838 ; CHECK-NEXT: vfsgnj.vv v8, v24, v8, v0.t
840 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
841 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
842 %v = call <vscale x 16 x double> @llvm.vp.floor.nxv16f64(<vscale x 16 x double> %va, <vscale x 16 x i1> %m, i32 %evl)
843 ret <vscale x 16 x double> %v