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 <4 x i1> @llvm.vp.fptosi.v4i1.v4f16(<4 x half>, <4 x i1>, i32)
9 define <4 x i1> @vfptosi_v4i1_v4f16(<4 x half> %va, <4 x i1> %m, i32 zeroext %evl) {
10 ; ZVFH-LABEL: vfptosi_v4i1_v4f16:
12 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
13 ; ZVFH-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
14 ; ZVFH-NEXT: vmsne.vi v0, v8, 0, v0.t
17 ; ZVFHMIN-LABEL: vfptosi_v4i1_v4f16:
19 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
20 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
21 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
22 ; ZVFHMIN-NEXT: vfcvt.rtz.x.f.v v8, v9, v0.t
23 ; ZVFHMIN-NEXT: vmsne.vi v0, v8, 0, v0.t
25 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f16(<4 x half> %va, <4 x i1> %m, i32 %evl)
29 define <4 x i1> @vfptosi_v4i1_v4f16_unmasked(<4 x half> %va, i32 zeroext %evl) {
30 ; ZVFH-LABEL: vfptosi_v4i1_v4f16_unmasked:
32 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
33 ; ZVFH-NEXT: vfcvt.rtz.x.f.v v8, v8
34 ; ZVFH-NEXT: vmsne.vi v0, v8, 0
37 ; ZVFHMIN-LABEL: vfptosi_v4i1_v4f16_unmasked:
39 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
40 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
41 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
42 ; ZVFHMIN-NEXT: vfcvt.rtz.x.f.v v8, v9
43 ; ZVFHMIN-NEXT: vmsne.vi v0, v8, 0
45 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f16(<4 x half> %va, <4 x i1> splat (i1 true), i32 %evl)
49 declare <4 x i1> @llvm.vp.fptosi.v4i1.v4f32(<4 x float>, <4 x i1>, i32)
51 define <4 x i1> @vfptosi_v4i1_v4f32(<4 x float> %va, <4 x i1> %m, i32 zeroext %evl) {
52 ; CHECK-LABEL: vfptosi_v4i1_v4f32:
54 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
55 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8, v0.t
56 ; CHECK-NEXT: vmsne.vi v0, v8, 0, v0.t
58 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f32(<4 x float> %va, <4 x i1> %m, i32 %evl)
62 define <4 x i1> @vfptosi_v4i1_v4f32_unmasked(<4 x float> %va, i32 zeroext %evl) {
63 ; CHECK-LABEL: vfptosi_v4i1_v4f32_unmasked:
65 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
66 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
67 ; CHECK-NEXT: vmsne.vi v0, v8, 0
69 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f32(<4 x float> %va, <4 x i1> splat (i1 true), i32 %evl)
73 declare <4 x i1> @llvm.vp.fptosi.v4i1.v4f64(<4 x double>, <4 x i1>, i32)
75 define <4 x i1> @vfptosi_v4i1_v4f64(<4 x double> %va, <4 x i1> %m, i32 zeroext %evl) {
76 ; CHECK-LABEL: vfptosi_v4i1_v4f64:
78 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
79 ; CHECK-NEXT: vfcvt.rtz.x.f.v v10, v8, v0.t
80 ; CHECK-NEXT: vmsne.vi v8, v10, 0, v0.t
81 ; CHECK-NEXT: vmv1r.v v0, v8
83 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f64(<4 x double> %va, <4 x i1> %m, i32 %evl)
87 define <4 x i1> @vfptosi_v4i1_v4f64_unmasked(<4 x double> %va, i32 zeroext %evl) {
88 ; CHECK-LABEL: vfptosi_v4i1_v4f64_unmasked:
90 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
91 ; CHECK-NEXT: vfcvt.rtz.x.f.v v8, v8
92 ; CHECK-NEXT: vmsne.vi v0, v8, 0
94 %v = call <4 x i1> @llvm.vp.fptosi.v4i1.v4f64(<4 x double> %va, <4 x i1> splat (i1 true), i32 %evl)