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 vfnmsac and vfnmsub 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> @vfnmsub_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) strictfp {
17 ; ZVFH-LABEL: vfnmsub_vv_nxv1f16:
19 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
20 ; ZVFH-NEXT: vfnmsub.vv v8, v9, v10
23 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv1f16:
25 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
26 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
27 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
28 ; ZVFHMIN-NEXT: vfneg.v v8, v11
29 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
30 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v8
31 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
32 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
33 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v11
34 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
35 ; ZVFHMIN-NEXT: vfmadd.vv v9, v10, v8
36 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
37 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
39 %neg = fneg <vscale x 1 x half> %va
40 %vd = call <vscale x 1 x half> @llvm.experimental.constrained.fma.nxv1f16(<vscale x 1 x half> %neg, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
41 ret <vscale x 1 x half> %vd
44 define <vscale x 1 x half> @vfnmsub_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) strictfp {
45 ; ZVFH-LABEL: vfnmsub_vf_nxv1f16:
47 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
48 ; ZVFH-NEXT: vfnmsub.vf v8, fa0, v9
51 ; ZVFHMIN-LABEL: vfnmsub_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, v8
59 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
60 ; ZVFHMIN-NEXT: vfneg.v v8, v10
61 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
62 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v8
63 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
64 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v11
65 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v10
66 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
67 ; ZVFHMIN-NEXT: vfmadd.vv v11, v9, v8
68 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
69 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v11
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> %va
74 %vd = call <vscale x 1 x half> @llvm.experimental.constrained.fma.nxv1f16(<vscale x 1 x half> %neg, <vscale x 1 x half> %splat, <vscale x 1 x half> %vb, 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> @vfnmsub_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x half> %vc) strictfp {
81 ; ZVFH-LABEL: vfnmsub_vv_nxv2f16:
83 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
84 ; ZVFH-NEXT: vfnmsub.vv v8, v10, v9
87 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv2f16:
89 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
90 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
91 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
92 ; ZVFHMIN-NEXT: vfneg.v v8, v11
93 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
94 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v8
95 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
96 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
97 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v11
98 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
99 ; ZVFHMIN-NEXT: vfmadd.vv v10, v9, v8
100 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
101 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
103 %neg = fneg <vscale x 2 x half> %va
104 %vd = call <vscale x 2 x half> @llvm.experimental.constrained.fma.nxv2f16(<vscale x 2 x half> %neg, <vscale x 2 x half> %vc, <vscale x 2 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
105 ret <vscale x 2 x half> %vd
108 define <vscale x 2 x half> @vfnmsub_vf_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, half %c) strictfp {
109 ; ZVFH-LABEL: vfnmsub_vf_nxv2f16:
111 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
112 ; ZVFH-NEXT: vfnmsub.vf v8, fa0, v9
115 ; ZVFHMIN-LABEL: vfnmsub_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, v9, v8
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> %splat, <vscale x 2 x half> %neg, <vscale x 2 x half> %vb, 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> @vfnmsub_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x half> %vc) strictfp {
145 ; ZVFH-LABEL: vfnmsub_vv_nxv4f16:
147 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
148 ; ZVFH-NEXT: vfnmsub.vv v8, v9, v10
151 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv4f16:
153 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
154 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
155 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
156 ; ZVFHMIN-NEXT: vfneg.v v12, v12
157 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
158 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v12
159 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
160 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
161 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v9
162 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
163 ; ZVFHMIN-NEXT: vfmadd.vv v14, v10, v12
164 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
165 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v14
167 %neg = fneg <vscale x 4 x half> %vb
168 %vd = call <vscale x 4 x half> @llvm.experimental.constrained.fma.nxv4f16(<vscale x 4 x half> %neg, <vscale x 4 x half> %va, <vscale x 4 x half> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
169 ret <vscale x 4 x half> %vd
172 define <vscale x 4 x half> @vfnmsub_vf_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, half %c) strictfp {
173 ; ZVFH-LABEL: vfnmsub_vf_nxv4f16:
175 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
176 ; ZVFH-NEXT: vfnmsub.vf v8, fa0, v9
179 ; ZVFHMIN-LABEL: vfnmsub_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, v12
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 v12, v10
191 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
192 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8
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, v14, v10
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> %splat
202 %vd = call <vscale x 4 x half> @llvm.experimental.constrained.fma.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %neg, <vscale x 4 x half> %vb, 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> @vfnmsub_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x half> %vc) strictfp {
209 ; ZVFH-LABEL: vfnmsub_vv_nxv8f16:
211 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
212 ; ZVFH-NEXT: vfnmsac.vv v8, v12, v10
215 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv8f16:
217 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
218 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
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 v10, v16
223 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
224 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v12
225 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
226 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
227 ; ZVFHMIN-NEXT: vfmadd.vv v12, v20, v16
228 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
229 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
231 %neg = fneg <vscale x 8 x half> %vb
232 %vd = call <vscale x 8 x half> @llvm.experimental.constrained.fma.nxv8f16(<vscale x 8 x half> %neg, <vscale x 8 x half> %vc, <vscale x 8 x half> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
233 ret <vscale x 8 x half> %vd
236 define <vscale x 8 x half> @vfnmsub_vf_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, half %c) strictfp {
237 ; ZVFH-LABEL: vfnmsub_vf_nxv8f16:
239 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
240 ; ZVFH-NEXT: vfnmsac.vf v8, fa0, v10
243 ; ZVFHMIN-LABEL: vfnmsub_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, v16
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 v16, v12
255 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
256 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v10
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, v20, v12
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> %splat
266 %vd = call <vscale x 8 x half> @llvm.experimental.constrained.fma.nxv8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %neg, <vscale x 8 x half> %va, 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> @vfnmsub_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x half> %vc) strictfp {
273 ; ZVFH-LABEL: vfnmsub_vv_nxv16f16:
275 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
276 ; ZVFH-NEXT: vfnmsub.vv v8, v16, v12
279 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv16f16:
281 ; ZVFHMIN-NEXT: addi sp, sp, -16
282 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
283 ; ZVFHMIN-NEXT: csrr a0, vlenb
284 ; ZVFHMIN-NEXT: slli a0, a0, 2
285 ; ZVFHMIN-NEXT: sub sp, sp, a0
286 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb
287 ; ZVFHMIN-NEXT: vmv4r.v v0, v12
288 ; ZVFHMIN-NEXT: addi a0, sp, 16
289 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
290 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
291 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
292 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
293 ; ZVFHMIN-NEXT: vfneg.v v16, v24
294 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
295 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
296 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v0
297 ; ZVFHMIN-NEXT: addi a0, sp, 16
298 ; ZVFHMIN-NEXT: vl4r.v v16, (a0) # Unknown-size Folded Reload
299 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
300 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
301 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
302 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v8
303 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
304 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
305 ; ZVFHMIN-NEXT: csrr a0, vlenb
306 ; ZVFHMIN-NEXT: slli a0, a0, 2
307 ; ZVFHMIN-NEXT: add sp, sp, a0
308 ; ZVFHMIN-NEXT: addi sp, sp, 16
310 %neg = fneg <vscale x 16 x half> %vc
311 %vd = call <vscale x 16 x half> @llvm.experimental.constrained.fma.nxv16f16(<vscale x 16 x half> %neg, <vscale x 16 x half> %va, <vscale x 16 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
312 ret <vscale x 16 x half> %vd
315 define <vscale x 16 x half> @vfnmsub_vf_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, half %c) strictfp {
316 ; ZVFH-LABEL: vfnmsub_vf_nxv16f16:
318 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
319 ; ZVFH-NEXT: vfnmsub.vf v8, fa0, v12
322 ; ZVFHMIN-LABEL: vfnmsub_vf_nxv16f16:
324 ; ZVFHMIN-NEXT: addi sp, sp, -16
325 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
326 ; ZVFHMIN-NEXT: csrr a0, vlenb
327 ; ZVFHMIN-NEXT: slli a0, a0, 2
328 ; ZVFHMIN-NEXT: sub sp, sp, a0
329 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb
330 ; ZVFHMIN-NEXT: vmv4r.v v28, v12
331 ; ZVFHMIN-NEXT: addi a0, sp, 16
332 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
333 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
334 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
335 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
336 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
337 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
338 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
339 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
340 ; ZVFHMIN-NEXT: vfneg.v v16, v16
341 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
342 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
343 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v28
344 ; ZVFHMIN-NEXT: addi a0, sp, 16
345 ; ZVFHMIN-NEXT: vl4r.v v16, (a0) # Unknown-size Folded Reload
346 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
347 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
348 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
349 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v8
350 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
351 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
352 ; ZVFHMIN-NEXT: csrr a0, vlenb
353 ; ZVFHMIN-NEXT: slli a0, a0, 2
354 ; ZVFHMIN-NEXT: add sp, sp, a0
355 ; ZVFHMIN-NEXT: addi sp, sp, 16
357 %head = insertelement <vscale x 16 x half> poison, half %c, i32 0
358 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
359 %neg = fneg <vscale x 16 x half> %splat
360 %vd = call <vscale x 16 x half> @llvm.experimental.constrained.fma.nxv16f16(<vscale x 16 x half> %neg, <vscale x 16 x half> %va, <vscale x 16 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
361 ret <vscale x 16 x half> %vd
364 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)
366 define <vscale x 32 x half> @vfnmsub_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x half> %vc) strictfp {
367 ; ZVFH-LABEL: vfnmsub_vv_nxv32f16:
369 ; ZVFH-NEXT: vl8re16.v v24, (a0)
370 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
371 ; ZVFH-NEXT: vfnmsub.vv v8, v24, v16
374 ; ZVFHMIN-LABEL: vfnmsub_vv_nxv32f16:
376 ; ZVFHMIN-NEXT: addi sp, sp, -16
377 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
378 ; ZVFHMIN-NEXT: csrr a1, vlenb
379 ; ZVFHMIN-NEXT: li a2, 28
380 ; ZVFHMIN-NEXT: mul a1, a1, a2
381 ; ZVFHMIN-NEXT: sub sp, sp, a1
382 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x1c, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 28 * vlenb
383 ; ZVFHMIN-NEXT: vl8re16.v v0, (a0)
384 ; ZVFHMIN-NEXT: addi a0, sp, 16
385 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
386 ; ZVFHMIN-NEXT: csrr a0, vlenb
387 ; ZVFHMIN-NEXT: slli a0, a0, 4
388 ; ZVFHMIN-NEXT: add a0, sp, a0
389 ; ZVFHMIN-NEXT: addi a0, a0, 16
390 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
391 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
392 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v4
393 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
394 ; ZVFHMIN-NEXT: vfneg.v v24, v24
395 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
396 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
397 ; ZVFHMIN-NEXT: csrr a0, vlenb
398 ; ZVFHMIN-NEXT: li a1, 24
399 ; ZVFHMIN-NEXT: mul a0, a0, a1
400 ; ZVFHMIN-NEXT: add a0, sp, a0
401 ; ZVFHMIN-NEXT: addi a0, a0, 16
402 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
403 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v0
404 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
405 ; ZVFHMIN-NEXT: vfneg.v v24, v24
406 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
407 ; ZVFHMIN-NEXT: vfncvt.f.f.w v0, v24
408 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
409 ; ZVFHMIN-NEXT: csrr a0, vlenb
410 ; ZVFHMIN-NEXT: slli a0, a0, 3
411 ; ZVFHMIN-NEXT: add a0, sp, a0
412 ; ZVFHMIN-NEXT: addi a0, a0, 16
413 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
414 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v0
415 ; ZVFHMIN-NEXT: csrr a0, vlenb
416 ; ZVFHMIN-NEXT: slli a0, a0, 4
417 ; ZVFHMIN-NEXT: add a0, sp, a0
418 ; ZVFHMIN-NEXT: addi a0, a0, 16
419 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
420 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
421 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
422 ; ZVFHMIN-NEXT: csrr a0, vlenb
423 ; ZVFHMIN-NEXT: slli a0, a0, 3
424 ; ZVFHMIN-NEXT: add a0, sp, a0
425 ; ZVFHMIN-NEXT: addi a0, a0, 16
426 ; ZVFHMIN-NEXT: vl8r.v v0, (a0) # Unknown-size Folded Reload
427 ; ZVFHMIN-NEXT: vfmadd.vv v8, v16, v0
428 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
429 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v8
430 ; ZVFHMIN-NEXT: addi a0, sp, 16
431 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
432 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
433 ; ZVFHMIN-NEXT: csrr a0, vlenb
434 ; ZVFHMIN-NEXT: slli a0, a0, 3
435 ; ZVFHMIN-NEXT: add a0, sp, a0
436 ; ZVFHMIN-NEXT: addi a0, a0, 16
437 ; ZVFHMIN-NEXT: vs8r.v v0, (a0) # Unknown-size Folded Spill
438 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v28
439 ; ZVFHMIN-NEXT: csrr a0, vlenb
440 ; ZVFHMIN-NEXT: li a1, 24
441 ; ZVFHMIN-NEXT: mul a0, a0, a1
442 ; ZVFHMIN-NEXT: add a0, sp, a0
443 ; ZVFHMIN-NEXT: addi a0, a0, 16
444 ; ZVFHMIN-NEXT: vl4r.v v20, (a0) # Unknown-size Folded Reload
445 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v20
446 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
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: vl8r.v v24, (a0) # Unknown-size Folded Reload
452 ; ZVFHMIN-NEXT: vfmadd.vv v8, v0, v24
453 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
454 ; ZVFHMIN-NEXT: vfncvt.f.f.w v20, v8
455 ; ZVFHMIN-NEXT: vmv8r.v v8, v16
456 ; ZVFHMIN-NEXT: csrr a0, vlenb
457 ; ZVFHMIN-NEXT: li a1, 28
458 ; ZVFHMIN-NEXT: mul a0, a0, a1
459 ; ZVFHMIN-NEXT: add sp, sp, a0
460 ; ZVFHMIN-NEXT: addi sp, sp, 16
462 %neg = fneg <vscale x 32 x half> %vc
463 %vd = call <vscale x 32 x half> @llvm.experimental.constrained.fma.nxv32f16(<vscale x 32 x half> %neg, <vscale x 32 x half> %va, <vscale x 32 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
464 ret <vscale x 32 x half> %vd
467 define <vscale x 32 x half> @vfnmsub_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) strictfp {
468 ; ZVFH-LABEL: vfnmsub_vf_nxv32f16:
470 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
471 ; ZVFH-NEXT: vfnmsac.vf v8, fa0, v16
474 ; ZVFHMIN-LABEL: vfnmsub_vf_nxv32f16:
476 ; ZVFHMIN-NEXT: addi sp, sp, -16
477 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
478 ; ZVFHMIN-NEXT: csrr a0, vlenb
479 ; ZVFHMIN-NEXT: li a1, 24
480 ; ZVFHMIN-NEXT: mul a0, a0, a1
481 ; ZVFHMIN-NEXT: sub sp, sp, a0
482 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 24 * vlenb
483 ; ZVFHMIN-NEXT: vmv8r.v v24, v8
484 ; ZVFHMIN-NEXT: csrr a0, vlenb
485 ; ZVFHMIN-NEXT: slli a0, a0, 4
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: fcvt.s.h fa5, fa0
490 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
491 ; ZVFHMIN-NEXT: vfmv.v.f v8, fa5
492 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
493 ; ZVFHMIN-NEXT: vfncvt.f.f.w v0, v8
494 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v0
495 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
496 ; ZVFHMIN-NEXT: vfneg.v v0, v8
497 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
498 ; ZVFHMIN-NEXT: vfncvt.f.f.w v28, v0
499 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v24
500 ; ZVFHMIN-NEXT: csrr a0, vlenb
501 ; ZVFHMIN-NEXT: slli a0, a0, 3
502 ; ZVFHMIN-NEXT: add a0, sp, a0
503 ; ZVFHMIN-NEXT: addi a0, a0, 16
504 ; ZVFHMIN-NEXT: vs8r.v v0, (a0) # Unknown-size Folded Spill
505 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
506 ; ZVFHMIN-NEXT: addi a0, sp, 16
507 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
508 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v28
509 ; ZVFHMIN-NEXT: vmv.v.v v16, v28
510 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
511 ; ZVFHMIN-NEXT: csrr a0, vlenb
512 ; ZVFHMIN-NEXT: slli a0, a0, 3
513 ; ZVFHMIN-NEXT: add a0, sp, a0
514 ; ZVFHMIN-NEXT: addi a0, a0, 16
515 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
516 ; ZVFHMIN-NEXT: addi a0, sp, 16
517 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
518 ; ZVFHMIN-NEXT: vfmadd.vv v0, v8, v24
519 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
520 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
521 ; ZVFHMIN-NEXT: csrr a0, vlenb
522 ; ZVFHMIN-NEXT: slli a0, a0, 4
523 ; ZVFHMIN-NEXT: add a0, sp, a0
524 ; ZVFHMIN-NEXT: addi a0, a0, 16
525 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
526 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v28
527 ; ZVFHMIN-NEXT: csrr a0, vlenb
528 ; ZVFHMIN-NEXT: slli a0, a0, 3
529 ; ZVFHMIN-NEXT: add a0, sp, a0
530 ; ZVFHMIN-NEXT: addi a0, a0, 16
531 ; ZVFHMIN-NEXT: vs8r.v v0, (a0) # Unknown-size Folded Spill
532 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
533 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
534 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
535 ; ZVFHMIN-NEXT: csrr a0, vlenb
536 ; ZVFHMIN-NEXT: slli a0, a0, 3
537 ; ZVFHMIN-NEXT: add a0, sp, a0
538 ; ZVFHMIN-NEXT: addi a0, a0, 16
539 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
540 ; ZVFHMIN-NEXT: vfmadd.vv v0, v24, v16
541 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
542 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v0
543 ; ZVFHMIN-NEXT: csrr a0, vlenb
544 ; ZVFHMIN-NEXT: li a1, 24
545 ; ZVFHMIN-NEXT: mul a0, a0, a1
546 ; ZVFHMIN-NEXT: add sp, sp, a0
547 ; ZVFHMIN-NEXT: addi sp, sp, 16
549 %head = insertelement <vscale x 32 x half> poison, half %c, i32 0
550 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
551 %neg = fneg <vscale x 32 x half> %splat
552 %vd = call <vscale x 32 x half> @llvm.experimental.constrained.fma.nxv32f16(<vscale x 32 x half> %neg, <vscale x 32 x half> %vb, <vscale x 32 x half> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
553 ret <vscale x 32 x half> %vd
556 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)
558 define <vscale x 1 x float> @vfnmsub_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %vc) strictfp {
559 ; CHECK-LABEL: vfnmsub_vv_nxv1f32:
561 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
562 ; CHECK-NEXT: vfnmsub.vv v8, v9, v10
564 %neg = fneg <vscale x 1 x float> %vb
565 %vd = call <vscale x 1 x float> @llvm.experimental.constrained.fma.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %neg, <vscale x 1 x float> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
566 ret <vscale x 1 x float> %vd
569 define <vscale x 1 x float> @vfnmsub_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) strictfp {
570 ; CHECK-LABEL: vfnmsub_vf_nxv1f32:
572 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
573 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
575 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
576 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
577 %neg = fneg <vscale x 1 x float> %va
578 %vd = call <vscale x 1 x float> @llvm.experimental.constrained.fma.nxv1f32(<vscale x 1 x float> %neg, <vscale x 1 x float> %splat, <vscale x 1 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
579 ret <vscale x 1 x float> %vd
582 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)
584 define <vscale x 2 x float> @vfnmsub_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x float> %vc) strictfp {
585 ; CHECK-LABEL: vfnmsub_vv_nxv2f32:
587 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
588 ; CHECK-NEXT: vfnmsub.vv v8, v10, v9
590 %neg = fneg <vscale x 2 x float> %vc
591 %vd = call <vscale x 2 x float> @llvm.experimental.constrained.fma.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %neg, <vscale x 2 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
592 ret <vscale x 2 x float> %vd
595 define <vscale x 2 x float> @vfnmsub_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) strictfp {
596 ; CHECK-LABEL: vfnmsub_vf_nxv2f32:
598 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
599 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
601 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
602 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
603 %neg = fneg <vscale x 2 x float> %va
604 %vd = call <vscale x 2 x float> @llvm.experimental.constrained.fma.nxv2f32(<vscale x 2 x float> %splat, <vscale x 2 x float> %neg, <vscale x 2 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
605 ret <vscale x 2 x float> %vd
608 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)
610 define <vscale x 4 x float> @vfnmsub_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x float> %vc) strictfp {
611 ; CHECK-LABEL: vfnmsub_vv_nxv4f32:
613 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
614 ; CHECK-NEXT: vfnmsub.vv v8, v10, v12
616 %neg = fneg <vscale x 4 x float> %va
617 %vd = call <vscale x 4 x float> @llvm.experimental.constrained.fma.nxv4f32(<vscale x 4 x float> %vb, <vscale x 4 x float> %neg, <vscale x 4 x float> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
618 ret <vscale x 4 x float> %vd
621 define <vscale x 4 x float> @vfnmsub_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) strictfp {
622 ; CHECK-LABEL: vfnmsub_vf_nxv4f32:
624 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
625 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v10
627 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
628 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
629 %neg = fneg <vscale x 4 x float> %splat
630 %vd = call <vscale x 4 x float> @llvm.experimental.constrained.fma.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %neg, <vscale x 4 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
631 ret <vscale x 4 x float> %vd
634 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)
636 define <vscale x 8 x float> @vfnmsub_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x float> %vc) strictfp {
637 ; CHECK-LABEL: vfnmsub_vv_nxv8f32:
639 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
640 ; CHECK-NEXT: vfnmsac.vv v8, v16, v12
642 %neg = fneg <vscale x 8 x float> %vc
643 %vd = call <vscale x 8 x float> @llvm.experimental.constrained.fma.nxv8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %neg, <vscale x 8 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
644 ret <vscale x 8 x float> %vd
647 define <vscale x 8 x float> @vfnmsub_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) strictfp {
648 ; CHECK-LABEL: vfnmsub_vf_nxv8f32:
650 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
651 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v12
653 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
654 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
655 %neg = fneg <vscale x 8 x float> %splat
656 %vd = call <vscale x 8 x float> @llvm.experimental.constrained.fma.nxv8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %neg, <vscale x 8 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
657 ret <vscale x 8 x float> %vd
660 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)
662 define <vscale x 16 x float> @vfnmsub_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x float> %vc) strictfp {
663 ; CHECK-LABEL: vfnmsub_vv_nxv16f32:
665 ; CHECK-NEXT: vl8re32.v v24, (a0)
666 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
667 ; CHECK-NEXT: vfnmsub.vv v8, v24, v16
669 %neg = fneg <vscale x 16 x float> %va
670 %vd = call <vscale x 16 x float> @llvm.experimental.constrained.fma.nxv16f32(<vscale x 16 x float> %vc, <vscale x 16 x float> %neg, <vscale x 16 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
671 ret <vscale x 16 x float> %vd
674 define <vscale x 16 x float> @vfnmsub_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) strictfp {
675 ; CHECK-LABEL: vfnmsub_vf_nxv16f32:
677 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
678 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v16
680 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
681 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
682 %neg = fneg <vscale x 16 x float> %splat
683 %vd = call <vscale x 16 x float> @llvm.experimental.constrained.fma.nxv16f32(<vscale x 16 x float> %neg, <vscale x 16 x float> %va, <vscale x 16 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
684 ret <vscale x 16 x float> %vd
687 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)
689 define <vscale x 1 x double> @vfnmsub_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %vc) strictfp {
690 ; CHECK-LABEL: vfnmsub_vv_nxv1f64:
692 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
693 ; CHECK-NEXT: vfnmsac.vv v8, v10, v9
695 %neg = fneg <vscale x 1 x double> %vb
696 %vd = call <vscale x 1 x double> @llvm.experimental.constrained.fma.nxv1f64(<vscale x 1 x double> %vc, <vscale x 1 x double> %neg, <vscale x 1 x double> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
697 ret <vscale x 1 x double> %vd
700 define <vscale x 1 x double> @vfnmsub_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) strictfp {
701 ; CHECK-LABEL: vfnmsub_vf_nxv1f64:
703 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
704 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v9
706 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
707 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
708 %neg = fneg <vscale x 1 x double> %va
709 %vd = call <vscale x 1 x double> @llvm.experimental.constrained.fma.nxv1f64(<vscale x 1 x double> %neg, <vscale x 1 x double> %splat, <vscale x 1 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
710 ret <vscale x 1 x double> %vd
713 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)
715 define <vscale x 2 x double> @vfnmsub_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x double> %vc) strictfp {
716 ; CHECK-LABEL: vfnmsub_vv_nxv2f64:
718 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
719 ; CHECK-NEXT: vfnmsub.vv v8, v12, v10
721 %neg = fneg <vscale x 2 x double> %va
722 %vd = call <vscale x 2 x double> @llvm.experimental.constrained.fma.nxv2f64(<vscale x 2 x double> %neg, <vscale x 2 x double> %vc, <vscale x 2 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
723 ret <vscale x 2 x double> %vd
726 define <vscale x 2 x double> @vfnmsub_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) strictfp {
727 ; CHECK-LABEL: vfnmsub_vf_nxv2f64:
729 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
730 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v10
732 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
733 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
734 %neg = fneg <vscale x 2 x double> %va
735 %vd = call <vscale x 2 x double> @llvm.experimental.constrained.fma.nxv2f64(<vscale x 2 x double> %splat, <vscale x 2 x double> %neg, <vscale x 2 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
736 ret <vscale x 2 x double> %vd
739 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)
741 define <vscale x 4 x double> @vfnmsub_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x double> %vc) strictfp {
742 ; CHECK-LABEL: vfnmsub_vv_nxv4f64:
744 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
745 ; CHECK-NEXT: vfnmsub.vv v8, v12, v16
747 %neg = fneg <vscale x 4 x double> %vb
748 %vd = call <vscale x 4 x double> @llvm.experimental.constrained.fma.nxv4f64(<vscale x 4 x double> %neg, <vscale x 4 x double> %va, <vscale x 4 x double> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
749 ret <vscale x 4 x double> %vd
752 define <vscale x 4 x double> @vfnmsub_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) strictfp {
753 ; CHECK-LABEL: vfnmsub_vf_nxv4f64:
755 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
756 ; CHECK-NEXT: vfnmsub.vf v8, fa0, v12
758 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
759 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
760 %neg = fneg <vscale x 4 x double> %splat
761 %vd = call <vscale x 4 x double> @llvm.experimental.constrained.fma.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %neg, <vscale x 4 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
762 ret <vscale x 4 x double> %vd
765 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)
767 define <vscale x 8 x double> @vfnmsub_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x double> %vc) strictfp {
768 ; CHECK-LABEL: vfnmsub_vv_nxv8f64:
770 ; CHECK-NEXT: vl8re64.v v24, (a0)
771 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
772 ; CHECK-NEXT: vfnmsac.vv v8, v16, v24
774 %neg = fneg <vscale x 8 x double> %vb
775 %vd = call <vscale x 8 x double> @llvm.experimental.constrained.fma.nxv8f64(<vscale x 8 x double> %neg, <vscale x 8 x double> %vc, <vscale x 8 x double> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
776 ret <vscale x 8 x double> %vd
779 define <vscale x 8 x double> @vfnmsub_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) strictfp {
780 ; CHECK-LABEL: vfnmsub_vf_nxv8f64:
782 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
783 ; CHECK-NEXT: vfnmsac.vf v8, fa0, v16
785 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
786 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
787 %neg = fneg <vscale x 8 x double> %splat
788 %vd = call <vscale x 8 x double> @llvm.experimental.constrained.fma.nxv8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %neg, <vscale x 8 x double> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
789 ret <vscale x 8 x double> %vd