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 <vscale x 2 x half> @llvm.vp.sitofp.nxv2f16.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
7 define <vscale x 2 x half> @vsitofp_nxv2f16_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
8 ; CHECK-LABEL: vsitofp_nxv2f16_nxv2i1:
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 <vscale x 2 x half> @llvm.vp.sitofp.nxv2f16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
17 ret <vscale x 2 x half> %v
20 define <vscale x 2 x half> @vsitofp_nxv2f16_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
21 ; CHECK-LABEL: vsitofp_nxv2f16_nxv2i1_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 <vscale x 2 x half> @llvm.vp.sitofp.nxv2f16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
29 ret <vscale x 2 x half> %v
32 declare <vscale x 2 x float> @llvm.vp.sitofp.nxv2f32.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
34 define <vscale x 2 x float> @vsitofp_nxv2f32_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
35 ; CHECK-LABEL: vsitofp_nxv2f32_nxv2i1:
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 <vscale x 2 x float> @llvm.vp.sitofp.nxv2f32.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
44 ret <vscale x 2 x float> %v
47 define <vscale x 2 x float> @vsitofp_nxv2f32_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
48 ; CHECK-LABEL: vsitofp_nxv2f32_nxv2i1_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 <vscale x 2 x float> @llvm.vp.sitofp.nxv2f32.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
56 ret <vscale x 2 x float> %v
59 declare <vscale x 2 x double> @llvm.vp.sitofp.nxv2f64.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
61 define <vscale x 2 x double> @vsitofp_nxv2f64_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
62 ; CHECK-LABEL: vsitofp_nxv2f64_nxv2i1:
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 <vscale x 2 x double> @llvm.vp.sitofp.nxv2f64.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
71 ret <vscale x 2 x double> %v
74 define <vscale x 2 x double> @vsitofp_nxv2f64_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
75 ; CHECK-LABEL: vsitofp_nxv2f64_nxv2i1_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 <vscale x 2 x double> @llvm.vp.sitofp.nxv2f64.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
83 ret <vscale x 2 x double> %v