1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v,+zvfbfmin \
3 ; RUN: -verify-machineinstrs -target-abi=ilp32d | FileCheck %s
4 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+zvfbfmin \
5 ; RUN: -verify-machineinstrs -target-abi=lp64d | FileCheck %s
7 declare <vscale x 1 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv1bf16.nxv1f32(
12 define <vscale x 1 x bfloat> @intrinsic_vfncvtbf16_f.f.w_nxv1bf16_nxv1f32(<vscale x 1 x float> %0, iXLen %1) nounwind {
13 ; CHECK-LABEL: intrinsic_vfncvtbf16_f.f.w_nxv1bf16_nxv1f32:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfncvtbf16.f.f.w v9, v8
17 ; CHECK-NEXT: vmv1r.v v8, v9
20 %a = call <vscale x 1 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv1bf16.nxv1f32(
21 <vscale x 1 x bfloat> undef,
22 <vscale x 1 x float> %0,
25 ret <vscale x 1 x bfloat> %a
28 declare <vscale x 1 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv1bf16.nxv1f32(
29 <vscale x 1 x bfloat>,
34 define <vscale x 1 x bfloat> @intrinsic_vfncvtbf16_mask_f.f.w_nxv1bf16_nxv1f32(<vscale x 1 x bfloat> %0, <vscale x 1 x float> %1, <vscale x 1 x i1> %2, iXLen %3) nounwind {
35 ; CHECK-LABEL: intrinsic_vfncvtbf16_mask_f.f.w_nxv1bf16_nxv1f32:
36 ; CHECK: # %bb.0: # %entry
37 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
38 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9, v0.t
41 %a = call <vscale x 1 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv1bf16.nxv1f32(
42 <vscale x 1 x bfloat> %0,
43 <vscale x 1 x float> %1,
45 iXLen 7, iXLen %3, iXLen 1)
47 ret <vscale x 1 x bfloat> %a
50 declare <vscale x 2 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv2bf16.nxv2f32(
51 <vscale x 2 x bfloat>,
55 define <vscale x 2 x bfloat> @intrinsic_vfncvtbf16_f.f.w_nxv2bf16_nxv2f32(<vscale x 2 x float> %0, iXLen %1) nounwind {
56 ; CHECK-LABEL: intrinsic_vfncvtbf16_f.f.w_nxv2bf16_nxv2f32:
57 ; CHECK: # %bb.0: # %entry
58 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
59 ; CHECK-NEXT: vfncvtbf16.f.f.w v9, v8
60 ; CHECK-NEXT: vmv1r.v v8, v9
63 %a = call <vscale x 2 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv2bf16.nxv2f32(
64 <vscale x 2 x bfloat> undef,
65 <vscale x 2 x float> %0,
68 ret <vscale x 2 x bfloat> %a
71 declare <vscale x 2 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv2bf16.nxv2f32(
72 <vscale x 2 x bfloat>,
77 define <vscale x 2 x bfloat> @intrinsic_vfncvtbf16_mask_f.f.w_nxv2bf16_nxv2f32(<vscale x 2 x bfloat> %0, <vscale x 2 x float> %1, <vscale x 2 x i1> %2, iXLen %3) nounwind {
78 ; CHECK-LABEL: intrinsic_vfncvtbf16_mask_f.f.w_nxv2bf16_nxv2f32:
79 ; CHECK: # %bb.0: # %entry
80 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
81 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v9, v0.t
84 %a = call <vscale x 2 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv2bf16.nxv2f32(
85 <vscale x 2 x bfloat> %0,
86 <vscale x 2 x float> %1,
88 iXLen 7, iXLen %3, iXLen 1)
90 ret <vscale x 2 x bfloat> %a
93 declare <vscale x 4 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv4bf16.nxv4f32(
94 <vscale x 4 x bfloat>,
98 define <vscale x 4 x bfloat> @intrinsic_vfncvtbf16_f.f.w_nxv4bf16_nxv4f32(<vscale x 4 x float> %0, iXLen %1) nounwind {
99 ; CHECK-LABEL: intrinsic_vfncvtbf16_f.f.w_nxv4bf16_nxv4f32:
100 ; CHECK: # %bb.0: # %entry
101 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
102 ; CHECK-NEXT: vfncvtbf16.f.f.w v10, v8
103 ; CHECK-NEXT: vmv.v.v v8, v10
106 %a = call <vscale x 4 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv4bf16.nxv4f32(
107 <vscale x 4 x bfloat> undef,
108 <vscale x 4 x float> %0,
111 ret <vscale x 4 x bfloat> %a
114 declare <vscale x 4 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv4bf16.nxv4f32(
115 <vscale x 4 x bfloat>,
116 <vscale x 4 x float>,
118 iXLen, iXLen, iXLen);
120 define <vscale x 4 x bfloat> @intrinsic_vfncvtbf16_mask_f.f.w_nxv4bf16_nxv4f32(<vscale x 4 x bfloat> %0, <vscale x 4 x float> %1, <vscale x 4 x i1> %2, iXLen %3) nounwind {
121 ; CHECK-LABEL: intrinsic_vfncvtbf16_mask_f.f.w_nxv4bf16_nxv4f32:
122 ; CHECK: # %bb.0: # %entry
123 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
124 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v10, v0.t
127 %a = call <vscale x 4 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv4bf16.nxv4f32(
128 <vscale x 4 x bfloat> %0,
129 <vscale x 4 x float> %1,
130 <vscale x 4 x i1> %2,
131 iXLen 7, iXLen %3, iXLen 1)
133 ret <vscale x 4 x bfloat> %a
136 declare <vscale x 8 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv8bf16.nxv8f32(
137 <vscale x 8 x bfloat>,
138 <vscale x 8 x float>,
141 define <vscale x 8 x bfloat> @intrinsic_vfncvtbf16_f.f.w_nxv8bf16_nxv8f32(<vscale x 8 x float> %0, iXLen %1) nounwind {
142 ; CHECK-LABEL: intrinsic_vfncvtbf16_f.f.w_nxv8bf16_nxv8f32:
143 ; CHECK: # %bb.0: # %entry
144 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
145 ; CHECK-NEXT: vfncvtbf16.f.f.w v12, v8
146 ; CHECK-NEXT: vmv.v.v v8, v12
149 %a = call <vscale x 8 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv8bf16.nxv8f32(
150 <vscale x 8 x bfloat> undef,
151 <vscale x 8 x float> %0,
154 ret <vscale x 8 x bfloat> %a
157 declare <vscale x 8 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv8bf16.nxv8f32(
158 <vscale x 8 x bfloat>,
159 <vscale x 8 x float>,
161 iXLen, iXLen, iXLen);
163 define <vscale x 8 x bfloat> @intrinsic_vfncvtbf16_mask_f.f.w_nxv8bf16_nxv8f32(<vscale x 8 x bfloat> %0, <vscale x 8 x float> %1, <vscale x 8 x i1> %2, iXLen %3) nounwind {
164 ; CHECK-LABEL: intrinsic_vfncvtbf16_mask_f.f.w_nxv8bf16_nxv8f32:
165 ; CHECK: # %bb.0: # %entry
166 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
167 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v12, v0.t
170 %a = call <vscale x 8 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv8bf16.nxv8f32(
171 <vscale x 8 x bfloat> %0,
172 <vscale x 8 x float> %1,
173 <vscale x 8 x i1> %2,
174 iXLen 7, iXLen %3, iXLen 1)
176 ret <vscale x 8 x bfloat> %a
179 declare <vscale x 16 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv16bf16.nxv16f32(
180 <vscale x 16 x bfloat>,
181 <vscale x 16 x float>,
184 define <vscale x 16 x bfloat> @intrinsic_vfncvtbf16_f.f.w_nxv16bf16_nxv16f32(<vscale x 16 x float> %0, iXLen %1) nounwind {
185 ; CHECK-LABEL: intrinsic_vfncvtbf16_f.f.w_nxv16bf16_nxv16f32:
186 ; CHECK: # %bb.0: # %entry
187 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
188 ; CHECK-NEXT: vfncvtbf16.f.f.w v16, v8
189 ; CHECK-NEXT: vmv.v.v v8, v16
192 %a = call <vscale x 16 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.nxv16bf16.nxv16f32(
193 <vscale x 16 x bfloat> undef,
194 <vscale x 16 x float> %0,
197 ret <vscale x 16 x bfloat> %a
200 declare <vscale x 16 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv16bf16.nxv16f32(
201 <vscale x 16 x bfloat>,
202 <vscale x 16 x float>,
204 iXLen, iXLen, iXLen);
206 define <vscale x 16 x bfloat> @intrinsic_vfncvtbf16_mask_f.f.w_nxv16bf16_nxv16f32(<vscale x 16 x bfloat> %0, <vscale x 16 x float> %1, <vscale x 16 x i1> %2, iXLen %3) nounwind {
207 ; CHECK-LABEL: intrinsic_vfncvtbf16_mask_f.f.w_nxv16bf16_nxv16f32:
208 ; CHECK: # %bb.0: # %entry
209 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
210 ; CHECK-NEXT: vfncvtbf16.f.f.w v8, v16, v0.t
213 %a = call <vscale x 16 x bfloat> @llvm.riscv.vfncvtbf16.f.f.w.mask.nxv16bf16.nxv16f32(
214 <vscale x 16 x bfloat> %0,
215 <vscale x 16 x float> %1,
216 <vscale x 16 x i1> %2,
217 iXLen 7, iXLen %3, iXLen 1)
219 ret <vscale x 16 x bfloat> %a