1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=ilp32d -riscv-v-vector-bits-min=128 \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=lp64d -riscv-v-vector-bits-min=128 \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s
11 declare <1 x i1> @llvm.vp.select.v1i1(<1 x i1>, <1 x i1>, <1 x i1>, i32)
13 define <1 x i1> @select_v1i1(<1 x i1> %a, <1 x i1> %b, <1 x i1> %c, i32 zeroext %evl) {
14 ; CHECK-LABEL: select_v1i1:
16 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
17 ; CHECK-NEXT: vmandn.mm v9, v9, v0
18 ; CHECK-NEXT: vmand.mm v8, v8, v0
19 ; CHECK-NEXT: vmor.mm v0, v8, v9
21 %v = call <1 x i1> @llvm.vp.select.v1i1(<1 x i1> %a, <1 x i1> %b, <1 x i1> %c, i32 %evl)
25 declare <2 x i1> @llvm.vp.select.v2i1(<2 x i1>, <2 x i1>, <2 x i1>, i32)
27 define <2 x i1> @select_v2i1(<2 x i1> %a, <2 x i1> %b, <2 x i1> %c, i32 zeroext %evl) {
28 ; CHECK-LABEL: select_v2i1:
30 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
31 ; CHECK-NEXT: vmandn.mm v9, v9, v0
32 ; CHECK-NEXT: vmand.mm v8, v8, v0
33 ; CHECK-NEXT: vmor.mm v0, v8, v9
35 %v = call <2 x i1> @llvm.vp.select.v2i1(<2 x i1> %a, <2 x i1> %b, <2 x i1> %c, i32 %evl)
39 declare <4 x i1> @llvm.vp.select.v4i1(<4 x i1>, <4 x i1>, <4 x i1>, i32)
41 define <4 x i1> @select_v4i1(<4 x i1> %a, <4 x i1> %b, <4 x i1> %c, i32 zeroext %evl) {
42 ; CHECK-LABEL: select_v4i1:
44 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
45 ; CHECK-NEXT: vmandn.mm v9, v9, v0
46 ; CHECK-NEXT: vmand.mm v8, v8, v0
47 ; CHECK-NEXT: vmor.mm v0, v8, v9
49 %v = call <4 x i1> @llvm.vp.select.v4i1(<4 x i1> %a, <4 x i1> %b, <4 x i1> %c, i32 %evl)
53 declare <8 x i1> @llvm.vp.select.v8i1(<8 x i1>, <8 x i1>, <8 x i1>, i32)
55 define <8 x i1> @select_v8i1(<8 x i1> %a, <8 x i1> %b, <8 x i1> %c, i32 zeroext %evl) {
56 ; CHECK-LABEL: select_v8i1:
58 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
59 ; CHECK-NEXT: vmandn.mm v9, v9, v0
60 ; CHECK-NEXT: vmand.mm v8, v8, v0
61 ; CHECK-NEXT: vmor.mm v0, v8, v9
63 %v = call <8 x i1> @llvm.vp.select.v8i1(<8 x i1> %a, <8 x i1> %b, <8 x i1> %c, i32 %evl)
67 declare <16 x i1> @llvm.vp.select.v16i1(<16 x i1>, <16 x i1>, <16 x i1>, i32)
69 define <16 x i1> @select_v16i1(<16 x i1> %a, <16 x i1> %b, <16 x i1> %c, i32 zeroext %evl) {
70 ; CHECK-LABEL: select_v16i1:
72 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
73 ; CHECK-NEXT: vmandn.mm v9, v9, v0
74 ; CHECK-NEXT: vmand.mm v8, v8, v0
75 ; CHECK-NEXT: vmor.mm v0, v8, v9
77 %v = call <16 x i1> @llvm.vp.select.v16i1(<16 x i1> %a, <16 x i1> %b, <16 x i1> %c, i32 %evl)
81 declare <8 x i7> @llvm.vp.select.v8i7(<8 x i1>, <8 x i7>, <8 x i7>, i32)
83 define <8 x i7> @select_v8i7(<8 x i1> %a, <8 x i7> %b, <8 x i7> %c, i32 zeroext %evl) {
84 ; CHECK-LABEL: select_v8i7:
86 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
87 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
89 %v = call <8 x i7> @llvm.vp.select.v8i7(<8 x i1> %a, <8 x i7> %b, <8 x i7> %c, i32 %evl)
93 declare <2 x i8> @llvm.vp.select.v2i8(<2 x i1>, <2 x i8>, <2 x i8>, i32)
95 define <2 x i8> @select_v2i8(<2 x i1> %a, <2 x i8> %b, <2 x i8> %c, i32 zeroext %evl) {
96 ; CHECK-LABEL: select_v2i8:
98 ; CHECK-NEXT: vsetvli zero, a0, e8, mf8, ta, ma
99 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
101 %v = call <2 x i8> @llvm.vp.select.v2i8(<2 x i1> %a, <2 x i8> %b, <2 x i8> %c, i32 %evl)
105 declare <4 x i8> @llvm.vp.select.v4i8(<4 x i1>, <4 x i8>, <4 x i8>, i32)
107 define <4 x i8> @select_v4i8(<4 x i1> %a, <4 x i8> %b, <4 x i8> %c, i32 zeroext %evl) {
108 ; CHECK-LABEL: select_v4i8:
110 ; CHECK-NEXT: vsetvli zero, a0, e8, mf4, ta, ma
111 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
113 %v = call <4 x i8> @llvm.vp.select.v4i8(<4 x i1> %a, <4 x i8> %b, <4 x i8> %c, i32 %evl)
117 declare <5 x i8> @llvm.vp.select.v5i8(<5 x i1>, <5 x i8>, <5 x i8>, i32)
119 define <5 x i8> @select_v5i8(<5 x i1> %a, <5 x i8> %b, <5 x i8> %c, i32 zeroext %evl) {
120 ; CHECK-LABEL: select_v5i8:
122 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
123 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
125 %v = call <5 x i8> @llvm.vp.select.v5i8(<5 x i1> %a, <5 x i8> %b, <5 x i8> %c, i32 %evl)
129 declare <8 x i8> @llvm.vp.select.v8i8(<8 x i1>, <8 x i8>, <8 x i8>, i32)
131 define <8 x i8> @select_v8i8(<8 x i1> %a, <8 x i8> %b, <8 x i8> %c, i32 zeroext %evl) {
132 ; CHECK-LABEL: select_v8i8:
134 ; CHECK-NEXT: vsetvli zero, a0, e8, mf2, ta, ma
135 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
137 %v = call <8 x i8> @llvm.vp.select.v8i8(<8 x i1> %a, <8 x i8> %b, <8 x i8> %c, i32 %evl)
141 declare <16 x i8> @llvm.vp.select.v16i8(<16 x i1>, <16 x i8>, <16 x i8>, i32)
143 define <16 x i8> @select_v16i8(<16 x i1> %a, <16 x i8> %b, <16 x i8> %c, i32 zeroext %evl) {
144 ; CHECK-LABEL: select_v16i8:
146 ; CHECK-NEXT: vsetvli zero, a0, e8, m1, ta, ma
147 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
149 %v = call <16 x i8> @llvm.vp.select.v16i8(<16 x i1> %a, <16 x i8> %b, <16 x i8> %c, i32 %evl)
153 declare <256 x i8> @llvm.vp.select.v256i8(<256 x i1>, <256 x i8>, <256 x i8>, i32)
155 define <256 x i8> @select_v256i8(<256 x i1> %a, <256 x i8> %b, <256 x i8> %c, i32 zeroext %evl) {
156 ; CHECK-LABEL: select_v256i8:
158 ; CHECK-NEXT: addi sp, sp, -16
159 ; CHECK-NEXT: .cfi_def_cfa_offset 16
160 ; CHECK-NEXT: csrr a2, vlenb
161 ; CHECK-NEXT: slli a2, a2, 4
162 ; CHECK-NEXT: sub sp, sp, a2
163 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
164 ; CHECK-NEXT: csrr a2, vlenb
165 ; CHECK-NEXT: slli a2, a2, 3
166 ; CHECK-NEXT: add a2, sp, a2
167 ; CHECK-NEXT: addi a2, a2, 16
168 ; CHECK-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
169 ; CHECK-NEXT: vmv1r.v v9, v8
170 ; CHECK-NEXT: vmv1r.v v8, v0
171 ; CHECK-NEXT: li a2, 128
172 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
173 ; CHECK-NEXT: vle8.v v24, (a0)
174 ; CHECK-NEXT: addi a0, a1, 128
175 ; CHECK-NEXT: vle8.v v16, (a0)
176 ; CHECK-NEXT: addi a0, a3, -128
177 ; CHECK-NEXT: sltu a4, a3, a0
178 ; CHECK-NEXT: addi a4, a4, -1
179 ; CHECK-NEXT: vle8.v v0, (a1)
180 ; CHECK-NEXT: addi a1, sp, 16
181 ; CHECK-NEXT: vs8r.v v0, (a1) # Unknown-size Folded Spill
182 ; CHECK-NEXT: and a0, a4, a0
183 ; CHECK-NEXT: vsetvli zero, a0, e8, m8, ta, ma
184 ; CHECK-NEXT: vmv1r.v v0, v9
185 ; CHECK-NEXT: vmerge.vvm v24, v16, v24, v0
186 ; CHECK-NEXT: bltu a3, a2, .LBB11_2
187 ; CHECK-NEXT: # %bb.1:
188 ; CHECK-NEXT: li a3, 128
189 ; CHECK-NEXT: .LBB11_2:
190 ; CHECK-NEXT: vsetvli zero, a3, e8, m8, ta, ma
191 ; CHECK-NEXT: vmv1r.v v0, v8
192 ; CHECK-NEXT: csrr a0, vlenb
193 ; CHECK-NEXT: slli a0, a0, 3
194 ; CHECK-NEXT: add a0, sp, a0
195 ; CHECK-NEXT: addi a0, a0, 16
196 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
197 ; CHECK-NEXT: addi a0, sp, 16
198 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
199 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
200 ; CHECK-NEXT: vmv8r.v v16, v24
201 ; CHECK-NEXT: csrr a0, vlenb
202 ; CHECK-NEXT: slli a0, a0, 4
203 ; CHECK-NEXT: add sp, sp, a0
204 ; CHECK-NEXT: addi sp, sp, 16
206 %v = call <256 x i8> @llvm.vp.select.v256i8(<256 x i1> %a, <256 x i8> %b, <256 x i8> %c, i32 %evl)
210 define <256 x i8> @select_evl_v256i8(<256 x i1> %a, <256 x i8> %b, <256 x i8> %c) {
211 ; CHECK-LABEL: select_evl_v256i8:
213 ; CHECK-NEXT: addi sp, sp, -16
214 ; CHECK-NEXT: .cfi_def_cfa_offset 16
215 ; CHECK-NEXT: csrr a2, vlenb
216 ; CHECK-NEXT: li a3, 24
217 ; CHECK-NEXT: mul a2, a2, a3
218 ; CHECK-NEXT: sub sp, sp, a2
219 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 24 * vlenb
220 ; CHECK-NEXT: li a2, 128
221 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
222 ; CHECK-NEXT: vle8.v v24, (a0)
223 ; CHECK-NEXT: csrr a0, vlenb
224 ; CHECK-NEXT: slli a0, a0, 3
225 ; CHECK-NEXT: add a0, sp, a0
226 ; CHECK-NEXT: addi a0, a0, 16
227 ; CHECK-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
228 ; CHECK-NEXT: addi a0, a1, 128
229 ; CHECK-NEXT: vle8.v v24, (a0)
230 ; CHECK-NEXT: csrr a0, vlenb
231 ; CHECK-NEXT: slli a0, a0, 4
232 ; CHECK-NEXT: add a0, sp, a0
233 ; CHECK-NEXT: addi a0, a0, 16
234 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
235 ; CHECK-NEXT: vmv1r.v v9, v0
236 ; CHECK-NEXT: vle8.v v16, (a1)
237 ; CHECK-NEXT: addi a0, sp, 16
238 ; CHECK-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
239 ; CHECK-NEXT: vsetivli zero, 1, e8, m8, ta, ma
240 ; CHECK-NEXT: vmv1r.v v0, v8
241 ; CHECK-NEXT: csrr a0, vlenb
242 ; CHECK-NEXT: slli a0, a0, 3
243 ; CHECK-NEXT: add a0, sp, a0
244 ; CHECK-NEXT: addi a0, a0, 16
245 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
246 ; CHECK-NEXT: vmerge.vvm v24, v24, v16, v0
247 ; CHECK-NEXT: vsetvli zero, a2, e8, m8, ta, ma
248 ; CHECK-NEXT: vmv1r.v v0, v9
249 ; CHECK-NEXT: csrr a0, vlenb
250 ; CHECK-NEXT: slli a0, a0, 4
251 ; CHECK-NEXT: add a0, sp, a0
252 ; CHECK-NEXT: addi a0, a0, 16
253 ; CHECK-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
254 ; CHECK-NEXT: addi a0, sp, 16
255 ; CHECK-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
256 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
257 ; CHECK-NEXT: vmv8r.v v16, v24
258 ; CHECK-NEXT: csrr a0, vlenb
259 ; CHECK-NEXT: li a1, 24
260 ; CHECK-NEXT: mul a0, a0, a1
261 ; CHECK-NEXT: add sp, sp, a0
262 ; CHECK-NEXT: addi sp, sp, 16
264 %v = call <256 x i8> @llvm.vp.select.v256i8(<256 x i1> %a, <256 x i8> %b, <256 x i8> %c, i32 129)
268 declare <2 x i16> @llvm.vp.select.v2i16(<2 x i1>, <2 x i16>, <2 x i16>, i32)
270 define <2 x i16> @select_v2i16(<2 x i1> %a, <2 x i16> %b, <2 x i16> %c, i32 zeroext %evl) {
271 ; CHECK-LABEL: select_v2i16:
273 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
274 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
276 %v = call <2 x i16> @llvm.vp.select.v2i16(<2 x i1> %a, <2 x i16> %b, <2 x i16> %c, i32 %evl)
280 declare <4 x i16> @llvm.vp.select.v4i16(<4 x i1>, <4 x i16>, <4 x i16>, i32)
282 define <4 x i16> @select_v4i16(<4 x i1> %a, <4 x i16> %b, <4 x i16> %c, i32 zeroext %evl) {
283 ; CHECK-LABEL: select_v4i16:
285 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
286 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
288 %v = call <4 x i16> @llvm.vp.select.v4i16(<4 x i1> %a, <4 x i16> %b, <4 x i16> %c, i32 %evl)
292 declare <8 x i16> @llvm.vp.select.v8i16(<8 x i1>, <8 x i16>, <8 x i16>, i32)
294 define <8 x i16> @select_v8i16(<8 x i1> %a, <8 x i16> %b, <8 x i16> %c, i32 zeroext %evl) {
295 ; CHECK-LABEL: select_v8i16:
297 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
298 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
300 %v = call <8 x i16> @llvm.vp.select.v8i16(<8 x i1> %a, <8 x i16> %b, <8 x i16> %c, i32 %evl)
304 declare <16 x i16> @llvm.vp.select.v16i16(<16 x i1>, <16 x i16>, <16 x i16>, i32)
306 define <16 x i16> @select_v16i16(<16 x i1> %a, <16 x i16> %b, <16 x i16> %c, i32 zeroext %evl) {
307 ; CHECK-LABEL: select_v16i16:
309 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
310 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
312 %v = call <16 x i16> @llvm.vp.select.v16i16(<16 x i1> %a, <16 x i16> %b, <16 x i16> %c, i32 %evl)
316 declare <2 x i32> @llvm.vp.select.v2i32(<2 x i1>, <2 x i32>, <2 x i32>, i32)
318 define <2 x i32> @select_v2i32(<2 x i1> %a, <2 x i32> %b, <2 x i32> %c, i32 zeroext %evl) {
319 ; CHECK-LABEL: select_v2i32:
321 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
322 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
324 %v = call <2 x i32> @llvm.vp.select.v2i32(<2 x i1> %a, <2 x i32> %b, <2 x i32> %c, i32 %evl)
328 declare <4 x i32> @llvm.vp.select.v4i32(<4 x i1>, <4 x i32>, <4 x i32>, i32)
330 define <4 x i32> @select_v4i32(<4 x i1> %a, <4 x i32> %b, <4 x i32> %c, i32 zeroext %evl) {
331 ; CHECK-LABEL: select_v4i32:
333 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
334 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
336 %v = call <4 x i32> @llvm.vp.select.v4i32(<4 x i1> %a, <4 x i32> %b, <4 x i32> %c, i32 %evl)
340 declare <8 x i32> @llvm.vp.select.v8i32(<8 x i1>, <8 x i32>, <8 x i32>, i32)
342 define <8 x i32> @select_v8i32(<8 x i1> %a, <8 x i32> %b, <8 x i32> %c, i32 zeroext %evl) {
343 ; CHECK-LABEL: select_v8i32:
345 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
346 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
348 %v = call <8 x i32> @llvm.vp.select.v8i32(<8 x i1> %a, <8 x i32> %b, <8 x i32> %c, i32 %evl)
352 declare <16 x i32> @llvm.vp.select.v16i32(<16 x i1>, <16 x i32>, <16 x i32>, i32)
354 define <16 x i32> @select_v16i32(<16 x i1> %a, <16 x i32> %b, <16 x i32> %c, i32 zeroext %evl) {
355 ; CHECK-LABEL: select_v16i32:
357 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
358 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
360 %v = call <16 x i32> @llvm.vp.select.v16i32(<16 x i1> %a, <16 x i32> %b, <16 x i32> %c, i32 %evl)
364 declare <2 x i64> @llvm.vp.select.v2i64(<2 x i1>, <2 x i64>, <2 x i64>, i32)
366 define <2 x i64> @select_v2i64(<2 x i1> %a, <2 x i64> %b, <2 x i64> %c, i32 zeroext %evl) {
367 ; CHECK-LABEL: select_v2i64:
369 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
370 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
372 %v = call <2 x i64> @llvm.vp.select.v2i64(<2 x i1> %a, <2 x i64> %b, <2 x i64> %c, i32 %evl)
376 declare <4 x i64> @llvm.vp.select.v4i64(<4 x i1>, <4 x i64>, <4 x i64>, i32)
378 define <4 x i64> @select_v4i64(<4 x i1> %a, <4 x i64> %b, <4 x i64> %c, i32 zeroext %evl) {
379 ; CHECK-LABEL: select_v4i64:
381 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
382 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
384 %v = call <4 x i64> @llvm.vp.select.v4i64(<4 x i1> %a, <4 x i64> %b, <4 x i64> %c, i32 %evl)
388 declare <8 x i64> @llvm.vp.select.v8i64(<8 x i1>, <8 x i64>, <8 x i64>, i32)
390 define <8 x i64> @select_v8i64(<8 x i1> %a, <8 x i64> %b, <8 x i64> %c, i32 zeroext %evl) {
391 ; CHECK-LABEL: select_v8i64:
393 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
394 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
396 %v = call <8 x i64> @llvm.vp.select.v8i64(<8 x i1> %a, <8 x i64> %b, <8 x i64> %c, i32 %evl)
400 declare <16 x i64> @llvm.vp.select.v16i64(<16 x i1>, <16 x i64>, <16 x i64>, i32)
402 define <16 x i64> @select_v16i64(<16 x i1> %a, <16 x i64> %b, <16 x i64> %c, i32 zeroext %evl) {
403 ; CHECK-LABEL: select_v16i64:
405 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
406 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
408 %v = call <16 x i64> @llvm.vp.select.v16i64(<16 x i1> %a, <16 x i64> %b, <16 x i64> %c, i32 %evl)
412 declare <32 x i64> @llvm.vp.select.v32i64(<32 x i1>, <32 x i64>, <32 x i64>, i32)
414 define <32 x i64> @select_v32i64(<32 x i1> %a, <32 x i64> %b, <32 x i64> %c, i32 zeroext %evl) {
415 ; CHECK-LABEL: select_v32i64:
417 ; CHECK-NEXT: addi sp, sp, -16
418 ; CHECK-NEXT: .cfi_def_cfa_offset 16
419 ; CHECK-NEXT: csrr a1, vlenb
420 ; CHECK-NEXT: slli a1, a1, 3
421 ; CHECK-NEXT: sub sp, sp, a1
422 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
423 ; CHECK-NEXT: addi a1, a0, 128
424 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
425 ; CHECK-NEXT: vle64.v v24, (a1)
426 ; CHECK-NEXT: addi a1, sp, 16
427 ; CHECK-NEXT: vs8r.v v24, (a1) # Unknown-size Folded Spill
428 ; CHECK-NEXT: vle64.v v24, (a0)
429 ; CHECK-NEXT: li a1, 16
430 ; CHECK-NEXT: mv a0, a2
431 ; CHECK-NEXT: bltu a2, a1, .LBB25_2
432 ; CHECK-NEXT: # %bb.1:
433 ; CHECK-NEXT: li a0, 16
434 ; CHECK-NEXT: .LBB25_2:
435 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
436 ; CHECK-NEXT: vmerge.vvm v8, v24, v8, v0
437 ; CHECK-NEXT: addi a0, a2, -16
438 ; CHECK-NEXT: sltu a1, a2, a0
439 ; CHECK-NEXT: addi a1, a1, -1
440 ; CHECK-NEXT: and a0, a1, a0
441 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
442 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
443 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
444 ; CHECK-NEXT: addi a0, sp, 16
445 ; CHECK-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
446 ; CHECK-NEXT: vmerge.vvm v16, v24, v16, v0
447 ; CHECK-NEXT: csrr a0, vlenb
448 ; CHECK-NEXT: slli a0, a0, 3
449 ; CHECK-NEXT: add sp, sp, a0
450 ; CHECK-NEXT: addi sp, sp, 16
452 %v = call <32 x i64> @llvm.vp.select.v32i64(<32 x i1> %a, <32 x i64> %b, <32 x i64> %c, i32 %evl)
456 define <32 x i64> @select_evl_v32i64(<32 x i1> %a, <32 x i64> %b, <32 x i64> %c) {
457 ; CHECK-LABEL: select_evl_v32i64:
459 ; CHECK-NEXT: vsetivli zero, 16, e64, m8, ta, ma
460 ; CHECK-NEXT: vle64.v v24, (a0)
461 ; CHECK-NEXT: vmerge.vvm v8, v24, v8, v0
462 ; CHECK-NEXT: addi a0, a0, 128
463 ; CHECK-NEXT: vle64.v v24, (a0)
464 ; CHECK-NEXT: vsetivli zero, 2, e8, mf4, ta, ma
465 ; CHECK-NEXT: vslidedown.vi v0, v0, 2
466 ; CHECK-NEXT: vsetivli zero, 1, e64, m8, ta, ma
467 ; CHECK-NEXT: vmerge.vvm v16, v24, v16, v0
469 %v = call <32 x i64> @llvm.vp.select.v32i64(<32 x i1> %a, <32 x i64> %b, <32 x i64> %c, i32 17)
473 declare <2 x half> @llvm.vp.select.v2f16(<2 x i1>, <2 x half>, <2 x half>, i32)
475 define <2 x half> @select_v2f16(<2 x i1> %a, <2 x half> %b, <2 x half> %c, i32 zeroext %evl) {
476 ; CHECK-LABEL: select_v2f16:
478 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
479 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
481 %v = call <2 x half> @llvm.vp.select.v2f16(<2 x i1> %a, <2 x half> %b, <2 x half> %c, i32 %evl)
485 declare <4 x half> @llvm.vp.select.v4f16(<4 x i1>, <4 x half>, <4 x half>, i32)
487 define <4 x half> @select_v4f16(<4 x i1> %a, <4 x half> %b, <4 x half> %c, i32 zeroext %evl) {
488 ; CHECK-LABEL: select_v4f16:
490 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
491 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
493 %v = call <4 x half> @llvm.vp.select.v4f16(<4 x i1> %a, <4 x half> %b, <4 x half> %c, i32 %evl)
497 declare <8 x half> @llvm.vp.select.v8f16(<8 x i1>, <8 x half>, <8 x half>, i32)
499 define <8 x half> @select_v8f16(<8 x i1> %a, <8 x half> %b, <8 x half> %c, i32 zeroext %evl) {
500 ; CHECK-LABEL: select_v8f16:
502 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
503 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
505 %v = call <8 x half> @llvm.vp.select.v8f16(<8 x i1> %a, <8 x half> %b, <8 x half> %c, i32 %evl)
509 declare <16 x half> @llvm.vp.select.v16f16(<16 x i1>, <16 x half>, <16 x half>, i32)
511 define <16 x half> @select_v16f16(<16 x i1> %a, <16 x half> %b, <16 x half> %c, i32 zeroext %evl) {
512 ; CHECK-LABEL: select_v16f16:
514 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
515 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
517 %v = call <16 x half> @llvm.vp.select.v16f16(<16 x i1> %a, <16 x half> %b, <16 x half> %c, i32 %evl)
521 declare <2 x float> @llvm.vp.select.v2f32(<2 x i1>, <2 x float>, <2 x float>, i32)
523 define <2 x float> @select_v2f32(<2 x i1> %a, <2 x float> %b, <2 x float> %c, i32 zeroext %evl) {
524 ; CHECK-LABEL: select_v2f32:
526 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
527 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
529 %v = call <2 x float> @llvm.vp.select.v2f32(<2 x i1> %a, <2 x float> %b, <2 x float> %c, i32 %evl)
533 declare <4 x float> @llvm.vp.select.v4f32(<4 x i1>, <4 x float>, <4 x float>, i32)
535 define <4 x float> @select_v4f32(<4 x i1> %a, <4 x float> %b, <4 x float> %c, i32 zeroext %evl) {
536 ; CHECK-LABEL: select_v4f32:
538 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
539 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
541 %v = call <4 x float> @llvm.vp.select.v4f32(<4 x i1> %a, <4 x float> %b, <4 x float> %c, i32 %evl)
545 declare <8 x float> @llvm.vp.select.v8f32(<8 x i1>, <8 x float>, <8 x float>, i32)
547 define <8 x float> @select_v8f32(<8 x i1> %a, <8 x float> %b, <8 x float> %c, i32 zeroext %evl) {
548 ; CHECK-LABEL: select_v8f32:
550 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
551 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
553 %v = call <8 x float> @llvm.vp.select.v8f32(<8 x i1> %a, <8 x float> %b, <8 x float> %c, i32 %evl)
557 declare <16 x float> @llvm.vp.select.v16f32(<16 x i1>, <16 x float>, <16 x float>, i32)
559 define <16 x float> @select_v16f32(<16 x i1> %a, <16 x float> %b, <16 x float> %c, i32 zeroext %evl) {
560 ; CHECK-LABEL: select_v16f32:
562 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
563 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
565 %v = call <16 x float> @llvm.vp.select.v16f32(<16 x i1> %a, <16 x float> %b, <16 x float> %c, i32 %evl)
569 declare <64 x float> @llvm.vp.select.v64f32(<64 x i1>, <64 x float>, <64 x float>, i32)
571 define <64 x float> @select_v64f32(<64 x i1> %a, <64 x float> %b, <64 x float> %c, i32 zeroext %evl) {
572 ; CHECK-LABEL: select_v64f32:
574 ; CHECK-NEXT: addi sp, sp, -16
575 ; CHECK-NEXT: .cfi_def_cfa_offset 16
576 ; CHECK-NEXT: csrr a1, vlenb
577 ; CHECK-NEXT: slli a1, a1, 3
578 ; CHECK-NEXT: sub sp, sp, a1
579 ; CHECK-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
580 ; CHECK-NEXT: addi a1, a0, 128
581 ; CHECK-NEXT: li a3, 32
582 ; CHECK-NEXT: vsetvli zero, a3, e32, m8, ta, ma
583 ; CHECK-NEXT: vle32.v v24, (a1)
584 ; CHECK-NEXT: addi a1, sp, 16
585 ; CHECK-NEXT: vs8r.v v24, (a1) # Unknown-size Folded Spill
586 ; CHECK-NEXT: vle32.v v24, (a0)
587 ; CHECK-NEXT: mv a0, a2
588 ; CHECK-NEXT: bltu a2, a3, .LBB35_2
589 ; CHECK-NEXT: # %bb.1:
590 ; CHECK-NEXT: li a0, 32
591 ; CHECK-NEXT: .LBB35_2:
592 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
593 ; CHECK-NEXT: vmerge.vvm v8, v24, v8, v0
594 ; CHECK-NEXT: addi a0, a2, -32
595 ; CHECK-NEXT: sltu a1, a2, a0
596 ; CHECK-NEXT: addi a1, a1, -1
597 ; CHECK-NEXT: and a0, a1, a0
598 ; CHECK-NEXT: vsetivli zero, 4, e8, mf2, ta, ma
599 ; CHECK-NEXT: vslidedown.vi v0, v0, 4
600 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
601 ; CHECK-NEXT: addi a0, sp, 16
602 ; CHECK-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
603 ; CHECK-NEXT: vmerge.vvm v16, v24, v16, v0
604 ; CHECK-NEXT: csrr a0, vlenb
605 ; CHECK-NEXT: slli a0, a0, 3
606 ; CHECK-NEXT: add sp, sp, a0
607 ; CHECK-NEXT: addi sp, sp, 16
609 %v = call <64 x float> @llvm.vp.select.v64f32(<64 x i1> %a, <64 x float> %b, <64 x float> %c, i32 %evl)
613 declare <2 x double> @llvm.vp.select.v2f64(<2 x i1>, <2 x double>, <2 x double>, i32)
615 define <2 x double> @select_v2f64(<2 x i1> %a, <2 x double> %b, <2 x double> %c, i32 zeroext %evl) {
616 ; CHECK-LABEL: select_v2f64:
618 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
619 ; CHECK-NEXT: vmerge.vvm v8, v9, v8, v0
621 %v = call <2 x double> @llvm.vp.select.v2f64(<2 x i1> %a, <2 x double> %b, <2 x double> %c, i32 %evl)
625 declare <4 x double> @llvm.vp.select.v4f64(<4 x i1>, <4 x double>, <4 x double>, i32)
627 define <4 x double> @select_v4f64(<4 x i1> %a, <4 x double> %b, <4 x double> %c, i32 zeroext %evl) {
628 ; CHECK-LABEL: select_v4f64:
630 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
631 ; CHECK-NEXT: vmerge.vvm v8, v10, v8, v0
633 %v = call <4 x double> @llvm.vp.select.v4f64(<4 x i1> %a, <4 x double> %b, <4 x double> %c, i32 %evl)
637 declare <8 x double> @llvm.vp.select.v8f64(<8 x i1>, <8 x double>, <8 x double>, i32)
639 define <8 x double> @select_v8f64(<8 x i1> %a, <8 x double> %b, <8 x double> %c, i32 zeroext %evl) {
640 ; CHECK-LABEL: select_v8f64:
642 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
643 ; CHECK-NEXT: vmerge.vvm v8, v12, v8, v0
645 %v = call <8 x double> @llvm.vp.select.v8f64(<8 x i1> %a, <8 x double> %b, <8 x double> %c, i32 %evl)
649 declare <16 x double> @llvm.vp.select.v16f64(<16 x i1>, <16 x double>, <16 x double>, i32)
651 define <16 x double> @select_v16f64(<16 x i1> %a, <16 x double> %b, <16 x double> %c, i32 zeroext %evl) {
652 ; CHECK-LABEL: select_v16f64:
654 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
655 ; CHECK-NEXT: vmerge.vvm v8, v16, v8, v0
657 %v = call <16 x double> @llvm.vp.select.v16f64(<16 x i1> %a, <16 x double> %b, <16 x double> %c, i32 %evl)