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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
9 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
10 ; ZVFH-LABEL: vfptosi_nxv2i1_nxv2f16:
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_nxv2i1_nxv2f16:
19 ; ZVFHMIN-NEXT: vsetvli a1, zero, 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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> %m, i32 %evl)
26 ret <vscale x 2 x i1> %v
29 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f16_unmasked(<vscale x 2 x half> %va, i32 zeroext %evl) {
30 ; ZVFH-LABEL: vfptosi_nxv2i1_nxv2f16_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_nxv2i1_nxv2f16_unmasked:
39 ; ZVFHMIN-NEXT: vsetvli a1, zero, 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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
46 ret <vscale x 2 x i1> %v
49 declare <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
51 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
52 ; CHECK-LABEL: vfptosi_nxv2i1_nxv2f32:
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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> %m, i32 %evl)
59 ret <vscale x 2 x i1> %v
62 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f32_unmasked(<vscale x 2 x float> %va, i32 zeroext %evl) {
63 ; CHECK-LABEL: vfptosi_nxv2i1_nxv2f32_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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
70 ret <vscale x 2 x i1> %v
73 declare <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f64(<vscale x 2 x double>, <vscale x 2 x i1>, i32)
75 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
76 ; CHECK-LABEL: vfptosi_nxv2i1_nxv2f64:
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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> %m, i32 %evl)
84 ret <vscale x 2 x i1> %v
87 define <vscale x 2 x i1> @vfptosi_nxv2i1_nxv2f64_unmasked(<vscale x 2 x double> %va, i32 zeroext %evl) {
88 ; CHECK-LABEL: vfptosi_nxv2i1_nxv2f64_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 <vscale x 2 x i1> @llvm.vp.fptosi.nxv2i1.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
95 ret <vscale x 2 x i1> %v