1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+m,+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+m,+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
6 ; RUN: llc -mtriple=riscv32 -mattr=+m,+d,+zfhmin,+zvfhmin,+v -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+m,+d,+zfhmin,+zvfhmin,+v -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
11 ; This tests a mix of vfmsac and vfmsub by using different operand orders to
12 ; trigger commuting in TwoAddressInstructionPass.
14 declare <vscale x 1 x half> @llvm.experimental.constrained.fma.nxv1f16(<vscale x 1 x half>, <vscale x 1 x half>, <vscale x 1 x half>, metadata, metadata)
16 define <vscale x 1 x half> @vfmsub_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) strictfp {
17 ; ZVFH-LABEL: vfmsub_vv_nxv1f16:
19 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
20 ; ZVFH-NEXT: vfmsub.vv v8, v9, v10
23 ; ZVFHMIN-LABEL: vfmsub_vv_nxv1f16:
25 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
26 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v10
27 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
28 ; ZVFHMIN-NEXT: vfneg.v v10, v11
29 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
30 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
31 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
32 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
33 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v11
34 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
35 ; ZVFHMIN-NEXT: vfmacc.vv v12, v10, v9
36 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
37 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
39 %neg = fneg <vscale x 1 x half> %vc
40 %vd = call <vscale x 1 x half> @llvm.experimental.constrained.fma.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
41 ret <vscale x 1 x half> %vd
44 define <vscale x 1 x half> @vfmsub_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) strictfp {
45 ; ZVFH-LABEL: vfmsub_vf_nxv1f16:
47 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
48 ; ZVFH-NEXT: vfmsub.vf v8, fa0, v9
51 ; ZVFHMIN-LABEL: vfmsub_vf_nxv1f16:
53 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
54 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
55 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
56 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
57 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
58 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
59 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
60 ; ZVFHMIN-NEXT: vfneg.v v9, v10
61 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
62 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
63 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
64 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
65 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v11
66 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
67 ; ZVFHMIN-NEXT: vfmadd.vv v10, v9, v8
68 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
69 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
71 %head = insertelement <vscale x 1 x half> poison, half %c, i32 0
72 %splat = shufflevector <vscale x 1 x half> %head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
73 %neg = fneg <vscale x 1 x half> %vb
74 %vd = call <vscale x 1 x half> @llvm.experimental.constrained.fma.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %splat, <vscale x 1 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
75 ret <vscale x 1 x half> %vd
78 declare <vscale x 2 x half> @llvm.experimental.constrained.fma.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>, <vscale x 2 x half>, metadata, metadata)
80 define <vscale x 2 x half> @vfmsub_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x half> %vc) strictfp {
81 ; ZVFH-LABEL: vfmsub_vv_nxv2f16:
83 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
84 ; ZVFH-NEXT: vfmsub.vv v8, v10, v9
87 ; ZVFHMIN-LABEL: vfmsub_vv_nxv2f16:
89 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
90 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v9
91 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
92 ; ZVFHMIN-NEXT: vfneg.v v9, v11
93 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
94 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v9
95 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
96 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
97 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v11
98 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
99 ; ZVFHMIN-NEXT: vfmacc.vv v12, v9, v10
100 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
101 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
103 %neg = fneg <vscale x 2 x half> %vb
104 %vd = call <vscale x 2 x half> @llvm.experimental.constrained.fma.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vc, <vscale x 2 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
105 ret <vscale x 2 x half> %vd
108 define <vscale x 2 x half> @vfmsub_vf_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, half %c) strictfp {
109 ; ZVFH-LABEL: vfmsub_vf_nxv2f16:
111 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
112 ; ZVFH-NEXT: vfmsac.vf v8, fa0, v9
115 ; ZVFHMIN-LABEL: vfmsub_vf_nxv2f16:
117 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
118 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m1, ta, ma
119 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
120 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
121 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
122 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
123 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
124 ; ZVFHMIN-NEXT: vfneg.v v8, v10
125 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
126 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v8
127 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
128 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
129 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v11
130 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
131 ; ZVFHMIN-NEXT: vfmadd.vv v10, v8, v9
132 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
133 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
135 %head = insertelement <vscale x 2 x half> poison, half %c, i32 0
136 %splat = shufflevector <vscale x 2 x half> %head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
137 %neg = fneg <vscale x 2 x half> %va
138 %vd = call <vscale x 2 x half> @llvm.experimental.constrained.fma.nxv2f16(<vscale x 2 x half> %vb, <vscale x 2 x half> %splat, <vscale x 2 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
139 ret <vscale x 2 x half> %vd
142 declare <vscale x 4 x half> @llvm.experimental.constrained.fma.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>, <vscale x 4 x half>, metadata, metadata)
144 define <vscale x 4 x half> @vfmsub_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x half> %vc) strictfp {
145 ; ZVFH-LABEL: vfmsub_vv_nxv4f16:
147 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
148 ; ZVFH-NEXT: vfmsub.vv v8, v9, v10
151 ; ZVFHMIN-LABEL: vfmsub_vv_nxv4f16:
153 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
154 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
155 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
156 ; ZVFHMIN-NEXT: vfneg.v v10, v12
157 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
158 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v10
159 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
160 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v9
161 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
162 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
163 ; ZVFHMIN-NEXT: vfmacc.vv v16, v10, v14
164 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
165 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
167 %neg = fneg <vscale x 4 x half> %vc
168 %vd = call <vscale x 4 x half> @llvm.experimental.constrained.fma.nxv4f16(<vscale x 4 x half> %vb, <vscale x 4 x half> %va, <vscale x 4 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
169 ret <vscale x 4 x half> %vd
172 define <vscale x 4 x half> @vfmsub_vf_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, half %c) strictfp {
173 ; ZVFH-LABEL: vfmsub_vf_nxv4f16:
175 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
176 ; ZVFH-NEXT: vfmsub.vf v8, fa0, v9
179 ; ZVFHMIN-LABEL: vfmsub_vf_nxv4f16:
181 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
182 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m2, ta, ma
183 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
184 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
185 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v10
186 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
187 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
188 ; ZVFHMIN-NEXT: vfneg.v v10, v10
189 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
190 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v10
191 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
192 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v9
193 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
194 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
195 ; ZVFHMIN-NEXT: vfmadd.vv v16, v10, v14
196 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
197 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
199 %head = insertelement <vscale x 4 x half> poison, half %c, i32 0
200 %splat = shufflevector <vscale x 4 x half> %head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
201 %neg = fneg <vscale x 4 x half> %vb
202 %vd = call <vscale x 4 x half> @llvm.experimental.constrained.fma.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %splat, <vscale x 4 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
203 ret <vscale x 4 x half> %vd
206 declare <vscale x 8 x half> @llvm.experimental.constrained.fma.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>, metadata, metadata)
208 define <vscale x 8 x half> @vfmsub_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x half> %vc) strictfp {
209 ; ZVFH-LABEL: vfmsub_vv_nxv8f16:
211 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
212 ; ZVFH-NEXT: vfmsac.vv v8, v12, v10
215 ; ZVFHMIN-LABEL: vfmsub_vv_nxv8f16:
217 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
218 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
219 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
220 ; ZVFHMIN-NEXT: vfneg.v v16, v16
221 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
222 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
223 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
224 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
225 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v8
226 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
227 ; ZVFHMIN-NEXT: vfmacc.vv v20, v16, v12
228 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
229 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v20
231 %neg = fneg <vscale x 8 x half> %va
232 %vd = call <vscale x 8 x half> @llvm.experimental.constrained.fma.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %vc, <vscale x 8 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
233 ret <vscale x 8 x half> %vd
236 define <vscale x 8 x half> @vfmsub_vf_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, half %c) strictfp {
237 ; ZVFH-LABEL: vfmsub_vf_nxv8f16:
239 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
240 ; ZVFH-NEXT: vfmsac.vf v8, fa0, v10
243 ; ZVFHMIN-LABEL: vfmsub_vf_nxv8f16:
245 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
246 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m4, ta, ma
247 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
248 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
249 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v12
250 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
251 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
252 ; ZVFHMIN-NEXT: vfneg.v v12, v12
253 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
254 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
255 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
256 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v8
257 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
258 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
259 ; ZVFHMIN-NEXT: vfmadd.vv v24, v12, v20
260 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
261 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
263 %head = insertelement <vscale x 8 x half> poison, half %c, i32 0
264 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
265 %neg = fneg <vscale x 8 x half> %va
266 %vd = call <vscale x 8 x half> @llvm.experimental.constrained.fma.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %splat, <vscale x 8 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
267 ret <vscale x 8 x half> %vd
270 declare <vscale x 16 x half> @llvm.experimental.constrained.fma.nxv16f16(<vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x half>, metadata, metadata)
272 define <vscale x 16 x half> @vfmsub_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x half> %vc) strictfp {
273 ; ZVFH-LABEL: vfmsub_vv_nxv16f16:
275 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
276 ; ZVFH-NEXT: vfmsub.vv v8, v16, v12
279 ; ZVFHMIN-LABEL: vfmsub_vv_nxv16f16:
281 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
282 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
283 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
284 ; ZVFHMIN-NEXT: vfneg.v v24, v24
285 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
286 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
287 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
288 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
289 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
290 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
291 ; ZVFHMIN-NEXT: vfmacc.vv v16, v24, v0
292 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
293 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
295 %neg = fneg <vscale x 16 x half> %vb
296 %vd = call <vscale x 16 x half> @llvm.experimental.constrained.fma.nxv16f16(<vscale x 16 x half> %vc, <vscale x 16 x half> %va, <vscale x 16 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
297 ret <vscale x 16 x half> %vd
300 define <vscale x 16 x half> @vfmsub_vf_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, half %c) strictfp {
301 ; ZVFH-LABEL: vfmsub_vf_nxv16f16:
303 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
304 ; ZVFH-NEXT: vfmsub.vf v8, fa0, v12
307 ; ZVFHMIN-LABEL: vfmsub_vf_nxv16f16:
309 ; ZVFHMIN-NEXT: vmv4r.v v24, v8
310 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
311 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
312 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
313 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
314 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
315 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
316 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
317 ; ZVFHMIN-NEXT: vfneg.v v16, v16
318 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
319 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
320 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
321 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
322 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
323 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
324 ; ZVFHMIN-NEXT: vfmadd.vv v24, v16, v0
325 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
326 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
328 %head = insertelement <vscale x 16 x half> poison, half %c, i32 0
329 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
330 %neg = fneg <vscale x 16 x half> %vb
331 %vd = call <vscale x 16 x half> @llvm.experimental.constrained.fma.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %splat, <vscale x 16 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
332 ret <vscale x 16 x half> %vd
335 declare <vscale x 32 x half> @llvm.experimental.constrained.fma.nxv32f16(<vscale x 32 x half>, <vscale x 32 x half>, <vscale x 32 x half>, metadata, metadata)
337 define <vscale x 32 x half> @vfmsub_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x half> %vc) strictfp {
338 ; ZVFH-LABEL: vfmsub_vv_nxv32f16:
340 ; ZVFH-NEXT: vl8re16.v v24, (a0)
341 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
342 ; ZVFH-NEXT: vfmsac.vv v8, v16, v24
345 ; ZVFHMIN-LABEL: vfmsub_vv_nxv32f16:
347 ; ZVFHMIN-NEXT: addi sp, sp, -16
348 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
349 ; ZVFHMIN-NEXT: csrr a1, vlenb
350 ; ZVFHMIN-NEXT: li a2, 24
351 ; ZVFHMIN-NEXT: mul a1, a1, a2
352 ; ZVFHMIN-NEXT: sub sp, sp, a1
353 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 24 * vlenb
354 ; ZVFHMIN-NEXT: vmv8r.v v24, v16
355 ; ZVFHMIN-NEXT: csrr a1, vlenb
356 ; ZVFHMIN-NEXT: slli a1, a1, 4
357 ; ZVFHMIN-NEXT: add a1, sp, a1
358 ; ZVFHMIN-NEXT: addi a1, a1, 16
359 ; ZVFHMIN-NEXT: vs8r.v v16, (a1) # Unknown-size Folded Spill
360 ; ZVFHMIN-NEXT: vl8re16.v v16, (a0)
361 ; ZVFHMIN-NEXT: csrr a0, vlenb
362 ; ZVFHMIN-NEXT: slli a0, a0, 3
363 ; ZVFHMIN-NEXT: add a0, sp, a0
364 ; ZVFHMIN-NEXT: addi a0, a0, 16
365 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
366 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
367 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
368 ; ZVFHMIN-NEXT: vmv4r.v v20, v12
369 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
370 ; ZVFHMIN-NEXT: vfneg.v v0, v0
371 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
372 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
373 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
374 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v24
375 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
376 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
377 ; ZVFHMIN-NEXT: vfmacc.vv v0, v8, v24
378 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
379 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v20
380 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
381 ; ZVFHMIN-NEXT: vfneg.v v8, v8
382 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
383 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v8
384 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
385 ; ZVFHMIN-NEXT: addi a0, sp, 16
386 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
387 ; ZVFHMIN-NEXT: csrr a0, vlenb
388 ; ZVFHMIN-NEXT: slli a0, a0, 4
389 ; ZVFHMIN-NEXT: add a0, sp, a0
390 ; ZVFHMIN-NEXT: addi a0, a0, 16
391 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
392 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v28
393 ; ZVFHMIN-NEXT: csrr a0, vlenb
394 ; ZVFHMIN-NEXT: slli a0, a0, 3
395 ; ZVFHMIN-NEXT: add a0, sp, a0
396 ; ZVFHMIN-NEXT: addi a0, a0, 16
397 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
398 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
399 ; ZVFHMIN-NEXT: addi a0, sp, 16
400 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
401 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
402 ; ZVFHMIN-NEXT: vfmadd.vv v24, v16, v8
403 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
404 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
405 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
406 ; ZVFHMIN-NEXT: csrr a0, vlenb
407 ; ZVFHMIN-NEXT: li a1, 24
408 ; ZVFHMIN-NEXT: mul a0, a0, a1
409 ; ZVFHMIN-NEXT: add sp, sp, a0
410 ; ZVFHMIN-NEXT: addi sp, sp, 16
412 %neg = fneg <vscale x 32 x half> %va
413 %vd = call <vscale x 32 x half> @llvm.experimental.constrained.fma.nxv32f16(<vscale x 32 x half> %vc, <vscale x 32 x half> %vb, <vscale x 32 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
414 ret <vscale x 32 x half> %vd
417 define <vscale x 32 x half> @vfmsub_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) strictfp {
418 ; ZVFH-LABEL: vfmsub_vf_nxv32f16:
420 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
421 ; ZVFH-NEXT: vfmsac.vf v8, fa0, v16
424 ; ZVFHMIN-LABEL: vfmsub_vf_nxv32f16:
426 ; ZVFHMIN-NEXT: addi sp, sp, -16
427 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
428 ; ZVFHMIN-NEXT: csrr a0, vlenb
429 ; ZVFHMIN-NEXT: li a1, 28
430 ; ZVFHMIN-NEXT: mul a0, a0, a1
431 ; ZVFHMIN-NEXT: sub sp, sp, a0
432 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x1c, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 28 * vlenb
433 ; ZVFHMIN-NEXT: csrr a0, vlenb
434 ; ZVFHMIN-NEXT: li a1, 12
435 ; ZVFHMIN-NEXT: mul a0, a0, a1
436 ; ZVFHMIN-NEXT: add a0, sp, a0
437 ; ZVFHMIN-NEXT: addi a0, a0, 16
438 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
439 ; ZVFHMIN-NEXT: vmv8r.v v24, v8
440 ; ZVFHMIN-NEXT: addi a0, sp, 16
441 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
442 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
443 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
444 ; ZVFHMIN-NEXT: vfmv.v.f v0, fa5
445 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
446 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
447 ; ZVFHMIN-NEXT: csrr a0, vlenb
448 ; ZVFHMIN-NEXT: slli a0, a0, 3
449 ; ZVFHMIN-NEXT: add a0, sp, a0
450 ; ZVFHMIN-NEXT: addi a0, a0, 16
451 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
452 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v24
453 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
454 ; ZVFHMIN-NEXT: vfneg.v v0, v0
455 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
456 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v0
457 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
458 ; ZVFHMIN-NEXT: csrr a0, vlenb
459 ; ZVFHMIN-NEXT: li a1, 20
460 ; ZVFHMIN-NEXT: mul a0, a0, a1
461 ; ZVFHMIN-NEXT: add a0, sp, a0
462 ; ZVFHMIN-NEXT: addi a0, a0, 16
463 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
464 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
465 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
466 ; ZVFHMIN-NEXT: csrr a0, vlenb
467 ; ZVFHMIN-NEXT: li a1, 20
468 ; ZVFHMIN-NEXT: mul a0, a0, a1
469 ; ZVFHMIN-NEXT: add a0, sp, a0
470 ; ZVFHMIN-NEXT: addi a0, a0, 16
471 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
472 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
473 ; ZVFHMIN-NEXT: vfmacc.vv v0, v24, v16
474 ; ZVFHMIN-NEXT: addi a0, sp, 16
475 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
476 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
477 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
478 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
479 ; ZVFHMIN-NEXT: vfneg.v v8, v16
480 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
481 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v8
482 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
483 ; ZVFHMIN-NEXT: csrr a0, vlenb
484 ; ZVFHMIN-NEXT: li a1, 20
485 ; ZVFHMIN-NEXT: mul a0, a0, a1
486 ; ZVFHMIN-NEXT: add a0, sp, a0
487 ; ZVFHMIN-NEXT: addi a0, a0, 16
488 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
489 ; ZVFHMIN-NEXT: csrr a0, vlenb
490 ; ZVFHMIN-NEXT: slli a0, a0, 3
491 ; ZVFHMIN-NEXT: add a0, sp, a0
492 ; ZVFHMIN-NEXT: addi a0, a0, 16
493 ; ZVFHMIN-NEXT: vl4r.v v16, (a0) # Unknown-size Folded Reload
494 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
495 ; ZVFHMIN-NEXT: csrr a0, vlenb
496 ; ZVFHMIN-NEXT: li a1, 12
497 ; ZVFHMIN-NEXT: mul a0, a0, a1
498 ; ZVFHMIN-NEXT: add a0, sp, a0
499 ; ZVFHMIN-NEXT: addi a0, a0, 16
500 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
501 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v28
502 ; ZVFHMIN-NEXT: csrr a0, vlenb
503 ; ZVFHMIN-NEXT: li a1, 20
504 ; ZVFHMIN-NEXT: mul a0, a0, a1
505 ; ZVFHMIN-NEXT: add a0, sp, a0
506 ; ZVFHMIN-NEXT: addi a0, a0, 16
507 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
508 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
509 ; ZVFHMIN-NEXT: vfmadd.vv v16, v8, v24
510 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
511 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
512 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
513 ; ZVFHMIN-NEXT: csrr a0, vlenb
514 ; ZVFHMIN-NEXT: li a1, 28
515 ; ZVFHMIN-NEXT: mul a0, a0, a1
516 ; ZVFHMIN-NEXT: add sp, sp, a0
517 ; ZVFHMIN-NEXT: addi sp, sp, 16
519 %head = insertelement <vscale x 32 x half> poison, half %c, i32 0
520 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
521 %neg = fneg <vscale x 32 x half> %va
522 %vd = call <vscale x 32 x half> @llvm.experimental.constrained.fma.nxv32f16(<vscale x 32 x half> %vb, <vscale x 32 x half> %splat, <vscale x 32 x half> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
523 ret <vscale x 32 x half> %vd
526 declare <vscale x 1 x float> @llvm.experimental.constrained.fma.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x float>, metadata, metadata)
528 define <vscale x 1 x float> @vfmsub_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %vc) strictfp {
529 ; CHECK-LABEL: vfmsub_vv_nxv1f32:
531 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
532 ; CHECK-NEXT: vfmsub.vv v8, v9, v10
534 %neg = fneg <vscale x 1 x float> %vc
535 %vd = call <vscale x 1 x float> @llvm.experimental.constrained.fma.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
536 ret <vscale x 1 x float> %vd
539 define <vscale x 1 x float> @vfmsub_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) strictfp {
540 ; CHECK-LABEL: vfmsub_vf_nxv1f32:
542 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
543 ; CHECK-NEXT: vfmsub.vf v8, fa0, v9
545 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
546 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
547 %neg = fneg <vscale x 1 x float> %vb
548 %vd = call <vscale x 1 x float> @llvm.experimental.constrained.fma.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %splat, <vscale x 1 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
549 ret <vscale x 1 x float> %vd
552 declare <vscale x 2 x float> @llvm.experimental.constrained.fma.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x float>, metadata, metadata)
554 define <vscale x 2 x float> @vfmsub_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x float> %vc) strictfp {
555 ; CHECK-LABEL: vfmsub_vv_nxv2f32:
557 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
558 ; CHECK-NEXT: vfmsub.vv v8, v10, v9
560 %neg = fneg <vscale x 2 x float> %vb
561 %vd = call <vscale x 2 x float> @llvm.experimental.constrained.fma.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vc, <vscale x 2 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
562 ret <vscale x 2 x float> %vd
565 define <vscale x 2 x float> @vfmsub_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) strictfp {
566 ; CHECK-LABEL: vfmsub_vf_nxv2f32:
568 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
569 ; CHECK-NEXT: vfmsac.vf v8, fa0, v9
571 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
572 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
573 %neg = fneg <vscale x 2 x float> %va
574 %vd = call <vscale x 2 x float> @llvm.experimental.constrained.fma.nxv2f32(<vscale x 2 x float> %vb, <vscale x 2 x float> %splat, <vscale x 2 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
575 ret <vscale x 2 x float> %vd
578 declare <vscale x 4 x float> @llvm.experimental.constrained.fma.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>, metadata, metadata)
580 define <vscale x 4 x float> @vfmsub_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x float> %vc) strictfp {
581 ; CHECK-LABEL: vfmsub_vv_nxv4f32:
583 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
584 ; CHECK-NEXT: vfmsub.vv v8, v10, v12
586 %neg = fneg <vscale x 4 x float> %vc
587 %vd = call <vscale x 4 x float> @llvm.experimental.constrained.fma.nxv4f32(<vscale x 4 x float> %vb, <vscale x 4 x float> %va, <vscale x 4 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
588 ret <vscale x 4 x float> %vd
591 define <vscale x 4 x float> @vfmsub_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) strictfp {
592 ; CHECK-LABEL: vfmsub_vf_nxv4f32:
594 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
595 ; CHECK-NEXT: vfmsub.vf v8, fa0, v10
597 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
598 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
599 %neg = fneg <vscale x 4 x float> %vb
600 %vd = call <vscale x 4 x float> @llvm.experimental.constrained.fma.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %splat, <vscale x 4 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
601 ret <vscale x 4 x float> %vd
604 declare <vscale x 8 x float> @llvm.experimental.constrained.fma.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x float>, metadata, metadata)
606 define <vscale x 8 x float> @vfmsub_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x float> %vc) strictfp {
607 ; CHECK-LABEL: vfmsub_vv_nxv8f32:
609 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
610 ; CHECK-NEXT: vfmsac.vv v8, v16, v12
612 %neg = fneg <vscale x 8 x float> %va
613 %vd = call <vscale x 8 x float> @llvm.experimental.constrained.fma.nxv8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %vc, <vscale x 8 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
614 ret <vscale x 8 x float> %vd
617 define <vscale x 8 x float> @vfmsub_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) strictfp {
618 ; CHECK-LABEL: vfmsub_vf_nxv8f32:
620 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
621 ; CHECK-NEXT: vfmsac.vf v8, fa0, v12
623 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
624 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
625 %neg = fneg <vscale x 8 x float> %va
626 %vd = call <vscale x 8 x float> @llvm.experimental.constrained.fma.nxv8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %splat, <vscale x 8 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
627 ret <vscale x 8 x float> %vd
630 declare <vscale x 16 x float> @llvm.experimental.constrained.fma.nxv16f32(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x float>, metadata, metadata)
632 define <vscale x 16 x float> @vfmsub_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x float> %vc) strictfp {
633 ; CHECK-LABEL: vfmsub_vv_nxv16f32:
635 ; CHECK-NEXT: vl8re32.v v24, (a0)
636 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
637 ; CHECK-NEXT: vfmsub.vv v8, v24, v16
639 %neg = fneg <vscale x 16 x float> %vb
640 %vd = call <vscale x 16 x float> @llvm.experimental.constrained.fma.nxv16f32(<vscale x 16 x float> %vc, <vscale x 16 x float> %va, <vscale x 16 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
641 ret <vscale x 16 x float> %vd
644 define <vscale x 16 x float> @vfmsub_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) strictfp {
645 ; CHECK-LABEL: vfmsub_vf_nxv16f32:
647 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
648 ; CHECK-NEXT: vfmsub.vf v8, fa0, v16
650 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
651 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
652 %neg = fneg <vscale x 16 x float> %vb
653 %vd = call <vscale x 16 x float> @llvm.experimental.constrained.fma.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %splat, <vscale x 16 x float> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
654 ret <vscale x 16 x float> %vd
657 declare <vscale x 1 x double> @llvm.experimental.constrained.fma.nxv1f64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x double>, metadata, metadata)
659 define <vscale x 1 x double> @vfmsub_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %vc) strictfp {
660 ; CHECK-LABEL: vfmsub_vv_nxv1f64:
662 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
663 ; CHECK-NEXT: vfmsub.vv v8, v9, v10
665 %neg = fneg <vscale x 1 x double> %vc
666 %vd = call <vscale x 1 x double> @llvm.experimental.constrained.fma.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
667 ret <vscale x 1 x double> %vd
670 define <vscale x 1 x double> @vfmsub_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) strictfp {
671 ; CHECK-LABEL: vfmsub_vf_nxv1f64:
673 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
674 ; CHECK-NEXT: vfmsub.vf v8, fa0, v9
676 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
677 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
678 %neg = fneg <vscale x 1 x double> %vb
679 %vd = call <vscale x 1 x double> @llvm.experimental.constrained.fma.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %splat, <vscale x 1 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
680 ret <vscale x 1 x double> %vd
683 declare <vscale x 2 x double> @llvm.experimental.constrained.fma.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>, metadata, metadata)
685 define <vscale x 2 x double> @vfmsub_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x double> %vc) strictfp {
686 ; CHECK-LABEL: vfmsub_vv_nxv2f64:
688 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
689 ; CHECK-NEXT: vfmsub.vv v8, v12, v10
691 %neg = fneg <vscale x 2 x double> %vb
692 %vd = call <vscale x 2 x double> @llvm.experimental.constrained.fma.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vc, <vscale x 2 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
693 ret <vscale x 2 x double> %vd
696 define <vscale x 2 x double> @vfmsub_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) strictfp {
697 ; CHECK-LABEL: vfmsub_vf_nxv2f64:
699 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
700 ; CHECK-NEXT: vfmsac.vf v8, fa0, v10
702 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
703 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
704 %neg = fneg <vscale x 2 x double> %va
705 %vd = call <vscale x 2 x double> @llvm.experimental.constrained.fma.nxv2f64(<vscale x 2 x double> %vb, <vscale x 2 x double> %splat, <vscale x 2 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
706 ret <vscale x 2 x double> %vd
709 declare <vscale x 4 x double> @llvm.experimental.constrained.fma.nxv4f64(<vscale x 4 x double>, <vscale x 4 x double>, <vscale x 4 x double>, metadata, metadata)
711 define <vscale x 4 x double> @vfmsub_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x double> %vc) strictfp {
712 ; CHECK-LABEL: vfmsub_vv_nxv4f64:
714 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
715 ; CHECK-NEXT: vfmsub.vv v8, v12, v16
717 %neg = fneg <vscale x 4 x double> %vc
718 %vd = call <vscale x 4 x double> @llvm.experimental.constrained.fma.nxv4f64(<vscale x 4 x double> %vb, <vscale x 4 x double> %va, <vscale x 4 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
719 ret <vscale x 4 x double> %vd
722 define <vscale x 4 x double> @vfmsub_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) strictfp {
723 ; CHECK-LABEL: vfmsub_vf_nxv4f64:
725 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
726 ; CHECK-NEXT: vfmsub.vf v8, fa0, v12
728 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
729 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
730 %neg = fneg <vscale x 4 x double> %vb
731 %vd = call <vscale x 4 x double> @llvm.experimental.constrained.fma.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %splat, <vscale x 4 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
732 ret <vscale x 4 x double> %vd
735 declare <vscale x 8 x double> @llvm.experimental.constrained.fma.nxv8f64(<vscale x 8 x double>, <vscale x 8 x double>, <vscale x 8 x double>, metadata, metadata)
737 define <vscale x 8 x double> @vfmsub_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x double> %vc) strictfp {
738 ; CHECK-LABEL: vfmsub_vv_nxv8f64:
740 ; CHECK-NEXT: vl8re64.v v24, (a0)
741 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
742 ; CHECK-NEXT: vfmsac.vv v8, v16, v24
744 %neg = fneg <vscale x 8 x double> %va
745 %vd = call <vscale x 8 x double> @llvm.experimental.constrained.fma.nxv8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %vc, <vscale x 8 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
746 ret <vscale x 8 x double> %vd
749 define <vscale x 8 x double> @vfmsub_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) strictfp {
750 ; CHECK-LABEL: vfmsub_vf_nxv8f64:
752 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
753 ; CHECK-NEXT: vfmsac.vf v8, fa0, v16
755 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
756 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
757 %neg = fneg <vscale x 8 x double> %va
758 %vd = call <vscale x 8 x double> @llvm.experimental.constrained.fma.nxv8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %splat, <vscale x 8 x double> %neg, metadata !"round.dynamic", metadata !"fpexcept.strict")
759 ret <vscale x 8 x double> %vd