1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc -mtriple=riscv32 -mattr=+v,+d,+zfh,+zvfh -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v,+d,+zfh,+zvfh -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64
5 define <1 x i8> @vp_splat_v1i8(i8 %val, <1 x i1> %m, i32 zeroext %evl) {
6 ; CHECK-LABEL: vp_splat_v1i8:
8 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
9 ; CHECK-NEXT: vmv.v.x v8, a0
11 %splat = call <1 x i8> @llvm.experimental.vp.splat.v1i8(i8 %val, <1 x i1> %m, i32 %evl)
15 define <2 x i8> @vp_splat_v2i8(i8 %val, <2 x i1> %m, i32 zeroext %evl) {
16 ; CHECK-LABEL: vp_splat_v2i8:
18 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
19 ; CHECK-NEXT: vmv.v.x v8, a0
21 %splat = call <2 x i8> @llvm.experimental.vp.splat.v2i8(i8 %val, <2 x i1> %m, i32 %evl)
25 define <4 x i8> @vp_splat_v4i8(i8 %val, <4 x i1> %m, i32 zeroext %evl) {
26 ; CHECK-LABEL: vp_splat_v4i8:
28 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
29 ; CHECK-NEXT: vmv.v.x v8, a0
31 %splat = call <4 x i8> @llvm.experimental.vp.splat.v4i8(i8 %val, <4 x i1> %m, i32 %evl)
35 define <8 x i8> @vp_splat_v8i8(i8 %val, <8 x i1> %m, i32 zeroext %evl) {
36 ; CHECK-LABEL: vp_splat_v8i8:
38 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
39 ; CHECK-NEXT: vmv.v.x v8, a0
41 %splat = call <8 x i8> @llvm.experimental.vp.splat.v8i8(i8 %val, <8 x i1> %m, i32 %evl)
45 define <16 x i8> @vp_splat_v16i8(i8 %val, <16 x i1> %m, i32 zeroext %evl) {
46 ; CHECK-LABEL: vp_splat_v16i8:
48 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
49 ; CHECK-NEXT: vmv.v.x v8, a0
51 %splat = call <16 x i8> @llvm.experimental.vp.splat.v16i8(i8 %val, <16 x i1> %m, i32 %evl)
55 define <32 x i8> @vp_splat_v32i8(i8 %val, <32 x i1> %m, i32 zeroext %evl) {
56 ; CHECK-LABEL: vp_splat_v32i8:
58 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
59 ; CHECK-NEXT: vmv.v.x v8, a0
61 %splat = call <32 x i8> @llvm.experimental.vp.splat.v32i8(i8 %val, <32 x i1> %m, i32 %evl)
65 define <64 x i8> @vp_splat_v64i8(i8 %val, <64 x i1> %m, i32 zeroext %evl) {
66 ; CHECK-LABEL: vp_splat_v64i8:
68 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
69 ; CHECK-NEXT: vmv.v.x v8, a0
71 %splat = call <64 x i8> @llvm.experimental.vp.splat.v64i8(i8 %val, <64 x i1> %m, i32 %evl)
75 define <1 x i16> @vp_splat_v1i16(i16 %val, <1 x i1> %m, i32 zeroext %evl) {
76 ; CHECK-LABEL: vp_splat_v1i16:
78 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
79 ; CHECK-NEXT: vmv.v.x v8, a0
81 %splat = call <1 x i16> @llvm.experimental.vp.splat.v1i16(i16 %val, <1 x i1> %m, i32 %evl)
85 define <2 x i16> @vp_splat_v2i16(i16 %val, <2 x i1> %m, i32 zeroext %evl) {
86 ; CHECK-LABEL: vp_splat_v2i16:
88 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
89 ; CHECK-NEXT: vmv.v.x v8, a0
91 %splat = call <2 x i16> @llvm.experimental.vp.splat.v2i16(i16 %val, <2 x i1> %m, i32 %evl)
95 define <4 x i16> @vp_splat_v4i16(i16 %val, <4 x i1> %m, i32 zeroext %evl) {
96 ; CHECK-LABEL: vp_splat_v4i16:
98 ; CHECK-NEXT: vsetvli zero, a1, e16, mf2, ta, ma
99 ; CHECK-NEXT: vmv.v.x v8, a0
101 %splat = call <4 x i16> @llvm.experimental.vp.splat.v4i16(i16 %val, <4 x i1> %m, i32 %evl)
105 define <8 x i16> @vp_splat_v8i16(i16 %val, <8 x i1> %m, i32 zeroext %evl) {
106 ; CHECK-LABEL: vp_splat_v8i16:
108 ; CHECK-NEXT: vsetvli zero, a1, e16, m1, ta, ma
109 ; CHECK-NEXT: vmv.v.x v8, a0
111 %splat = call <8 x i16> @llvm.experimental.vp.splat.v8i16(i16 %val, <8 x i1> %m, i32 %evl)
115 define <16 x i16> @vp_splat_v16i16(i16 %val, <16 x i1> %m, i32 zeroext %evl) {
116 ; CHECK-LABEL: vp_splat_v16i16:
118 ; CHECK-NEXT: vsetvli zero, a1, e16, m2, ta, ma
119 ; CHECK-NEXT: vmv.v.x v8, a0
121 %splat = call <16 x i16> @llvm.experimental.vp.splat.v16i16(i16 %val, <16 x i1> %m, i32 %evl)
122 ret <16 x i16> %splat
125 define <32 x i16> @vp_splat_v32i16(i16 %val, <32 x i1> %m, i32 zeroext %evl) {
126 ; CHECK-LABEL: vp_splat_v32i16:
128 ; CHECK-NEXT: vsetvli zero, a1, e16, m4, ta, ma
129 ; CHECK-NEXT: vmv.v.x v8, a0
131 %splat = call <32 x i16> @llvm.experimental.vp.splat.v32i16(i16 %val, <32 x i1> %m, i32 %evl)
132 ret <32 x i16> %splat
135 define <1 x i32> @vp_splat_v1i32(i32 %val, <1 x i1> %m, i32 zeroext %evl) {
136 ; CHECK-LABEL: vp_splat_v1i32:
138 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
139 ; CHECK-NEXT: vmv.v.x v8, a0
141 %splat = call <1 x i32> @llvm.experimental.vp.splat.v1i32(i32 %val, <1 x i1> %m, i32 %evl)
145 define <2 x i32> @vp_splat_v2i32(i32 %val, <2 x i1> %m, i32 zeroext %evl) {
146 ; CHECK-LABEL: vp_splat_v2i32:
148 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
149 ; CHECK-NEXT: vmv.v.x v8, a0
151 %splat = call <2 x i32> @llvm.experimental.vp.splat.v2i32(i32 %val, <2 x i1> %m, i32 %evl)
155 define <4 x i32> @vp_splat_v4i32(i32 %val, <4 x i1> %m, i32 zeroext %evl) {
156 ; CHECK-LABEL: vp_splat_v4i32:
158 ; CHECK-NEXT: vsetvli zero, a1, e32, m1, ta, ma
159 ; CHECK-NEXT: vmv.v.x v8, a0
161 %splat = call <4 x i32> @llvm.experimental.vp.splat.v4i32(i32 %val, <4 x i1> %m, i32 %evl)
165 define <8 x i32> @vp_splat_v8i32(i32 %val, <8 x i1> %m, i32 zeroext %evl) {
166 ; CHECK-LABEL: vp_splat_v8i32:
168 ; CHECK-NEXT: vsetvli zero, a1, e32, m2, ta, ma
169 ; CHECK-NEXT: vmv.v.x v8, a0
171 %splat = call <8 x i32> @llvm.experimental.vp.splat.v8i32(i32 %val, <8 x i1> %m, i32 %evl)
175 define <16 x i32> @vp_splat_v16i32(i32 %val, <16 x i1> %m, i32 zeroext %evl) {
176 ; CHECK-LABEL: vp_splat_v16i32:
178 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
179 ; CHECK-NEXT: vmv.v.x v8, a0
181 %splat = call <16 x i32> @llvm.experimental.vp.splat.v16i32(i32 %val, <16 x i1> %m, i32 %evl)
182 ret <16 x i32> %splat
185 define <1 x i64> @vp_splat_v1i64(i64 %val, <1 x i1> %m, i32 zeroext %evl) {
186 ; RV32-LABEL: vp_splat_v1i64:
188 ; RV32-NEXT: addi sp, sp, -16
189 ; RV32-NEXT: .cfi_def_cfa_offset 16
190 ; RV32-NEXT: sw a1, 12(sp)
191 ; RV32-NEXT: sw a0, 8(sp)
192 ; RV32-NEXT: addi a0, sp, 8
193 ; RV32-NEXT: vsetivli zero, 1, e64, m1, ta, ma
194 ; RV32-NEXT: vlse64.v v8, (a0), zero
195 ; RV32-NEXT: addi sp, sp, 16
198 ; RV64-LABEL: vp_splat_v1i64:
200 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
201 ; RV64-NEXT: vmv.v.x v8, a0
203 %splat = call <1 x i64> @llvm.experimental.vp.splat.v1i64(i64 %val, <1 x i1> %m, i32 %evl)
207 define <2 x i64> @vp_splat_v2i64(i64 %val, <2 x i1> %m, i32 zeroext %evl) {
208 ; RV32-LABEL: vp_splat_v2i64:
210 ; RV32-NEXT: addi sp, sp, -16
211 ; RV32-NEXT: .cfi_def_cfa_offset 16
212 ; RV32-NEXT: sw a1, 12(sp)
213 ; RV32-NEXT: sw a0, 8(sp)
214 ; RV32-NEXT: addi a0, sp, 8
215 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
216 ; RV32-NEXT: vlse64.v v8, (a0), zero
217 ; RV32-NEXT: addi sp, sp, 16
220 ; RV64-LABEL: vp_splat_v2i64:
222 ; RV64-NEXT: vsetvli zero, a1, e64, m1, ta, ma
223 ; RV64-NEXT: vmv.v.x v8, a0
225 %splat = call <2 x i64> @llvm.experimental.vp.splat.v2i64(i64 %val, <2 x i1> %m, i32 %evl)
229 define <4 x i64> @vp_splat_v4i64(i64 %val, <4 x i1> %m, i32 zeroext %evl) {
230 ; RV32-LABEL: vp_splat_v4i64:
232 ; RV32-NEXT: addi sp, sp, -16
233 ; RV32-NEXT: .cfi_def_cfa_offset 16
234 ; RV32-NEXT: sw a1, 12(sp)
235 ; RV32-NEXT: sw a0, 8(sp)
236 ; RV32-NEXT: addi a0, sp, 8
237 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
238 ; RV32-NEXT: vlse64.v v8, (a0), zero
239 ; RV32-NEXT: addi sp, sp, 16
242 ; RV64-LABEL: vp_splat_v4i64:
244 ; RV64-NEXT: vsetvli zero, a1, e64, m2, ta, ma
245 ; RV64-NEXT: vmv.v.x v8, a0
247 %splat = call <4 x i64> @llvm.experimental.vp.splat.v4i64(i64 %val, <4 x i1> %m, i32 %evl)
251 define <8 x i64> @vp_splat_v8i64(i64 %val, <8 x i1> %m, i32 zeroext %evl) {
252 ; RV32-LABEL: vp_splat_v8i64:
254 ; RV32-NEXT: addi sp, sp, -16
255 ; RV32-NEXT: .cfi_def_cfa_offset 16
256 ; RV32-NEXT: sw a1, 12(sp)
257 ; RV32-NEXT: sw a0, 8(sp)
258 ; RV32-NEXT: addi a0, sp, 8
259 ; RV32-NEXT: vsetivli zero, 8, e64, m4, ta, ma
260 ; RV32-NEXT: vlse64.v v8, (a0), zero
261 ; RV32-NEXT: addi sp, sp, 16
264 ; RV64-LABEL: vp_splat_v8i64:
266 ; RV64-NEXT: vsetvli zero, a1, e64, m4, ta, ma
267 ; RV64-NEXT: vmv.v.x v8, a0
269 %splat = call <8 x i64> @llvm.experimental.vp.splat.v8i64(i64 %val, <8 x i1> %m, i32 %evl)
273 define <1 x half> @vp_splat_v1f16(half %val, <1 x i1> %m, i32 zeroext %evl) {
274 ; CHECK-LABEL: vp_splat_v1f16:
276 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
277 ; CHECK-NEXT: vfmv.v.f v8, fa0
279 %splat = call <1 x half> @llvm.experimental.vp.splat.v1f16(half %val, <1 x i1> %m, i32 %evl)
280 ret <1 x half> %splat
283 define <2 x half> @vp_splat_v2f16(half %val, <2 x i1> %m, i32 zeroext %evl) {
284 ; CHECK-LABEL: vp_splat_v2f16:
286 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
287 ; CHECK-NEXT: vfmv.v.f v8, fa0
289 %splat = call <2 x half> @llvm.experimental.vp.splat.v2f16(half %val, <2 x i1> %m, i32 %evl)
290 ret <2 x half> %splat
293 define <4 x half> @vp_splat_v4f16(half %val, <4 x i1> %m, i32 zeroext %evl) {
294 ; CHECK-LABEL: vp_splat_v4f16:
296 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
297 ; CHECK-NEXT: vfmv.v.f v8, fa0
299 %splat = call <4 x half> @llvm.experimental.vp.splat.v4f16(half %val, <4 x i1> %m, i32 %evl)
300 ret <4 x half> %splat
303 define <8 x half> @vp_splat_v8f16(half %val, <8 x i1> %m, i32 zeroext %evl) {
304 ; CHECK-LABEL: vp_splat_v8f16:
306 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
307 ; CHECK-NEXT: vfmv.v.f v8, fa0
309 %splat = call <8 x half> @llvm.experimental.vp.splat.v8f16(half %val, <8 x i1> %m, i32 %evl)
310 ret <8 x half> %splat
313 define <16 x half> @vp_splat_v16f16(half %val, <16 x i1> %m, i32 zeroext %evl) {
314 ; CHECK-LABEL: vp_splat_v16f16:
316 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
317 ; CHECK-NEXT: vfmv.v.f v8, fa0
319 %splat = call <16 x half> @llvm.experimental.vp.splat.v16f16(half %val, <16 x i1> %m, i32 %evl)
320 ret <16 x half> %splat
323 define <32 x half> @vp_splat_v32f16(half %val, <32 x i1> %m, i32 zeroext %evl) {
324 ; CHECK-LABEL: vp_splat_v32f16:
326 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
327 ; CHECK-NEXT: vfmv.v.f v8, fa0
329 %splat = call <32 x half> @llvm.experimental.vp.splat.v32f16(half %val, <32 x i1> %m, i32 %evl)
330 ret <32 x half> %splat
333 define <1 x float> @vp_splat_v1f32(float %val, <1 x i1> %m, i32 zeroext %evl) {
334 ; CHECK-LABEL: vp_splat_v1f32:
336 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
337 ; CHECK-NEXT: vfmv.v.f v8, fa0
339 %splat = call <1 x float> @llvm.experimental.vp.splat.v1f32(float %val, <1 x i1> %m, i32 %evl)
340 ret <1 x float> %splat
343 define <2 x float> @vp_splat_v2f32(float %val, <2 x i1> %m, i32 zeroext %evl) {
344 ; CHECK-LABEL: vp_splat_v2f32:
346 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
347 ; CHECK-NEXT: vfmv.v.f v8, fa0
349 %splat = call <2 x float> @llvm.experimental.vp.splat.v2f32(float %val, <2 x i1> %m, i32 %evl)
350 ret <2 x float> %splat
353 define <4 x float> @vp_splat_v4f32(float %val, <4 x i1> %m, i32 zeroext %evl) {
354 ; CHECK-LABEL: vp_splat_v4f32:
356 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
357 ; CHECK-NEXT: vfmv.v.f v8, fa0
359 %splat = call <4 x float> @llvm.experimental.vp.splat.v4f32(float %val, <4 x i1> %m, i32 %evl)
360 ret <4 x float> %splat
363 define <8 x float> @vp_splat_v8f32(float %val, <8 x i1> %m, i32 zeroext %evl) {
364 ; CHECK-LABEL: vp_splat_v8f32:
366 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
367 ; CHECK-NEXT: vfmv.v.f v8, fa0
369 %splat = call <8 x float> @llvm.experimental.vp.splat.v8f32(float %val, <8 x i1> %m, i32 %evl)
370 ret <8 x float> %splat
373 define <16 x float> @vp_splat_v16f32(float %val, <16 x i1> %m, i32 zeroext %evl) {
374 ; CHECK-LABEL: vp_splat_v16f32:
376 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
377 ; CHECK-NEXT: vfmv.v.f v8, fa0
379 %splat = call <16 x float> @llvm.experimental.vp.splat.v16f32(float %val, <16 x i1> %m, i32 %evl)
380 ret <16 x float> %splat
383 define <1 x double> @vp_splat_v1f64(double %val, <1 x i1> %m, i32 zeroext %evl) {
384 ; CHECK-LABEL: vp_splat_v1f64:
386 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
387 ; CHECK-NEXT: vfmv.v.f v8, fa0
389 %splat = call <1 x double> @llvm.experimental.vp.splat.v1f64(double %val, <1 x i1> %m, i32 %evl)
390 ret <1 x double> %splat
393 define <2 x double> @vp_splat_v2f64(double %val, <2 x i1> %m, i32 zeroext %evl) {
394 ; CHECK-LABEL: vp_splat_v2f64:
396 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
397 ; CHECK-NEXT: vfmv.v.f v8, fa0
399 %splat = call <2 x double> @llvm.experimental.vp.splat.v2f64(double %val, <2 x i1> %m, i32 %evl)
400 ret <2 x double> %splat
403 define <4 x double> @vp_splat_v4f64(double %val, <4 x i1> %m, i32 zeroext %evl) {
404 ; CHECK-LABEL: vp_splat_v4f64:
406 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
407 ; CHECK-NEXT: vfmv.v.f v8, fa0
409 %splat = call <4 x double> @llvm.experimental.vp.splat.v4f64(double %val, <4 x i1> %m, i32 %evl)
410 ret <4 x double> %splat
413 define <8 x double> @vp_splat_v8f64(double %val, <8 x i1> %m, i32 zeroext %evl) {
414 ; CHECK-LABEL: vp_splat_v8f64:
416 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
417 ; CHECK-NEXT: vfmv.v.f v8, fa0
419 %splat = call <8 x double> @llvm.experimental.vp.splat.v8f64(double %val, <8 x i1> %m, i32 %evl)
420 ret <8 x double> %splat
423 define <16 x i31> @vp_splat_v16i31(i31 %val, <16 x i1> %m, i32 zeroext %evl) {
424 ; CHECK-LABEL: vp_splat_v16i31:
426 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
427 ; CHECK-NEXT: vmv.v.x v8, a0
429 %splat = call <16 x i31> @llvm.experimental.vp.splat.v16i31(i31 %val, <16 x i1> %m, i32 %evl)
430 ret <16 x i31> %splat
433 define <15 x i32> @vp_splat_v15i32(i32 %val, <15 x i1> %m, i32 zeroext %evl) {
434 ; CHECK-LABEL: vp_splat_v15i32:
436 ; CHECK-NEXT: vsetvli zero, a1, e32, m4, ta, ma
437 ; CHECK-NEXT: vmv.v.x v8, a0
439 %splat = call <15 x i32> @llvm.experimental.vp.splat.v15i32(i32 %val, <15 x i1> %m, i32 %evl)
440 ret <15 x i32> %splat
444 define <32 x i32> @vp_splat_v32i32(i32 %val, <32 x i1> %m, i32 zeroext %evl) {
445 ; CHECK-LABEL: vp_splat_v32i32:
447 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
448 ; CHECK-NEXT: vmv.v.x v8, a0
450 %splat = call <32 x i32> @llvm.experimental.vp.splat.v32i32(i32 %val, <32 x i1> %m, i32 %evl)
451 ret <32 x i32> %splat