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
3 ; RUN: llc -mtriple=riscv64 -mattr=+m,+v,+zfh,+zvfh < %s | FileCheck %s
5 declare <4 x half> @llvm.vp.sitofp.v4f16.v4i1(<4 x i1>, <4 x i1>, i32)
7 define <4 x half> @vsitofp_v4f16_v4i1(<4 x i1> %va, <4 x i1> %m, i32 zeroext %evl) {
8 ; CHECK-LABEL: vsitofp_v4f16_v4i1:
10 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
11 ; CHECK-NEXT: vmv.v.i v9, 0
12 ; CHECK-NEXT: vmerge.vim v9, v9, -1, v0
13 ; CHECK-NEXT: vmv1r.v v0, v8
14 ; CHECK-NEXT: vfcvt.f.x.v v8, v9, v0.t
16 %v = call <4 x half> @llvm.vp.sitofp.v4f16.v4i1(<4 x i1> %va, <4 x i1> %m, i32 %evl)
20 define <4 x half> @vsitofp_v4f16_v4i1_unmasked(<4 x i1> %va, i32 zeroext %evl) {
21 ; CHECK-LABEL: vsitofp_v4f16_v4i1_unmasked:
23 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
24 ; CHECK-NEXT: vmv.v.i v8, 0
25 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
26 ; CHECK-NEXT: vfcvt.f.x.v v8, v8
28 %v = call <4 x half> @llvm.vp.sitofp.v4f16.v4i1(<4 x i1> %va, <4 x i1> shufflevector (<4 x i1> insertelement (<4 x i1> undef, i1 true, i32 0), <4 x i1> undef, <4 x i32> zeroinitializer), i32 %evl)
32 declare <4 x float> @llvm.vp.sitofp.v4f32.v4i1(<4 x i1>, <4 x i1>, i32)
34 define <4 x float> @vsitofp_v4f32_v4i1(<4 x i1> %va, <4 x i1> %m, i32 zeroext %evl) {
35 ; CHECK-LABEL: vsitofp_v4f32_v4i1:
37 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
38 ; CHECK-NEXT: vmv.v.i v9, 0
39 ; CHECK-NEXT: vmerge.vim v9, v9, -1, v0
40 ; CHECK-NEXT: vmv1r.v v0, v8
41 ; CHECK-NEXT: vfcvt.f.x.v v8, v9, v0.t
43 %v = call <4 x float> @llvm.vp.sitofp.v4f32.v4i1(<4 x i1> %va, <4 x i1> %m, i32 %evl)
47 define <4 x float> @vsitofp_v4f32_v4i1_unmasked(<4 x i1> %va, i32 zeroext %evl) {
48 ; CHECK-LABEL: vsitofp_v4f32_v4i1_unmasked:
50 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
51 ; CHECK-NEXT: vmv.v.i v8, 0
52 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
53 ; CHECK-NEXT: vfcvt.f.x.v v8, v8
55 %v = call <4 x float> @llvm.vp.sitofp.v4f32.v4i1(<4 x i1> %va, <4 x i1> shufflevector (<4 x i1> insertelement (<4 x i1> undef, i1 true, i32 0), <4 x i1> undef, <4 x i32> zeroinitializer), i32 %evl)
59 declare <4 x double> @llvm.vp.sitofp.v4f64.v4i1(<4 x i1>, <4 x i1>, i32)
61 define <4 x double> @vsitofp_v4f64_v4i1(<4 x i1> %va, <4 x i1> %m, i32 zeroext %evl) {
62 ; CHECK-LABEL: vsitofp_v4f64_v4i1:
64 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
65 ; CHECK-NEXT: vmv.v.i v10, 0
66 ; CHECK-NEXT: vmerge.vim v10, v10, -1, v0
67 ; CHECK-NEXT: vmv1r.v v0, v8
68 ; CHECK-NEXT: vfcvt.f.x.v v8, v10, v0.t
70 %v = call <4 x double> @llvm.vp.sitofp.v4f64.v4i1(<4 x i1> %va, <4 x i1> %m, i32 %evl)
74 define <4 x double> @vsitofp_v4f64_v4i1_unmasked(<4 x i1> %va, i32 zeroext %evl) {
75 ; CHECK-LABEL: vsitofp_v4f64_v4i1_unmasked:
77 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
78 ; CHECK-NEXT: vmv.v.i v8, 0
79 ; CHECK-NEXT: vmerge.vim v8, v8, -1, v0
80 ; CHECK-NEXT: vfcvt.f.x.v v8, v8
82 %v = call <4 x double> @llvm.vp.sitofp.v4f64.v4i1(<4 x i1> %va, <4 x i1> shufflevector (<4 x i1> insertelement (<4 x i1> undef, i1 true, i32 0), <4 x i1> undef, <4 x i32> zeroinitializer), i32 %evl)