1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFH
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v,+m -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=ZVFHMIN
11 declare <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x i1>, i32)
12 declare <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float>, <vscale x 1 x i1>, i32)
13 declare <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half>, <vscale x 1 x i1>, i32)
14 declare <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1>, <vscale x 1 x float>, <vscale x 1 x float>, i32)
16 define <vscale x 1 x float> @vmfsac_vv_nxv1f32(<vscale x 1 x half> %a, <vscale x 1 x half> %b, <vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 zeroext %evl) {
17 ; ZVFH-LABEL: vmfsac_vv_nxv1f32:
19 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
20 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9, v0.t
21 ; ZVFH-NEXT: vmv1r.v v8, v10
24 ; ZVFHMIN-LABEL: vmfsac_vv_nxv1f32:
26 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
27 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8, v0.t
28 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9, v0.t
29 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
30 ; ZVFHMIN-NEXT: vfmsub.vv v8, v11, v10, v0.t
32 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> %m, i32 %evl)
33 %bext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %b, <vscale x 1 x i1> %m, i32 %evl)
34 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 %evl)
35 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %bext, <vscale x 1 x float> %negc, <vscale x 1 x i1> %m, i32 %evl)
36 ret <vscale x 1 x float> %v
39 define <vscale x 1 x float> @vmfsac_vv_nxv1f32_unmasked(<vscale x 1 x half> %a, <vscale x 1 x half> %b, <vscale x 1 x float> %c, i32 zeroext %evl) {
40 ; ZVFH-LABEL: vmfsac_vv_nxv1f32_unmasked:
42 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
43 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9
44 ; ZVFH-NEXT: vmv1r.v v8, v10
47 ; ZVFHMIN-LABEL: vmfsac_vv_nxv1f32_unmasked:
49 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
50 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
51 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
52 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
53 ; ZVFHMIN-NEXT: vfmsub.vv v8, v11, v10
55 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
56 %bext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %b, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
57 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
58 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %bext, <vscale x 1 x float> %negc, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
59 ret <vscale x 1 x float> %v
62 define <vscale x 1 x float> @vmfsac_vv_nxv1f32_tu(<vscale x 1 x half> %a, <vscale x 1 x half> %b, <vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 zeroext %evl) {
63 ; ZVFH-LABEL: vmfsac_vv_nxv1f32_tu:
65 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
66 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9, v0.t
67 ; ZVFH-NEXT: vmv1r.v v8, v10
70 ; ZVFHMIN-LABEL: vmfsac_vv_nxv1f32_tu:
72 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
73 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
74 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
75 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, tu, mu
76 ; ZVFHMIN-NEXT: vfmsac.vv v10, v11, v8, v0.t
77 ; ZVFHMIN-NEXT: vmv1r.v v8, v10
79 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
80 %bext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %b, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
81 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
82 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %bext, <vscale x 1 x float> %negc, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
83 %u = call <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1> %m, <vscale x 1 x float> %v, <vscale x 1 x float> %c, i32 %evl)
84 ret <vscale x 1 x float> %u
87 define <vscale x 1 x float> @vmfsac_vv_nxv1f32_unmasked_tu(<vscale x 1 x half> %a, <vscale x 1 x half> %b, <vscale x 1 x float> %c, i32 zeroext %evl) {
88 ; ZVFH-LABEL: vmfsac_vv_nxv1f32_unmasked_tu:
90 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
91 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9
92 ; ZVFH-NEXT: vmv1r.v v8, v10
95 ; ZVFHMIN-LABEL: vmfsac_vv_nxv1f32_unmasked_tu:
97 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
98 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
99 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
100 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, tu, ma
101 ; ZVFHMIN-NEXT: vfmsac.vv v10, v11, v8
102 ; ZVFHMIN-NEXT: vmv1r.v v8, v10
104 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
105 %bext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %b, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
106 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
107 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %bext, <vscale x 1 x float> %negc, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
108 %u = call <vscale x 1 x float> @llvm.vp.merge.nxv1f32(<vscale x 1 x i1> splat (i1 -1), <vscale x 1 x float> %v, <vscale x 1 x float> %c, i32 %evl)
109 ret <vscale x 1 x float> %u
112 define <vscale x 1 x float> @vmfsac_vf_nxv1f32(<vscale x 1 x half> %a, half %b, <vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 zeroext %evl) {
113 ; ZVFH-LABEL: vmfsac_vf_nxv1f32:
115 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
116 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8, v0.t
117 ; ZVFH-NEXT: vmv1r.v v8, v9
120 ; ZVFHMIN-LABEL: vmfsac_vf_nxv1f32:
122 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
123 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
124 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
125 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
126 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
127 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
128 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8, v0.t
129 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11, v0.t
130 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
131 ; ZVFHMIN-NEXT: vfmsub.vv v8, v10, v9, v0.t
133 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
134 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
135 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> %m, i32 %evl)
136 %vbext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
137 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 %evl)
138 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %vbext, <vscale x 1 x float> %negc, <vscale x 1 x i1> %m, i32 %evl)
139 ret <vscale x 1 x float> %v
142 define <vscale x 1 x float> @vmfsac_vf_nxv1f32_commute(<vscale x 1 x half> %a, half %b, <vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 zeroext %evl) {
143 ; ZVFH-LABEL: vmfsac_vf_nxv1f32_commute:
145 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
146 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8, v0.t
147 ; ZVFH-NEXT: vmv1r.v v8, v9
150 ; ZVFHMIN-LABEL: vmfsac_vf_nxv1f32_commute:
152 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
153 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
154 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
155 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
156 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
157 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
158 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8, v0.t
159 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11, v0.t
160 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
161 ; ZVFHMIN-NEXT: vfmsub.vv v10, v8, v9, v0.t
162 ; ZVFHMIN-NEXT: vmv1r.v v8, v10
164 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
165 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
166 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> %m, i32 %evl)
167 %vbext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
168 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> %m, i32 %evl)
169 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %vbext, <vscale x 1 x float> %aext, <vscale x 1 x float> %negc, <vscale x 1 x i1> %m, i32 %evl)
170 ret <vscale x 1 x float> %v
173 define <vscale x 1 x float> @vmfsac_vf_nxv1f32_unmasked(<vscale x 1 x half> %a, half %b, <vscale x 1 x float> %c, i32 zeroext %evl) {
174 ; ZVFH-LABEL: vmfsac_vf_nxv1f32_unmasked:
176 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
177 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8
178 ; ZVFH-NEXT: vmv1r.v v8, v9
181 ; ZVFHMIN-LABEL: vmfsac_vf_nxv1f32_unmasked:
183 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
184 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
185 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
186 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
187 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
188 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
189 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
190 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11
191 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
192 ; ZVFHMIN-NEXT: vfmsub.vv v8, v10, v9
194 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
195 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
196 %aext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
197 %vbext = call <vscale x 1 x float> @llvm.vp.fpext.nxv1f32.nxv1f16(<vscale x 1 x half> %vb, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
198 %negc = call <vscale x 1 x float> @llvm.vp.fneg.nxv1f32(<vscale x 1 x float> %c, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
199 %v = call <vscale x 1 x float> @llvm.vp.fma.nxv1f32(<vscale x 1 x float> %aext, <vscale x 1 x float> %vbext, <vscale x 1 x float> %negc, <vscale x 1 x i1> splat (i1 -1), i32 %evl)
200 ret <vscale x 1 x float> %v
203 declare <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x i1>, i32)
204 declare <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float>, <vscale x 2 x i1>, i32)
205 declare <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half>, <vscale x 2 x i1>, i32)
207 define <vscale x 2 x float> @vmfsac_vv_nxv2f32(<vscale x 2 x half> %a, <vscale x 2 x half> %b, <vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 zeroext %evl) {
208 ; ZVFH-LABEL: vmfsac_vv_nxv2f32:
210 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
211 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9, v0.t
212 ; ZVFH-NEXT: vmv1r.v v8, v10
215 ; ZVFHMIN-LABEL: vmfsac_vv_nxv2f32:
217 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
218 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8, v0.t
219 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9, v0.t
220 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
221 ; ZVFHMIN-NEXT: vfmsub.vv v8, v11, v10, v0.t
223 %aext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x i1> %m, i32 %evl)
224 %bext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %b, <vscale x 2 x i1> %m, i32 %evl)
225 %negc = call <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 %evl)
226 %v = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %aext, <vscale x 2 x float> %bext, <vscale x 2 x float> %negc, <vscale x 2 x i1> %m, i32 %evl)
227 ret <vscale x 2 x float> %v
230 define <vscale x 2 x float> @vmfsac_vv_nxv2f32_unmasked(<vscale x 2 x half> %a, <vscale x 2 x half> %b, <vscale x 2 x float> %c, i32 zeroext %evl) {
231 ; ZVFH-LABEL: vmfsac_vv_nxv2f32_unmasked:
233 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
234 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9
235 ; ZVFH-NEXT: vmv1r.v v8, v10
238 ; ZVFHMIN-LABEL: vmfsac_vv_nxv2f32_unmasked:
240 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
241 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
242 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
243 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
244 ; ZVFHMIN-NEXT: vfmsub.vv v8, v11, v10
246 %aext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
247 %bext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %b, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
248 %negc = call <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float> %c, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
249 %v = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %aext, <vscale x 2 x float> %bext, <vscale x 2 x float> %negc, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
250 ret <vscale x 2 x float> %v
253 define <vscale x 2 x float> @vmfsac_vf_nxv2f32(<vscale x 2 x half> %a, half %b, <vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 zeroext %evl) {
254 ; ZVFH-LABEL: vmfsac_vf_nxv2f32:
256 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
257 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8, v0.t
258 ; ZVFH-NEXT: vmv1r.v v8, v9
261 ; ZVFHMIN-LABEL: vmfsac_vf_nxv2f32:
263 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
264 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
265 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
266 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
267 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
268 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
269 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8, v0.t
270 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11, v0.t
271 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
272 ; ZVFHMIN-NEXT: vfmsub.vv v8, v10, v9, v0.t
274 %elt.head = insertelement <vscale x 2 x half> poison, half %b, i32 0
275 %vb = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
276 %aext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x i1> %m, i32 %evl)
277 %vbext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
278 %negc = call <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 %evl)
279 %v = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %aext, <vscale x 2 x float> %vbext, <vscale x 2 x float> %negc, <vscale x 2 x i1> %m, i32 %evl)
280 ret <vscale x 2 x float> %v
283 define <vscale x 2 x float> @vmfsac_vf_nxv2f32_commute(<vscale x 2 x half> %a, half %b, <vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 zeroext %evl) {
284 ; ZVFH-LABEL: vmfsac_vf_nxv2f32_commute:
286 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
287 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8, v0.t
288 ; ZVFH-NEXT: vmv1r.v v8, v9
291 ; ZVFHMIN-LABEL: vmfsac_vf_nxv2f32_commute:
293 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
294 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
295 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
296 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
297 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
298 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
299 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8, v0.t
300 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11, v0.t
301 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
302 ; ZVFHMIN-NEXT: vfmsub.vv v10, v8, v9, v0.t
303 ; ZVFHMIN-NEXT: vmv.v.v v8, v10
305 %elt.head = insertelement <vscale x 2 x half> poison, half %b, i32 0
306 %vb = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
307 %aext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x i1> %m, i32 %evl)
308 %vbext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
309 %negc = call <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float> %c, <vscale x 2 x i1> %m, i32 %evl)
310 %v = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %vbext, <vscale x 2 x float> %aext, <vscale x 2 x float> %negc, <vscale x 2 x i1> %m, i32 %evl)
311 ret <vscale x 2 x float> %v
314 define <vscale x 2 x float> @vmfsac_vf_nxv2f32_unmasked(<vscale x 2 x half> %a, half %b, <vscale x 2 x float> %c, i32 zeroext %evl) {
315 ; ZVFH-LABEL: vmfsac_vf_nxv2f32_unmasked:
317 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
318 ; ZVFH-NEXT: vfwmsac.vf v9, fa0, v8
319 ; ZVFH-NEXT: vmv1r.v v8, v9
322 ; ZVFHMIN-LABEL: vmfsac_vf_nxv2f32_unmasked:
324 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
325 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
326 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
327 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
328 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
329 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
330 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
331 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v11
332 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
333 ; ZVFHMIN-NEXT: vfmsub.vv v8, v10, v9
335 %elt.head = insertelement <vscale x 2 x half> poison, half %b, i32 0
336 %vb = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
337 %aext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
338 %vbext = call <vscale x 2 x float> @llvm.vp.fpext.nxv2f32.nxv2f16(<vscale x 2 x half> %vb, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
339 %negc = call <vscale x 2 x float> @llvm.vp.fneg.nxv2f32(<vscale x 2 x float> %c, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
340 %v = call <vscale x 2 x float> @llvm.vp.fma.nxv2f32(<vscale x 2 x float> %aext, <vscale x 2 x float> %vbext, <vscale x 2 x float> %negc, <vscale x 2 x i1> splat (i1 -1), i32 %evl)
341 ret <vscale x 2 x float> %v
344 declare <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x i1>, i32)
345 declare <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float>, <vscale x 4 x i1>, i32)
346 declare <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half>, <vscale x 4 x i1>, i32)
348 define <vscale x 4 x float> @vmfsac_vv_nxv4f32(<vscale x 4 x half> %a, <vscale x 4 x half> %b, <vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 zeroext %evl) {
349 ; ZVFH-LABEL: vmfsac_vv_nxv4f32:
351 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
352 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9, v0.t
353 ; ZVFH-NEXT: vmv2r.v v8, v10
356 ; ZVFHMIN-LABEL: vmfsac_vv_nxv4f32:
358 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, ta, ma
359 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8, v0.t
360 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9, v0.t
361 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
362 ; ZVFHMIN-NEXT: vfmsub.vv v12, v14, v10, v0.t
363 ; ZVFHMIN-NEXT: vmv.v.v v8, v12
365 %aext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x i1> %m, i32 %evl)
366 %bext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %b, <vscale x 4 x i1> %m, i32 %evl)
367 %negc = call <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 %evl)
368 %v = call <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float> %aext, <vscale x 4 x float> %bext, <vscale x 4 x float> %negc, <vscale x 4 x i1> %m, i32 %evl)
369 ret <vscale x 4 x float> %v
372 define <vscale x 4 x float> @vmfsac_vv_nxv4f32_unmasked(<vscale x 4 x half> %a, <vscale x 4 x half> %b, <vscale x 4 x float> %c, i32 zeroext %evl) {
373 ; ZVFH-LABEL: vmfsac_vv_nxv4f32_unmasked:
375 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
376 ; ZVFH-NEXT: vfwmsac.vv v10, v8, v9
377 ; ZVFH-NEXT: vmv2r.v v8, v10
380 ; ZVFHMIN-LABEL: vmfsac_vv_nxv4f32_unmasked:
382 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, ta, ma
383 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8
384 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
385 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
386 ; ZVFHMIN-NEXT: vfmsub.vv v12, v14, v10
387 ; ZVFHMIN-NEXT: vmv.v.v v8, v12
389 %aext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
390 %bext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %b, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
391 %negc = call <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float> %c, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
392 %v = call <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float> %aext, <vscale x 4 x float> %bext, <vscale x 4 x float> %negc, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
393 ret <vscale x 4 x float> %v
396 define <vscale x 4 x float> @vmfsac_vf_nxv4f32(<vscale x 4 x half> %a, half %b, <vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 zeroext %evl) {
397 ; ZVFH-LABEL: vmfsac_vf_nxv4f32:
399 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
400 ; ZVFH-NEXT: vfwmsac.vf v10, fa0, v8, v0.t
401 ; ZVFH-NEXT: vmv2r.v v8, v10
404 ; ZVFHMIN-LABEL: vmfsac_vf_nxv4f32:
406 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
407 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
408 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
409 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
410 ; ZVFHMIN-NEXT: vfncvt.f.f.w v14, v12
411 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, ta, ma
412 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8, v0.t
413 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v14, v0.t
414 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
415 ; ZVFHMIN-NEXT: vfmsub.vv v8, v12, v10, v0.t
417 %elt.head = insertelement <vscale x 4 x half> poison, half %b, i32 0
418 %vb = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
419 %aext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x i1> %m, i32 %evl)
420 %vbext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
421 %negc = call <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 %evl)
422 %v = call <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float> %aext, <vscale x 4 x float> %vbext, <vscale x 4 x float> %negc, <vscale x 4 x i1> %m, i32 %evl)
423 ret <vscale x 4 x float> %v
426 define <vscale x 4 x float> @vmfsac_vf_nxv4f32_commute(<vscale x 4 x half> %a, half %b, <vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 zeroext %evl) {
427 ; ZVFH-LABEL: vmfsac_vf_nxv4f32_commute:
429 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
430 ; ZVFH-NEXT: vfwmsac.vf v10, fa0, v8, v0.t
431 ; ZVFH-NEXT: vmv2r.v v8, v10
434 ; ZVFHMIN-LABEL: vmfsac_vf_nxv4f32_commute:
436 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
437 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
438 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
439 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
440 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v12
441 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, ta, ma
442 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8, v0.t
443 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v9, v0.t
444 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
445 ; ZVFHMIN-NEXT: vfmsub.vv v12, v14, v10, v0.t
446 ; ZVFHMIN-NEXT: vmv.v.v v8, v12
448 %elt.head = insertelement <vscale x 4 x half> poison, half %b, i32 0
449 %vb = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
450 %aext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x i1> %m, i32 %evl)
451 %vbext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
452 %negc = call <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float> %c, <vscale x 4 x i1> %m, i32 %evl)
453 %v = call <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float> %vbext, <vscale x 4 x float> %aext, <vscale x 4 x float> %negc, <vscale x 4 x i1> %m, i32 %evl)
454 ret <vscale x 4 x float> %v
457 define <vscale x 4 x float> @vmfsac_vf_nxv4f32_unmasked(<vscale x 4 x half> %a, half %b, <vscale x 4 x float> %c, i32 zeroext %evl) {
458 ; ZVFH-LABEL: vmfsac_vf_nxv4f32_unmasked:
460 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
461 ; ZVFH-NEXT: vfwmsac.vf v10, fa0, v8
462 ; ZVFH-NEXT: vmv2r.v v8, v10
465 ; ZVFHMIN-LABEL: vmfsac_vf_nxv4f32_unmasked:
467 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
468 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
469 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
470 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
471 ; ZVFHMIN-NEXT: vfncvt.f.f.w v14, v12
472 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m1, ta, ma
473 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
474 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v14
475 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
476 ; ZVFHMIN-NEXT: vfmsub.vv v8, v12, v10
478 %elt.head = insertelement <vscale x 4 x half> poison, half %b, i32 0
479 %vb = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
480 %aext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
481 %vbext = call <vscale x 4 x float> @llvm.vp.fpext.nxv4f32.nxv4f16(<vscale x 4 x half> %vb, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
482 %negc = call <vscale x 4 x float> @llvm.vp.fneg.nxv4f32(<vscale x 4 x float> %c, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
483 %v = call <vscale x 4 x float> @llvm.vp.fma.nxv4f32(<vscale x 4 x float> %aext, <vscale x 4 x float> %vbext, <vscale x 4 x float> %negc, <vscale x 4 x i1> splat (i1 -1), i32 %evl)
484 ret <vscale x 4 x float> %v
487 declare <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x i1>, i32)
488 declare <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float>, <vscale x 8 x i1>, i32)
489 declare <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half>, <vscale x 8 x i1>, i32)
491 define <vscale x 8 x float> @vmfsac_vv_nxv8f32(<vscale x 8 x half> %a, <vscale x 8 x half> %b, <vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 zeroext %evl) {
492 ; ZVFH-LABEL: vmfsac_vv_nxv8f32:
494 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
495 ; ZVFH-NEXT: vfwmsac.vv v12, v8, v10, v0.t
496 ; ZVFH-NEXT: vmv4r.v v8, v12
499 ; ZVFHMIN-LABEL: vmfsac_vv_nxv8f32:
501 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, ta, ma
502 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v8, v0.t
503 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10, v0.t
504 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
505 ; ZVFHMIN-NEXT: vfmsub.vv v16, v20, v12, v0.t
506 ; ZVFHMIN-NEXT: vmv.v.v v8, v16
508 %aext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x i1> %m, i32 %evl)
509 %bext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %b, <vscale x 8 x i1> %m, i32 %evl)
510 %negc = call <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 %evl)
511 %v = call <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float> %aext, <vscale x 8 x float> %bext, <vscale x 8 x float> %negc, <vscale x 8 x i1> %m, i32 %evl)
512 ret <vscale x 8 x float> %v
515 define <vscale x 8 x float> @vmfsac_vv_nxv8f32_unmasked(<vscale x 8 x half> %a, <vscale x 8 x half> %b, <vscale x 8 x float> %c, i32 zeroext %evl) {
516 ; ZVFH-LABEL: vmfsac_vv_nxv8f32_unmasked:
518 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
519 ; ZVFH-NEXT: vfwmsac.vv v12, v8, v10
520 ; ZVFH-NEXT: vmv4r.v v8, v12
523 ; ZVFHMIN-LABEL: vmfsac_vv_nxv8f32_unmasked:
525 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, ta, ma
526 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v8
527 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
528 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
529 ; ZVFHMIN-NEXT: vfmsub.vv v16, v20, v12
530 ; ZVFHMIN-NEXT: vmv.v.v v8, v16
532 %aext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
533 %bext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %b, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
534 %negc = call <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float> %c, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
535 %v = call <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float> %aext, <vscale x 8 x float> %bext, <vscale x 8 x float> %negc, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
536 ret <vscale x 8 x float> %v
539 define <vscale x 8 x float> @vmfsac_vf_nxv8f32(<vscale x 8 x half> %a, half %b, <vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 zeroext %evl) {
540 ; ZVFH-LABEL: vmfsac_vf_nxv8f32:
542 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
543 ; ZVFH-NEXT: vfwmsac.vf v12, fa0, v8, v0.t
544 ; ZVFH-NEXT: vmv4r.v v8, v12
547 ; ZVFHMIN-LABEL: vmfsac_vf_nxv8f32:
549 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
550 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
551 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
552 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
553 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v16
554 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, ta, ma
555 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8, v0.t
556 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v20, v0.t
557 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
558 ; ZVFHMIN-NEXT: vfmsub.vv v8, v16, v12, v0.t
560 %elt.head = insertelement <vscale x 8 x half> poison, half %b, i32 0
561 %vb = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
562 %aext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x i1> %m, i32 %evl)
563 %vbext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
564 %negc = call <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 %evl)
565 %v = call <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float> %aext, <vscale x 8 x float> %vbext, <vscale x 8 x float> %negc, <vscale x 8 x i1> %m, i32 %evl)
566 ret <vscale x 8 x float> %v
569 define <vscale x 8 x float> @vmfsac_vf_nxv8f32_commute(<vscale x 8 x half> %a, half %b, <vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 zeroext %evl) {
570 ; ZVFH-LABEL: vmfsac_vf_nxv8f32_commute:
572 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
573 ; ZVFH-NEXT: vfwmsac.vf v12, fa0, v8, v0.t
574 ; ZVFH-NEXT: vmv4r.v v8, v12
577 ; ZVFHMIN-LABEL: vmfsac_vf_nxv8f32_commute:
579 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
580 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
581 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
582 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
583 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v16
584 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, ta, ma
585 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8, v0.t
586 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v10, v0.t
587 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
588 ; ZVFHMIN-NEXT: vfmsub.vv v16, v20, v12, v0.t
589 ; ZVFHMIN-NEXT: vmv.v.v v8, v16
591 %elt.head = insertelement <vscale x 8 x half> poison, half %b, i32 0
592 %vb = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
593 %aext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x i1> %m, i32 %evl)
594 %vbext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
595 %negc = call <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float> %c, <vscale x 8 x i1> %m, i32 %evl)
596 %v = call <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float> %vbext, <vscale x 8 x float> %aext, <vscale x 8 x float> %negc, <vscale x 8 x i1> %m, i32 %evl)
597 ret <vscale x 8 x float> %v
600 define <vscale x 8 x float> @vmfsac_vf_nxv8f32_unmasked(<vscale x 8 x half> %a, half %b, <vscale x 8 x float> %c, i32 zeroext %evl) {
601 ; ZVFH-LABEL: vmfsac_vf_nxv8f32_unmasked:
603 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
604 ; ZVFH-NEXT: vfwmsac.vf v12, fa0, v8
605 ; ZVFH-NEXT: vmv4r.v v8, v12
608 ; ZVFHMIN-LABEL: vmfsac_vf_nxv8f32_unmasked:
610 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
611 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
612 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
613 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
614 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v16
615 ; ZVFHMIN-NEXT: vsetvli zero, a0, e16, m2, ta, ma
616 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
617 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v20
618 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
619 ; ZVFHMIN-NEXT: vfmsub.vv v8, v16, v12
621 %elt.head = insertelement <vscale x 8 x half> poison, half %b, i32 0
622 %vb = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
623 %aext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
624 %vbext = call <vscale x 8 x float> @llvm.vp.fpext.nxv8f32.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
625 %negc = call <vscale x 8 x float> @llvm.vp.fneg.nxv8f32(<vscale x 8 x float> %c, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
626 %v = call <vscale x 8 x float> @llvm.vp.fma.nxv8f32(<vscale x 8 x float> %aext, <vscale x 8 x float> %vbext, <vscale x 8 x float> %negc, <vscale x 8 x i1> splat (i1 -1), i32 %evl)
627 ret <vscale x 8 x float> %v