1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+m,+v,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
3 ; RUN: llc -mtriple=riscv64 -mattr=+m,+v,+zfh,+zvfh < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
4 ; RUN: llc -mtriple=riscv32 -mattr=+m,+v,+zfh,+zvfhmin < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
5 ; RUN: llc -mtriple=riscv64 -mattr=+m,+v,+zfh,+zvfhmin < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
7 declare <vscale x 2 x i7> @llvm.vp.fptosi.v4i7.v4f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
9 define <vscale x 2 x i7> @vfptosi_v4i7_v4f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
10 ; ZVFH-LABEL: vfptosi_v4i7_v4f16:
12 ; ZVFH-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
13 ; ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8, v0.t
14 ; ZVFH-NEXT: vmv1r.v v8, v9
17 ; ZVFHMIN-LABEL: vfptosi_v4i7_v4f16:
19 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
20 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
21 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
22 ; ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9, v0.t
23 ; ZVFHMIN-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
24 ; ZVFHMIN-NEXT: vnsrl.wi v8, v8, 0, v0.t
26 %v = call <vscale x 2 x i7> @llvm.vp.fptosi.v4i7.v4f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
27 ret <vscale x 2 x i7> %v
30 declare <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
32 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
33 ; ZVFH-LABEL: vfptosi_nxv2i8_nxv2f16:
35 ; ZVFH-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
36 ; ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8, v0.t
37 ; ZVFH-NEXT: vmv1r.v v8, v9
40 ; ZVFHMIN-LABEL: vfptosi_nxv2i8_nxv2f16:
42 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
43 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
44 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
45 ; ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9, v0.t
46 ; ZVFHMIN-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
47 ; ZVFHMIN-NEXT: vnsrl.wi v8, v8, 0, v0.t
49 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
50 ret <vscale x 2 x i8> %v
53 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
54 ; ZVFH-LABEL: vfptosi_nxv2i8_nxv2f16_unmasked:
56 ; ZVFH-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
57 ; ZVFH-NEXT: vfncvt.rtz.x.f.w v9, v8
58 ; ZVFH-NEXT: vmv1r.v v8, v9
61 ; ZVFHMIN-LABEL: vfptosi_nxv2i8_nxv2f16_unmasked:
63 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
64 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
65 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
66 ; ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
67 ; ZVFHMIN-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
68 ; ZVFHMIN-NEXT: vnsrl.wi v8, v8, 0
70 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
71 ret <vscale x 2 x i8> %v
74 declare <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
76 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
77 ; ZVFH-LABEL: vfptosi_nxv2i16_nxv2f16:
79 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
80 ; ZVFH-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
83 ; ZVFHMIN-LABEL: vfptosi_nxv2i16_nxv2f16:
85 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
86 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
87 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
88 ; ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9, v0.t
90 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
91 ret <vscale x 2 x i16> %v
94 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
95 ; ZVFH-LABEL: vfptosi_nxv2i16_nxv2f16_unmasked:
97 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
98 ; ZVFH-NEXT: vfcvt.rtz.x.f.v v8, v8
101 ; ZVFHMIN-LABEL: vfptosi_nxv2i16_nxv2f16_unmasked:
103 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
104 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
105 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
106 ; ZVFHMIN-NEXT: vfncvt.rtz.x.f.w v8, v9
108 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
109 ret <vscale x 2 x i16> %v
112 declare <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
114 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
115 ; ZVFH-LABEL: vfptosi_nxv2i32_nxv2f16:
117 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
118 ; ZVFH-NEXT: vfwcvt.rtz.x.f.v v9, v8, v0.t
119 ; ZVFH-NEXT: vmv1r.v v8, v9
122 ; ZVFHMIN-LABEL: vfptosi_nxv2i32_nxv2f16:
124 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
125 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
126 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
127 ; ZVFHMIN-NEXT: vfcvt.rtz.x.f.v v8, v9, v0.t
129 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
130 ret <vscale x 2 x i32> %v
133 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
134 ; ZVFH-LABEL: vfptosi_nxv2i32_nxv2f16_unmasked:
136 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
137 ; ZVFH-NEXT: vfwcvt.rtz.x.f.v v9, v8
138 ; ZVFH-NEXT: vmv1r.v v8, v9
141 ; ZVFHMIN-LABEL: vfptosi_nxv2i32_nxv2f16_unmasked:
143 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
144 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
145 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
146 ; ZVFHMIN-NEXT: vfcvt.rtz.x.f.v v8, v9
148 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
149 ret <vscale x 2 x i32> %v
152 declare <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
154 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
155 ; ZVFH-LABEL: vfptosi_nxv2i64_nxv2f16:
157 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
158 ; ZVFH-NEXT: vfwcvt.f.f.v v10, v8, v0.t
159 ; ZVFH-NEXT: vsetvli zero, zero, e32, m1, ta, ma
160 ; ZVFH-NEXT: vfwcvt.rtz.x.f.v v8, v10, v0.t
163 ; ZVFHMIN-LABEL: vfptosi_nxv2i64_nxv2f16:
165 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
166 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
167 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
168 ; ZVFHMIN-NEXT: vfwcvt.rtz.x.f.v v8, v10, v0.t
170 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
171 ret <vscale x 2 x i64> %v
174 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
175 ; ZVFH-LABEL: vfptosi_nxv2i64_nxv2f16_unmasked:
177 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
178 ; ZVFH-NEXT: vfwcvt.f.f.v v10, v8
179 ; ZVFH-NEXT: vsetvli zero, zero, e32, m1, ta, ma
180 ; ZVFH-NEXT: vfwcvt.rtz.x.f.v v8, v10
183 ; ZVFHMIN-LABEL: vfptosi_nxv2i64_nxv2f16_unmasked:
185 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
186 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
187 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
188 ; ZVFHMIN-NEXT: vfwcvt.rtz.x.f.v v8, v10
190 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
191 ret <vscale x 2 x i64> %v
194 declare <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
196 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
197 ; CHECK-LABEL: vfptosi_nxv2i8_nxv2f32:
199 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
200 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8, v0.t
201 ; CHECK-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
202 ; CHECK-NEXT: vnsrl.wi v8, v9, 0, v0.t
204 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
205 ret <vscale x 2 x i8> %v
208 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
209 ; CHECK-LABEL: vfptosi_nxv2i8_nxv2f32_unmasked:
211 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
212 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
213 ; CHECK-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
214 ; CHECK-NEXT: vnsrl.wi v8, v9, 0
216 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
217 ret <vscale x 2 x i8> %v
220 declare <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
222 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
223 ; CHECK-LABEL: vfptosi_nxv2i16_nxv2f32:
225 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
226 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8, v0.t
227 ; CHECK-NEXT: vmv1r.v v8, v9
229 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
230 ret <vscale x 2 x i16> %v
233 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
234 ; CHECK-LABEL: vfptosi_nxv2i16_nxv2f32_unmasked:
236 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
237 ; CHECK-NEXT: vfncvt.rtz.x.f.w v9, v8
238 ; CHECK-NEXT: vmv1r.v v8, v9
240 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
241 ret <vscale x 2 x i16> %v
244 declare <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
246 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
247 ; CHECK-LABEL: vfptosi_nxv2i32_nxv2f32:
249 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
250 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
252 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
253 ret <vscale x 2 x i32> %v
256 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
257 ; CHECK-LABEL: vfptosi_nxv2i32_nxv2f32_unmasked:
259 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
260 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
262 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
263 ret <vscale x 2 x i32> %v
266 declare <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
268 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
269 ; CHECK-LABEL: vfptosi_nxv2i64_nxv2f32:
271 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
272 ; CHECK-NEXT: vfwcvt.rtz.x.f.v v10, v8, v0.t
273 ; CHECK-NEXT: vmv2r.v v8, v10
275 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
276 ret <vscale x 2 x i64> %v
279 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
280 ; CHECK-LABEL: vfptosi_nxv2i64_nxv2f32_unmasked:
282 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
283 ; CHECK-NEXT: vfwcvt.rtz.x.f.v v10, v8
284 ; CHECK-NEXT: vmv2r.v v8, v10
286 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
287 ret <vscale x 2 x i64> %v
290 declare <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
292 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
293 ; CHECK-LABEL: vfptosi_nxv2i8_nxv2f64:
295 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
296 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8, v0.t
297 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
298 ; CHECK-NEXT: vnsrl.wi v8, v10, 0, v0.t
299 ; CHECK-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
300 ; CHECK-NEXT: vnsrl.wi v8, v8, 0, v0.t
302 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
303 ret <vscale x 2 x i8> %v
306 define <vscale x 2 x i8> @vfptosi_nxv2i8_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
307 ; CHECK-LABEL: vfptosi_nxv2i8_nxv2f64_unmasked:
309 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
310 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8
311 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
312 ; CHECK-NEXT: vnsrl.wi v8, v10, 0
313 ; CHECK-NEXT: vsetvli zero, zero, e8, mf4, ta, ma
314 ; CHECK-NEXT: vnsrl.wi v8, v8, 0
316 %v = call <vscale x 2 x i8> @llvm.vp.fptosi.nxv2i8.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
317 ret <vscale x 2 x i8> %v
320 declare <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
322 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
323 ; CHECK-LABEL: vfptosi_nxv2i16_nxv2f64:
325 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
326 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8, v0.t
327 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
328 ; CHECK-NEXT: vnsrl.wi v8, v10, 0, v0.t
330 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
331 ret <vscale x 2 x i16> %v
334 define <vscale x 2 x i16> @vfptosi_nxv2i16_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
335 ; CHECK-LABEL: vfptosi_nxv2i16_nxv2f64_unmasked:
337 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
338 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8
339 ; CHECK-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
340 ; CHECK-NEXT: vnsrl.wi v8, v10, 0
342 %v = call <vscale x 2 x i16> @llvm.vp.fptosi.nxv2i16.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
343 ret <vscale x 2 x i16> %v
346 declare <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
348 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
349 ; CHECK-LABEL: vfptosi_nxv2i32_nxv2f64:
351 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
352 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8, v0.t
353 ; CHECK-NEXT: vmv.v.v v8, v10
355 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
356 ret <vscale x 2 x i32> %v
359 define <vscale x 2 x i32> @vfptosi_nxv2i32_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
360 ; CHECK-LABEL: vfptosi_nxv2i32_nxv2f64_unmasked:
362 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
363 ; CHECK-NEXT: vfncvt.rtz.x.f.w v10, v8
364 ; CHECK-NEXT: vmv.v.v v8, v10
366 %v = call <vscale x 2 x i32> @llvm.vp.fptosi.nxv2i32.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
367 ret <vscale x 2 x i32> %v
370 declare <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
372 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
373 ; CHECK-LABEL: vfptosi_nxv2i64_nxv2f64:
375 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
376 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
378 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
379 ret <vscale x 2 x i64> %v
382 define <vscale x 2 x i64> @vfptosi_nxv2i64_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
383 ; CHECK-LABEL: vfptosi_nxv2i64_nxv2f64_unmasked:
385 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
386 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
388 %v = call <vscale x 2 x i64> @llvm.vp.fptosi.nxv2i64.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> undef, i1 true, i32 0), <vscale x 2 x i1> undef, <vscale x 2 x i32> zeroinitializer), i32 %evl)
389 ret <vscale x 2 x i64> %v
392 declare <vscale x 32 x i16> @llvm.vp.fptosi.nxv32i16.nxv32f32(<vscale x 32 x float>, <vscale x 32 x i1>, i32)
394 define <vscale x 32 x i16> @vfptosi_nxv32i16_nxv32f32(<vscale x 32 x float> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
395 ; CHECK-LABEL: vfptosi_nxv32i16_nxv32f32:
397 ; CHECK-NEXT: vmv1r.v v24, v0
398 ; CHECK-NEXT: csrr a1, vlenb
399 ; CHECK-NEXT: srli a2, a1, 2
400 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
401 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
402 ; CHECK-NEXT: slli a1, a1, 1
403 ; CHECK-NEXT: sub a2, a0, a1
404 ; CHECK-NEXT: sltu a3, a0, a2
405 ; CHECK-NEXT: addi a3, a3, -1
406 ; CHECK-NEXT: and a2, a3, a2
407 ; CHECK-NEXT: vsetvli zero, a2, e16, m4, ta, ma
408 ; CHECK-NEXT: vfncvt.rtz.x.f.w v28, v16, v0.t
409 ; CHECK-NEXT: bltu a0, a1, .LBB25_2
410 ; CHECK-NEXT: # %bb.1:
411 ; CHECK-NEXT: mv a0, a1
412 ; CHECK-NEXT: .LBB25_2:
413 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
414 ; CHECK-NEXT: vmv1r.v v0, v24
415 ; CHECK-NEXT: vfncvt.rtz.x.f.w v24, v8, v0.t
416 ; CHECK-NEXT: vmv8r.v v8, v24
418 %v = call <vscale x 32 x i16> @llvm.vp.fptosi.nxv32i16.nxv32f32(<vscale x 32 x float> %va, <vscale x 32 x i1> %m, i32 %evl)
419 ret <vscale x 32 x i16> %v
422 declare <vscale x 32 x i32> @llvm.vp.fptosi.nxv32i32.nxv32f32(<vscale x 32 x float>, <vscale x 32 x i1>, i32)
424 define <vscale x 32 x i32> @vfptosi_nxv32i32_nxv32f32(<vscale x 32 x float> %va, <vscale x 32 x i1> %m, i32 zeroext %evl) {
425 ; CHECK-LABEL: vfptosi_nxv32i32_nxv32f32:
427 ; CHECK-NEXT: vmv1r.v v24, v0
428 ; CHECK-NEXT: csrr a1, vlenb
429 ; CHECK-NEXT: srli a2, a1, 2
430 ; CHECK-NEXT: vsetvli a3, zero, e8, mf2, ta, ma
431 ; CHECK-NEXT: vslidedown.vx v0, v0, a2
432 ; CHECK-NEXT: slli a1, a1, 1
433 ; CHECK-NEXT: sub a2, a0, a1
434 ; CHECK-NEXT: sltu a3, a0, a2
435 ; CHECK-NEXT: addi a3, a3, -1
436 ; CHECK-NEXT: and a2, a3, a2
437 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
438 ; CHECK-NEXT: vfcvt.rtz.x.f.v v16, v16, v0.t
439 ; CHECK-NEXT: bltu a0, a1, .LBB26_2
440 ; CHECK-NEXT: # %bb.1:
441 ; CHECK-NEXT: mv a0, a1
442 ; CHECK-NEXT: .LBB26_2:
443 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
444 ; CHECK-NEXT: vmv1r.v v0, v24
445 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
447 %v = call <vscale x 32 x i32> @llvm.vp.fptosi.nxv32i32.nxv32f32(<vscale x 32 x float> %va, <vscale x 32 x i1> %m, i32 %evl)
448 ret <vscale x 32 x i32> %v
451 define <vscale x 32 x i32> @vfptosi_nxv32i32_nxv32f32_unmasked(<vscale x 32 x float> %va, i32 zeroext %evl) {
452 ; CHECK-LABEL: vfptosi_nxv32i32_nxv32f32_unmasked:
454 ; CHECK-NEXT: csrr a1, vlenb
455 ; CHECK-NEXT: slli a1, a1, 1
456 ; CHECK-NEXT: sub a2, a0, a1
457 ; CHECK-NEXT: sltu a3, a0, a2
458 ; CHECK-NEXT: addi a3, a3, -1
459 ; CHECK-NEXT: and a2, a3, a2
460 ; CHECK-NEXT: vsetvli zero, a2, e32, m8, ta, ma
461 ; CHECK-NEXT: vfcvt.rtz.x.f.v v16, v16
462 ; CHECK-NEXT: bltu a0, a1, .LBB27_2
463 ; CHECK-NEXT: # %bb.1:
464 ; CHECK-NEXT: mv a0, a1
465 ; CHECK-NEXT: .LBB27_2:
466 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
467 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
469 %v = call <vscale x 32 x i32> @llvm.vp.fptosi.nxv32i32.nxv32f32(<vscale x 32 x float> %va, <vscale x 32 x i1> shufflevector (<vscale x 32 x i1> insertelement (<vscale x 32 x i1> undef, i1 true, i32 0), <vscale x 32 x i1> undef, <vscale x 32 x i32> zeroinitializer), i32 %evl)
470 ret <vscale x 32 x i32> %v