1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+m,+v,+zvfh,+zvfbfmin < %s | FileCheck %s
3 ; RUN: llc -mtriple=riscv64 -mattr=+m,+v,+zvfh,+zvfbfmin < %s | FileCheck %s
5 define <vscale x 2 x bfloat> @vuitofp_nxv2bf16_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
6 ; CHECK-LABEL: vuitofp_nxv2bf16_nxv2i1:
8 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
9 ; CHECK-NEXT: vmv.v.i v9, 0
10 ; CHECK-NEXT: vmerge.vim v9, v9, 1, v0
11 ; CHECK-NEXT: vmv1r.v v0, v8
12 ; CHECK-NEXT: vfcvt.f.xu.v v9, v9, v0.t
13 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
14 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
16 %v = call <vscale x 2 x bfloat> @llvm.vp.uitofp.nxv2bf16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
17 ret <vscale x 2 x bfloat> %v
20 define <vscale x 2 x bfloat> @vuitofp_nxv2bf16_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
21 ; CHECK-LABEL: vuitofp_nxv2bf16_nxv2i1_unmasked:
23 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
24 ; CHECK-NEXT: vmv.v.i v8, 0
25 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
26 ; CHECK-NEXT: vfcvt.f.xu.v v9, v8
27 ; CHECK-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
28 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9
30 %v = call <vscale x 2 x bfloat> @llvm.vp.uitofp.nxv2bf16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
31 ret <vscale x 2 x bfloat> %v
34 declare <vscale x 2 x half> @llvm.vp.uitofp.nxv2f16.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
36 define <vscale x 2 x half> @vuitofp_nxv2f16_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
37 ; CHECK-LABEL: vuitofp_nxv2f16_nxv2i1:
39 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
40 ; CHECK-NEXT: vmv.v.i v9, 0
41 ; CHECK-NEXT: vmerge.vim v9, v9, 1, v0
42 ; CHECK-NEXT: vmv1r.v v0, v8
43 ; CHECK-NEXT: vfcvt.f.xu.v v8, v9, v0.t
45 %v = call <vscale x 2 x half> @llvm.vp.uitofp.nxv2f16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
46 ret <vscale x 2 x half> %v
49 define <vscale x 2 x half> @vuitofp_nxv2f16_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
50 ; CHECK-LABEL: vuitofp_nxv2f16_nxv2i1_unmasked:
52 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
53 ; CHECK-NEXT: vmv.v.i v8, 0
54 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
55 ; CHECK-NEXT: vfcvt.f.xu.v v8, v8
57 %v = call <vscale x 2 x half> @llvm.vp.uitofp.nxv2f16.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
58 ret <vscale x 2 x half> %v
61 declare <vscale x 2 x float> @llvm.vp.uitofp.nxv2f32.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
63 define <vscale x 2 x float> @vuitofp_nxv2f32_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
64 ; CHECK-LABEL: vuitofp_nxv2f32_nxv2i1:
66 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
67 ; CHECK-NEXT: vmv.v.i v9, 0
68 ; CHECK-NEXT: vmerge.vim v9, v9, 1, v0
69 ; CHECK-NEXT: vmv1r.v v0, v8
70 ; CHECK-NEXT: vfcvt.f.xu.v v8, v9, v0.t
72 %v = call <vscale x 2 x float> @llvm.vp.uitofp.nxv2f32.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
73 ret <vscale x 2 x float> %v
76 define <vscale x 2 x float> @vuitofp_nxv2f32_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
77 ; CHECK-LABEL: vuitofp_nxv2f32_nxv2i1_unmasked:
79 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
80 ; CHECK-NEXT: vmv.v.i v8, 0
81 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
82 ; CHECK-NEXT: vfcvt.f.xu.v v8, v8
84 %v = call <vscale x 2 x float> @llvm.vp.uitofp.nxv2f32.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
85 ret <vscale x 2 x float> %v
88 declare <vscale x 2 x double> @llvm.vp.uitofp.nxv2f64.nxv2i1(<vscale x 2 x i1>, <vscale x 2 x i1>, i32)
90 define <vscale x 2 x double> @vuitofp_nxv2f64_nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 zeroext %evl) {
91 ; CHECK-LABEL: vuitofp_nxv2f64_nxv2i1:
93 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
94 ; CHECK-NEXT: vmv.v.i v10, 0
95 ; CHECK-NEXT: vmerge.vim v10, v10, 1, v0
96 ; CHECK-NEXT: vmv1r.v v0, v8
97 ; CHECK-NEXT: vfcvt.f.xu.v v8, v10, v0.t
99 %v = call <vscale x 2 x double> @llvm.vp.uitofp.nxv2f64.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> %m, i32 %evl)
100 ret <vscale x 2 x double> %v
103 define <vscale x 2 x double> @vuitofp_nxv2f64_nxv2i1_unmasked(<vscale x 2 x i1> %va, i32 zeroext %evl) {
104 ; CHECK-LABEL: vuitofp_nxv2f64_nxv2i1_unmasked:
106 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
107 ; CHECK-NEXT: vmv.v.i v8, 0
108 ; CHECK-NEXT: vmerge.vim v8, v8, 1, v0
109 ; CHECK-NEXT: vfcvt.f.xu.v v8, v8
111 %v = call <vscale x 2 x double> @llvm.vp.uitofp.nxv2f64.nxv2i1(<vscale x 2 x i1> %va, <vscale x 2 x i1> splat (i1 true), i32 %evl)
112 ret <vscale x 2 x double> %v