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, 28
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, 0x1c, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 28 * vlenb
354 ; ZVFHMIN-NEXT: csrr a1, vlenb
355 ; ZVFHMIN-NEXT: slli a1, a1, 3
356 ; ZVFHMIN-NEXT: add a1, sp, a1
357 ; ZVFHMIN-NEXT: addi a1, a1, 16
358 ; ZVFHMIN-NEXT: vs8r.v v16, (a1) # Unknown-size Folded Spill
359 ; ZVFHMIN-NEXT: vl8re16.v v24, (a0)
360 ; ZVFHMIN-NEXT: csrr a0, vlenb
361 ; ZVFHMIN-NEXT: li a1, 20
362 ; ZVFHMIN-NEXT: mul a0, a0, a1
363 ; ZVFHMIN-NEXT: add a0, sp, a0
364 ; ZVFHMIN-NEXT: addi a0, a0, 16
365 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
366 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
367 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
368 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
369 ; ZVFHMIN-NEXT: vfneg.v v0, v0
370 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
371 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v0
372 ; ZVFHMIN-NEXT: csrr a0, vlenb
373 ; ZVFHMIN-NEXT: slli a0, a0, 4
374 ; ZVFHMIN-NEXT: add a0, sp, a0
375 ; ZVFHMIN-NEXT: addi a0, a0, 16
376 ; ZVFHMIN-NEXT: vs4r.v v12, (a0) # Unknown-size Folded Spill
377 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
378 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
379 ; ZVFHMIN-NEXT: vfneg.v v0, v0
380 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
381 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v0
382 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
383 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v24
384 ; ZVFHMIN-NEXT: csrr a0, vlenb
385 ; ZVFHMIN-NEXT: li a1, 20
386 ; ZVFHMIN-NEXT: mul a0, a0, a1
387 ; ZVFHMIN-NEXT: add a0, sp, a0
388 ; ZVFHMIN-NEXT: addi a0, a0, 16
389 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
390 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
391 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
392 ; ZVFHMIN-NEXT: vfmacc.vv v8, v0, v16
393 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
394 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v8
395 ; ZVFHMIN-NEXT: csrr a0, vlenb
396 ; ZVFHMIN-NEXT: slli a0, a0, 4
397 ; ZVFHMIN-NEXT: add a0, sp, a0
398 ; ZVFHMIN-NEXT: addi a0, a0, 16
399 ; ZVFHMIN-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
400 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
401 ; ZVFHMIN-NEXT: addi a0, sp, 16
402 ; ZVFHMIN-NEXT: vs8r.v v0, (a0) # Unknown-size Folded Spill
403 ; ZVFHMIN-NEXT: csrr a0, vlenb
404 ; ZVFHMIN-NEXT: slli a0, a0, 3
405 ; ZVFHMIN-NEXT: add a0, sp, a0
406 ; ZVFHMIN-NEXT: addi a0, a0, 16
407 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
408 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
409 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v28
410 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
411 ; ZVFHMIN-NEXT: addi a0, sp, 16
412 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
413 ; ZVFHMIN-NEXT: vfmadd.vv v8, v0, v24
414 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
415 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v8
416 ; ZVFHMIN-NEXT: vmv8r.v v8, v16
417 ; ZVFHMIN-NEXT: csrr a0, vlenb
418 ; ZVFHMIN-NEXT: li a1, 28
419 ; ZVFHMIN-NEXT: mul a0, a0, a1
420 ; ZVFHMIN-NEXT: add sp, sp, a0
421 ; ZVFHMIN-NEXT: addi sp, sp, 16
423 %neg = fneg <vscale x 32 x half> %va
424 %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")
425 ret <vscale x 32 x half> %vd
428 define <vscale x 32 x half> @vfmsub_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) strictfp {
429 ; ZVFH-LABEL: vfmsub_vf_nxv32f16:
431 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
432 ; ZVFH-NEXT: vfmsac.vf v8, fa0, v16
435 ; ZVFHMIN-LABEL: vfmsub_vf_nxv32f16:
437 ; ZVFHMIN-NEXT: addi sp, sp, -16
438 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
439 ; ZVFHMIN-NEXT: csrr a0, vlenb
440 ; ZVFHMIN-NEXT: slli a0, a0, 4
441 ; ZVFHMIN-NEXT: sub sp, sp, a0
442 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x10, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 16 * vlenb
443 ; ZVFHMIN-NEXT: vmv8r.v v24, v16
444 ; ZVFHMIN-NEXT: csrr a0, vlenb
445 ; ZVFHMIN-NEXT: slli a0, a0, 3
446 ; ZVFHMIN-NEXT: add a0, sp, a0
447 ; ZVFHMIN-NEXT: addi a0, a0, 16
448 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
449 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
450 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
451 ; ZVFHMIN-NEXT: vfmv.v.f v0, fa5
452 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
453 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v0
454 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
455 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
456 ; ZVFHMIN-NEXT: vfneg.v v0, v0
457 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
458 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v0
459 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
460 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
461 ; ZVFHMIN-NEXT: vfneg.v v0, v0
462 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
463 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
464 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v24
465 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
466 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
467 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
468 ; ZVFHMIN-NEXT: vfmacc.vv v24, v0, v8
469 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
470 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
471 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
472 ; ZVFHMIN-NEXT: addi a0, sp, 16
473 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
474 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
475 ; ZVFHMIN-NEXT: csrr a0, vlenb
476 ; ZVFHMIN-NEXT: slli a0, a0, 3
477 ; ZVFHMIN-NEXT: add a0, sp, a0
478 ; ZVFHMIN-NEXT: addi a0, a0, 16
479 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
480 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v28
481 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
482 ; ZVFHMIN-NEXT: addi a0, sp, 16
483 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
484 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v24
485 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
486 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
487 ; ZVFHMIN-NEXT: csrr a0, vlenb
488 ; ZVFHMIN-NEXT: slli a0, a0, 4
489 ; ZVFHMIN-NEXT: add sp, sp, a0
490 ; ZVFHMIN-NEXT: addi sp, sp, 16
492 %head = insertelement <vscale x 32 x half> poison, half %c, i32 0
493 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
494 %neg = fneg <vscale x 32 x half> %va
495 %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")
496 ret <vscale x 32 x half> %vd
499 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)
501 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 {
502 ; CHECK-LABEL: vfmsub_vv_nxv1f32:
504 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
505 ; CHECK-NEXT: vfmsub.vv v8, v9, v10
507 %neg = fneg <vscale x 1 x float> %vc
508 %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")
509 ret <vscale x 1 x float> %vd
512 define <vscale x 1 x float> @vfmsub_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) strictfp {
513 ; CHECK-LABEL: vfmsub_vf_nxv1f32:
515 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
516 ; CHECK-NEXT: vfmsub.vf v8, fa0, v9
518 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
519 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
520 %neg = fneg <vscale x 1 x float> %vb
521 %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")
522 ret <vscale x 1 x float> %vd
525 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)
527 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 {
528 ; CHECK-LABEL: vfmsub_vv_nxv2f32:
530 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
531 ; CHECK-NEXT: vfmsub.vv v8, v10, v9
533 %neg = fneg <vscale x 2 x float> %vb
534 %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")
535 ret <vscale x 2 x float> %vd
538 define <vscale x 2 x float> @vfmsub_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) strictfp {
539 ; CHECK-LABEL: vfmsub_vf_nxv2f32:
541 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
542 ; CHECK-NEXT: vfmsac.vf v8, fa0, v9
544 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
545 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
546 %neg = fneg <vscale x 2 x float> %va
547 %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")
548 ret <vscale x 2 x float> %vd
551 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)
553 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 {
554 ; CHECK-LABEL: vfmsub_vv_nxv4f32:
556 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
557 ; CHECK-NEXT: vfmsub.vv v8, v10, v12
559 %neg = fneg <vscale x 4 x float> %vc
560 %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")
561 ret <vscale x 4 x float> %vd
564 define <vscale x 4 x float> @vfmsub_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) strictfp {
565 ; CHECK-LABEL: vfmsub_vf_nxv4f32:
567 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
568 ; CHECK-NEXT: vfmsub.vf v8, fa0, v10
570 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
571 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
572 %neg = fneg <vscale x 4 x float> %vb
573 %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")
574 ret <vscale x 4 x float> %vd
577 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)
579 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 {
580 ; CHECK-LABEL: vfmsub_vv_nxv8f32:
582 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
583 ; CHECK-NEXT: vfmsac.vv v8, v16, v12
585 %neg = fneg <vscale x 8 x float> %va
586 %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")
587 ret <vscale x 8 x float> %vd
590 define <vscale x 8 x float> @vfmsub_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) strictfp {
591 ; CHECK-LABEL: vfmsub_vf_nxv8f32:
593 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
594 ; CHECK-NEXT: vfmsac.vf v8, fa0, v12
596 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
597 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
598 %neg = fneg <vscale x 8 x float> %va
599 %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")
600 ret <vscale x 8 x float> %vd
603 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)
605 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 {
606 ; CHECK-LABEL: vfmsub_vv_nxv16f32:
608 ; CHECK-NEXT: vl8re32.v v24, (a0)
609 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
610 ; CHECK-NEXT: vfmsub.vv v8, v24, v16
612 %neg = fneg <vscale x 16 x float> %vb
613 %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")
614 ret <vscale x 16 x float> %vd
617 define <vscale x 16 x float> @vfmsub_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) strictfp {
618 ; CHECK-LABEL: vfmsub_vf_nxv16f32:
620 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
621 ; CHECK-NEXT: vfmsub.vf v8, fa0, v16
623 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
624 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
625 %neg = fneg <vscale x 16 x float> %vb
626 %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")
627 ret <vscale x 16 x float> %vd
630 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)
632 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 {
633 ; CHECK-LABEL: vfmsub_vv_nxv1f64:
635 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
636 ; CHECK-NEXT: vfmsub.vv v8, v9, v10
638 %neg = fneg <vscale x 1 x double> %vc
639 %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")
640 ret <vscale x 1 x double> %vd
643 define <vscale x 1 x double> @vfmsub_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) strictfp {
644 ; CHECK-LABEL: vfmsub_vf_nxv1f64:
646 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
647 ; CHECK-NEXT: vfmsub.vf v8, fa0, v9
649 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
650 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
651 %neg = fneg <vscale x 1 x double> %vb
652 %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")
653 ret <vscale x 1 x double> %vd
656 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)
658 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 {
659 ; CHECK-LABEL: vfmsub_vv_nxv2f64:
661 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
662 ; CHECK-NEXT: vfmsub.vv v8, v12, v10
664 %neg = fneg <vscale x 2 x double> %vb
665 %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")
666 ret <vscale x 2 x double> %vd
669 define <vscale x 2 x double> @vfmsub_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) strictfp {
670 ; CHECK-LABEL: vfmsub_vf_nxv2f64:
672 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
673 ; CHECK-NEXT: vfmsac.vf v8, fa0, v10
675 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
676 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
677 %neg = fneg <vscale x 2 x double> %va
678 %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")
679 ret <vscale x 2 x double> %vd
682 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)
684 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 {
685 ; CHECK-LABEL: vfmsub_vv_nxv4f64:
687 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
688 ; CHECK-NEXT: vfmsub.vv v8, v12, v16
690 %neg = fneg <vscale x 4 x double> %vc
691 %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")
692 ret <vscale x 4 x double> %vd
695 define <vscale x 4 x double> @vfmsub_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) strictfp {
696 ; CHECK-LABEL: vfmsub_vf_nxv4f64:
698 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
699 ; CHECK-NEXT: vfmsub.vf v8, fa0, v12
701 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
702 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
703 %neg = fneg <vscale x 4 x double> %vb
704 %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")
705 ret <vscale x 4 x double> %vd
708 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)
710 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 {
711 ; CHECK-LABEL: vfmsub_vv_nxv8f64:
713 ; CHECK-NEXT: vl8re64.v v24, (a0)
714 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
715 ; CHECK-NEXT: vfmsac.vv v8, v16, v24
717 %neg = fneg <vscale x 8 x double> %va
718 %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")
719 ret <vscale x 8 x double> %vd
722 define <vscale x 8 x double> @vfmsub_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) strictfp {
723 ; CHECK-LABEL: vfmsub_vf_nxv8f64:
725 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
726 ; CHECK-NEXT: vfmsac.vf v8, fa0, v16
728 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
729 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
730 %neg = fneg <vscale x 8 x double> %va
731 %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")
732 ret <vscale x 8 x double> %vd