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,+experimental-zvfbfmin \
3 ; RUN: -verify-machineinstrs -target-abi=ilp32d | FileCheck %s
4 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v,+experimental-zvfbfmin \
5 ; RUN: -verify-machineinstrs -target-abi=lp64d | FileCheck %s
7 declare <vscale x 1 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv1f32.nxv1bf16(
12 define <vscale x 1 x float> @intrinsic_vfwcvtbf16_f.f.v_nxv1f32_nxv1bf16(<vscale x 1 x bfloat> %0, iXLen %1) nounwind {
13 ; CHECK-LABEL: intrinsic_vfwcvtbf16_f.f.v_nxv1f32_nxv1bf16:
14 ; CHECK: # %bb.0: # %entry
15 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
16 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
17 ; CHECK-NEXT: vmv1r.v v8, v9
20 %a = call <vscale x 1 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv1f32.nxv1bf16(
21 <vscale x 1 x float> undef,
22 <vscale x 1 x bfloat> %0,
25 ret <vscale x 1 x float> %a
28 declare <vscale x 1 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv1f32.nxv1bf16(
30 <vscale x 1 x bfloat>,
35 define <vscale x 1 x float> @intrinsic_vfwcvtbf16_mask_f.f.v_nxv1f32_nxv1bf16(<vscale x 1 x float> %0, <vscale x 1 x bfloat> %1, <vscale x 1 x i1> %2, iXLen %3) nounwind {
36 ; CHECK-LABEL: intrinsic_vfwcvtbf16_mask_f.f.v_nxv1f32_nxv1bf16:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
39 ; CHECK-NEXT: vfwcvtbf16.f.f.v v8, v9, v0.t
42 %a = call <vscale x 1 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv1f32.nxv1bf16(
43 <vscale x 1 x float> %0,
44 <vscale x 1 x bfloat> %1,
48 ret <vscale x 1 x float> %a
51 declare <vscale x 2 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv2f32.nxv2bf16(
53 <vscale x 2 x bfloat>,
56 define <vscale x 2 x float> @intrinsic_vfwcvtbf16_f.f.v_nxv2f32_nxv2bf16(<vscale x 2 x bfloat> %0, iXLen %1) nounwind {
57 ; CHECK-LABEL: intrinsic_vfwcvtbf16_f.f.v_nxv2f32_nxv2bf16:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
60 ; CHECK-NEXT: vfwcvtbf16.f.f.v v9, v8
61 ; CHECK-NEXT: vmv1r.v v8, v9
64 %a = call <vscale x 2 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv2f32.nxv2bf16(
65 <vscale x 2 x float> undef,
66 <vscale x 2 x bfloat> %0,
69 ret <vscale x 2 x float> %a
72 declare <vscale x 2 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv2f32.nxv2bf16(
74 <vscale x 2 x bfloat>,
79 define <vscale x 2 x float> @intrinsic_vfwcvtbf16_mask_f.f.v_nxv2f32_nxv2bf16(<vscale x 2 x float> %0, <vscale x 2 x bfloat> %1, <vscale x 2 x i1> %2, iXLen %3) nounwind {
80 ; CHECK-LABEL: intrinsic_vfwcvtbf16_mask_f.f.v_nxv2f32_nxv2bf16:
81 ; CHECK: # %bb.0: # %entry
82 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
83 ; CHECK-NEXT: vfwcvtbf16.f.f.v v8, v9, v0.t
86 %a = call <vscale x 2 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv2f32.nxv2bf16(
87 <vscale x 2 x float> %0,
88 <vscale x 2 x bfloat> %1,
92 ret <vscale x 2 x float> %a
95 declare <vscale x 4 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv4f32.nxv4bf16(
97 <vscale x 4 x bfloat>,
100 define <vscale x 4 x float> @intrinsic_vfwcvtbf16_f.f.v_nxv4f32_nxv4bf16(<vscale x 4 x bfloat> %0, iXLen %1) nounwind {
101 ; CHECK-LABEL: intrinsic_vfwcvtbf16_f.f.v_nxv4f32_nxv4bf16:
102 ; CHECK: # %bb.0: # %entry
103 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, ma
104 ; CHECK-NEXT: vfwcvtbf16.f.f.v v10, v8
105 ; CHECK-NEXT: vmv2r.v v8, v10
108 %a = call <vscale x 4 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv4f32.nxv4bf16(
109 <vscale x 4 x float> undef,
110 <vscale x 4 x bfloat> %0,
113 ret <vscale x 4 x float> %a
116 declare <vscale x 4 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv4f32.nxv4bf16(
117 <vscale x 4 x float>,
118 <vscale x 4 x bfloat>,
123 define <vscale x 4 x float> @intrinsic_vfwcvtbf16_mask_f.f.v_nxv4f32_nxv4bf16(<vscale x 4 x float> %0, <vscale x 4 x bfloat> %1, <vscale x 4 x i1> %2, iXLen %3) nounwind {
124 ; CHECK-LABEL: intrinsic_vfwcvtbf16_mask_f.f.v_nxv4f32_nxv4bf16:
125 ; CHECK: # %bb.0: # %entry
126 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
127 ; CHECK-NEXT: vfwcvtbf16.f.f.v v8, v10, v0.t
130 %a = call <vscale x 4 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv4f32.nxv4bf16(
131 <vscale x 4 x float> %0,
132 <vscale x 4 x bfloat> %1,
133 <vscale x 4 x i1> %2,
136 ret <vscale x 4 x float> %a
139 declare <vscale x 8 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv8f32.nxv8bf16(
140 <vscale x 8 x float>,
141 <vscale x 8 x bfloat>,
144 define <vscale x 8 x float> @intrinsic_vfwcvtbf16_f.f.v_nxv8f32_nxv8bf16(<vscale x 8 x bfloat> %0, iXLen %1) nounwind {
145 ; CHECK-LABEL: intrinsic_vfwcvtbf16_f.f.v_nxv8f32_nxv8bf16:
146 ; CHECK: # %bb.0: # %entry
147 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, ma
148 ; CHECK-NEXT: vfwcvtbf16.f.f.v v12, v8
149 ; CHECK-NEXT: vmv4r.v v8, v12
152 %a = call <vscale x 8 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv8f32.nxv8bf16(
153 <vscale x 8 x float> undef,
154 <vscale x 8 x bfloat> %0,
157 ret <vscale x 8 x float> %a
160 declare <vscale x 8 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv8f32.nxv8bf16(
161 <vscale x 8 x float>,
162 <vscale x 8 x bfloat>,
167 define <vscale x 8 x float> @intrinsic_vfwcvtbf16_mask_f.f.v_nxv8f32_nxv8bf16(<vscale x 8 x float> %0, <vscale x 8 x bfloat> %1, <vscale x 8 x i1> %2, iXLen %3) nounwind {
168 ; CHECK-LABEL: intrinsic_vfwcvtbf16_mask_f.f.v_nxv8f32_nxv8bf16:
169 ; CHECK: # %bb.0: # %entry
170 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
171 ; CHECK-NEXT: vfwcvtbf16.f.f.v v8, v12, v0.t
174 %a = call <vscale x 8 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv8f32.nxv8bf16(
175 <vscale x 8 x float> %0,
176 <vscale x 8 x bfloat> %1,
177 <vscale x 8 x i1> %2,
180 ret <vscale x 8 x float> %a
183 declare <vscale x 16 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv16f32.nxv16bf16(
184 <vscale x 16 x float>,
185 <vscale x 16 x bfloat>,
188 define <vscale x 16 x float> @intrinsic_vfwcvtbf16_f.f.v_nxv16f32_nxv16bf16(<vscale x 16 x bfloat> %0, iXLen %1) nounwind {
189 ; CHECK-LABEL: intrinsic_vfwcvtbf16_f.f.v_nxv16f32_nxv16bf16:
190 ; CHECK: # %bb.0: # %entry
191 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, ma
192 ; CHECK-NEXT: vfwcvtbf16.f.f.v v16, v8
193 ; CHECK-NEXT: vmv8r.v v8, v16
196 %a = call <vscale x 16 x float> @llvm.riscv.vfwcvtbf16.f.f.v.nxv16f32.nxv16bf16(
197 <vscale x 16 x float> undef,
198 <vscale x 16 x bfloat> %0,
201 ret <vscale x 16 x float> %a
204 declare <vscale x 16 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv16f32.nxv16bf16(
205 <vscale x 16 x float>,
206 <vscale x 16 x bfloat>,
211 define <vscale x 16 x float> @intrinsic_vfwcvtbf16_mask_f.f.v_nxv16f32_nxv16bf16(<vscale x 16 x float> %0, <vscale x 16 x bfloat> %1, <vscale x 16 x i1> %2, iXLen %3) nounwind {
212 ; CHECK-LABEL: intrinsic_vfwcvtbf16_mask_f.f.v_nxv16f32_nxv16bf16:
213 ; CHECK: # %bb.0: # %entry
214 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
215 ; CHECK-NEXT: vfwcvtbf16.f.f.v v8, v16, v0.t
218 %a = call <vscale x 16 x float> @llvm.riscv.vfwcvtbf16.f.f.v.mask.nxv16f32.nxv16bf16(
219 <vscale x 16 x float> %0,
220 <vscale x 16 x bfloat> %1,
221 <vscale x 16 x i1> %2,
224 ret <vscale x 16 x float> %a