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 vfmacc and vfmadd 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> @vfmadd_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) strictfp {
17 ; ZVFH-LABEL: vfmadd_vv_nxv1f16:
19 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
20 ; ZVFH-NEXT: vfmadd.vv v8, v9, v10
23 ; ZVFHMIN-LABEL: vfmadd_vv_nxv1f16:
25 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
26 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v10
27 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
28 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
29 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
30 ; ZVFHMIN-NEXT: vfmadd.vv v9, v10, v11
31 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
32 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
34 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
35 ret <vscale x 1 x half> %vd
38 define <vscale x 1 x half> @vfmadd_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) strictfp {
39 ; ZVFH-LABEL: vfmadd_vf_nxv1f16:
41 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
42 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v9
45 ; ZVFHMIN-LABEL: vfmadd_vf_nxv1f16:
47 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
48 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
49 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
50 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
51 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
52 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
53 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
54 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v11
55 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
56 ; ZVFHMIN-NEXT: vfmadd.vv v12, v9, v10
57 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
58 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
60 %head = insertelement <vscale x 1 x half> poison, half %c, i32 0
61 %splat = shufflevector <vscale x 1 x half> %head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
62 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
63 ret <vscale x 1 x half> %vd
66 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)
68 define <vscale x 2 x half> @vfmadd_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x half> %vc) strictfp {
69 ; ZVFH-LABEL: vfmadd_vv_nxv2f16:
71 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
72 ; ZVFH-NEXT: vfmadd.vv v8, v10, v9
75 ; ZVFHMIN-LABEL: vfmadd_vv_nxv2f16:
77 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
78 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v9
79 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
80 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
81 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
82 ; ZVFHMIN-NEXT: vfmadd.vv v10, v9, v11
83 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
84 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
86 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
87 ret <vscale x 2 x half> %vd
90 define <vscale x 2 x half> @vfmadd_vf_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, half %c) strictfp {
91 ; ZVFH-LABEL: vfmadd_vf_nxv2f16:
93 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
94 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v9
97 ; ZVFHMIN-LABEL: vfmadd_vf_nxv2f16:
99 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
100 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m1, ta, ma
101 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
102 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
103 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
104 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
105 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
106 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v11
107 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
108 ; ZVFHMIN-NEXT: vfmadd.vv v9, v8, v10
109 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
110 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
112 %head = insertelement <vscale x 2 x half> poison, half %c, i32 0
113 %splat = shufflevector <vscale x 2 x half> %head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
114 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
115 ret <vscale x 2 x half> %vd
118 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)
120 define <vscale x 4 x half> @vfmadd_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x half> %vc) strictfp {
121 ; ZVFH-LABEL: vfmadd_vv_nxv4f16:
123 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
124 ; ZVFH-NEXT: vfmadd.vv v8, v9, v10
127 ; ZVFHMIN-LABEL: vfmadd_vv_nxv4f16:
129 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
130 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
131 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
132 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v9
133 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
134 ; ZVFHMIN-NEXT: vfmadd.vv v14, v10, v12
135 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
136 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v14
138 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
139 ret <vscale x 4 x half> %vd
142 define <vscale x 4 x half> @vfmadd_vf_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, half %c) strictfp {
143 ; ZVFH-LABEL: vfmadd_vf_nxv4f16:
145 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
146 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v9
149 ; ZVFHMIN-LABEL: vfmadd_vf_nxv4f16:
151 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
152 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m2, ta, ma
153 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
154 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
155 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v10
156 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
157 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8
158 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
159 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
160 ; ZVFHMIN-NEXT: vfmadd.vv v16, v14, v10
161 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
162 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
164 %head = insertelement <vscale x 4 x half> poison, half %c, i32 0
165 %splat = shufflevector <vscale x 4 x half> %head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
166 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
167 ret <vscale x 4 x half> %vd
170 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)
172 define <vscale x 8 x half> @vfmadd_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x half> %vc) strictfp {
173 ; ZVFH-LABEL: vfmadd_vv_nxv8f16:
175 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
176 ; ZVFH-NEXT: vfmacc.vv v8, v12, v10
179 ; ZVFHMIN-LABEL: vfmadd_vv_nxv8f16:
181 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
182 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
183 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v12
184 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
185 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
186 ; ZVFHMIN-NEXT: vfmadd.vv v12, v20, v16
187 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
188 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
190 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
191 ret <vscale x 8 x half> %vd
194 define <vscale x 8 x half> @vfmadd_vf_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, half %c) strictfp {
195 ; ZVFH-LABEL: vfmadd_vf_nxv8f16:
197 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
198 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v10
201 ; ZVFHMIN-LABEL: vfmadd_vf_nxv8f16:
203 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
204 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m4, ta, ma
205 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
206 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
207 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v12
208 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
209 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v10
210 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
211 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
212 ; ZVFHMIN-NEXT: vfmadd.vv v24, v20, v12
213 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
214 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
216 %head = insertelement <vscale x 8 x half> poison, half %c, i32 0
217 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
218 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
219 ret <vscale x 8 x half> %vd
222 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)
224 define <vscale x 16 x half> @vfmadd_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x half> %vc) strictfp {
225 ; ZVFH-LABEL: vfmadd_vv_nxv16f16:
227 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
228 ; ZVFH-NEXT: vfmadd.vv v8, v16, v12
231 ; ZVFHMIN-LABEL: vfmadd_vv_nxv16f16:
233 ; ZVFHMIN-NEXT: addi sp, sp, -16
234 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
235 ; ZVFHMIN-NEXT: csrr a0, vlenb
236 ; ZVFHMIN-NEXT: slli a0, a0, 2
237 ; ZVFHMIN-NEXT: sub sp, sp, a0
238 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb
239 ; ZVFHMIN-NEXT: addi a0, sp, 16
240 ; ZVFHMIN-NEXT: vs4r.v v16, (a0) # Unknown-size Folded Spill
241 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
242 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
243 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
244 ; ZVFHMIN-NEXT: addi a0, sp, 16
245 ; ZVFHMIN-NEXT: vl4r.v v8, (a0) # Unknown-size Folded Reload
246 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
247 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
248 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v24
249 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
250 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
251 ; ZVFHMIN-NEXT: csrr a0, vlenb
252 ; ZVFHMIN-NEXT: slli a0, a0, 2
253 ; ZVFHMIN-NEXT: add sp, sp, a0
254 ; ZVFHMIN-NEXT: addi sp, sp, 16
256 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
257 ret <vscale x 16 x half> %vd
260 define <vscale x 16 x half> @vfmadd_vf_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, half %c) strictfp {
261 ; ZVFH-LABEL: vfmadd_vf_nxv16f16:
263 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
264 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v12
267 ; ZVFHMIN-LABEL: vfmadd_vf_nxv16f16:
269 ; ZVFHMIN-NEXT: addi sp, sp, -16
270 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
271 ; ZVFHMIN-NEXT: csrr a0, vlenb
272 ; ZVFHMIN-NEXT: slli a0, a0, 2
273 ; ZVFHMIN-NEXT: sub sp, sp, a0
274 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb
275 ; ZVFHMIN-NEXT: vmv4r.v v28, v12
276 ; ZVFHMIN-NEXT: addi a0, sp, 16
277 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
278 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
279 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
280 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
281 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
282 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
283 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v28
284 ; ZVFHMIN-NEXT: addi a0, sp, 16
285 ; ZVFHMIN-NEXT: vl4r.v v16, (a0) # Unknown-size Folded Reload
286 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
287 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
288 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
289 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v8
290 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
291 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
292 ; ZVFHMIN-NEXT: csrr a0, vlenb
293 ; ZVFHMIN-NEXT: slli a0, a0, 2
294 ; ZVFHMIN-NEXT: add sp, sp, a0
295 ; ZVFHMIN-NEXT: addi sp, sp, 16
297 %head = insertelement <vscale x 16 x half> poison, half %c, i32 0
298 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
299 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
300 ret <vscale x 16 x half> %vd
303 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)
305 define <vscale x 32 x half> @vfmadd_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x half> %vc) strictfp {
306 ; ZVFH-LABEL: vfmadd_vv_nxv32f16:
308 ; ZVFH-NEXT: vl8re16.v v24, (a0)
309 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
310 ; ZVFH-NEXT: vfmacc.vv v8, v16, v24
313 ; ZVFHMIN-LABEL: vfmadd_vv_nxv32f16:
315 ; ZVFHMIN-NEXT: addi sp, sp, -16
316 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
317 ; ZVFHMIN-NEXT: csrr a1, vlenb
318 ; ZVFHMIN-NEXT: li a2, 40
319 ; ZVFHMIN-NEXT: mul a1, a1, a2
320 ; ZVFHMIN-NEXT: sub sp, sp, a1
321 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x28, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 40 * vlenb
322 ; ZVFHMIN-NEXT: csrr a1, vlenb
323 ; ZVFHMIN-NEXT: slli a1, a1, 3
324 ; ZVFHMIN-NEXT: add a1, sp, a1
325 ; ZVFHMIN-NEXT: addi a1, a1, 16
326 ; ZVFHMIN-NEXT: vs8r.v v16, (a1) # Unknown-size Folded Spill
327 ; ZVFHMIN-NEXT: vmv8r.v v0, v8
328 ; ZVFHMIN-NEXT: csrr a1, vlenb
329 ; ZVFHMIN-NEXT: li a2, 24
330 ; ZVFHMIN-NEXT: mul a1, a1, a2
331 ; ZVFHMIN-NEXT: add a1, sp, a1
332 ; ZVFHMIN-NEXT: addi a1, a1, 16
333 ; ZVFHMIN-NEXT: vs8r.v v8, (a1) # Unknown-size Folded Spill
334 ; ZVFHMIN-NEXT: vl8re16.v v24, (a0)
335 ; ZVFHMIN-NEXT: addi a0, sp, 16
336 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
337 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
338 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v0
339 ; ZVFHMIN-NEXT: csrr a0, vlenb
340 ; ZVFHMIN-NEXT: slli a0, a0, 5
341 ; ZVFHMIN-NEXT: add a0, sp, a0
342 ; ZVFHMIN-NEXT: addi a0, a0, 16
343 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
344 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
345 ; ZVFHMIN-NEXT: csrr a0, vlenb
346 ; ZVFHMIN-NEXT: slli a0, a0, 4
347 ; ZVFHMIN-NEXT: add a0, sp, a0
348 ; ZVFHMIN-NEXT: addi a0, a0, 16
349 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
350 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
351 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
352 ; ZVFHMIN-NEXT: csrr a0, vlenb
353 ; ZVFHMIN-NEXT: slli a0, a0, 5
354 ; ZVFHMIN-NEXT: add a0, sp, a0
355 ; ZVFHMIN-NEXT: addi a0, a0, 16
356 ; ZVFHMIN-NEXT: vl8r.v v0, (a0) # Unknown-size Folded Reload
357 ; ZVFHMIN-NEXT: csrr a0, vlenb
358 ; ZVFHMIN-NEXT: slli a0, a0, 4
359 ; ZVFHMIN-NEXT: add a0, sp, a0
360 ; ZVFHMIN-NEXT: addi a0, a0, 16
361 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
362 ; ZVFHMIN-NEXT: vfmadd.vv v16, v8, v0
363 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
364 ; ZVFHMIN-NEXT: vfncvt.f.f.w v0, v16
365 ; ZVFHMIN-NEXT: csrr a0, vlenb
366 ; ZVFHMIN-NEXT: li a1, 24
367 ; ZVFHMIN-NEXT: mul a0, a0, a1
368 ; ZVFHMIN-NEXT: add a0, sp, a0
369 ; ZVFHMIN-NEXT: addi a0, a0, 16
370 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
371 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
372 ; ZVFHMIN-NEXT: csrr a0, vlenb
373 ; ZVFHMIN-NEXT: slli a0, a0, 5
374 ; ZVFHMIN-NEXT: add a0, sp, a0
375 ; ZVFHMIN-NEXT: addi a0, a0, 16
376 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
377 ; ZVFHMIN-NEXT: csrr a0, vlenb
378 ; ZVFHMIN-NEXT: slli a0, a0, 3
379 ; ZVFHMIN-NEXT: add a0, sp, a0
380 ; ZVFHMIN-NEXT: addi a0, a0, 16
381 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
382 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
383 ; ZVFHMIN-NEXT: addi a0, sp, 16
384 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
385 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v20
386 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
387 ; ZVFHMIN-NEXT: csrr a0, vlenb
388 ; ZVFHMIN-NEXT: slli a0, a0, 5
389 ; ZVFHMIN-NEXT: add a0, sp, a0
390 ; ZVFHMIN-NEXT: addi a0, a0, 16
391 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
392 ; ZVFHMIN-NEXT: vfmadd.vv v8, v24, v16
393 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
394 ; ZVFHMIN-NEXT: vfncvt.f.f.w v4, v8
395 ; ZVFHMIN-NEXT: vmv8r.v v8, v0
396 ; ZVFHMIN-NEXT: csrr a0, vlenb
397 ; ZVFHMIN-NEXT: li a1, 40
398 ; ZVFHMIN-NEXT: mul a0, a0, a1
399 ; ZVFHMIN-NEXT: add sp, sp, a0
400 ; ZVFHMIN-NEXT: addi sp, sp, 16
402 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
403 ret <vscale x 32 x half> %vd
406 define <vscale x 32 x half> @vfmadd_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) strictfp {
407 ; ZVFH-LABEL: vfmadd_vf_nxv32f16:
409 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
410 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v16
413 ; ZVFHMIN-LABEL: vfmadd_vf_nxv32f16:
415 ; ZVFHMIN-NEXT: addi sp, sp, -16
416 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
417 ; ZVFHMIN-NEXT: csrr a0, vlenb
418 ; ZVFHMIN-NEXT: slli a0, a0, 5
419 ; ZVFHMIN-NEXT: sub sp, sp, a0
420 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 32 * vlenb
421 ; ZVFHMIN-NEXT: vmv8r.v v0, v16
422 ; ZVFHMIN-NEXT: csrr a0, vlenb
423 ; ZVFHMIN-NEXT: li a1, 24
424 ; ZVFHMIN-NEXT: mul a0, a0, a1
425 ; ZVFHMIN-NEXT: add a0, sp, a0
426 ; ZVFHMIN-NEXT: addi a0, a0, 16
427 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
428 ; ZVFHMIN-NEXT: addi a0, sp, 16
429 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
430 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
431 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
432 ; ZVFHMIN-NEXT: vfmv.v.f v24, fa5
433 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
434 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
435 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
436 ; ZVFHMIN-NEXT: csrr a0, vlenb
437 ; ZVFHMIN-NEXT: slli a0, a0, 4
438 ; ZVFHMIN-NEXT: add a0, sp, a0
439 ; ZVFHMIN-NEXT: addi a0, a0, 16
440 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
441 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v0
442 ; ZVFHMIN-NEXT: csrr a0, vlenb
443 ; ZVFHMIN-NEXT: slli a0, a0, 3
444 ; ZVFHMIN-NEXT: add a0, sp, a0
445 ; ZVFHMIN-NEXT: addi a0, a0, 16
446 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
447 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v12
448 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
449 ; ZVFHMIN-NEXT: csrr a0, vlenb
450 ; ZVFHMIN-NEXT: slli a0, a0, 4
451 ; ZVFHMIN-NEXT: add a0, sp, a0
452 ; ZVFHMIN-NEXT: addi a0, a0, 16
453 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
454 ; ZVFHMIN-NEXT: csrr a0, vlenb
455 ; ZVFHMIN-NEXT: slli a0, a0, 3
456 ; ZVFHMIN-NEXT: add a0, sp, a0
457 ; ZVFHMIN-NEXT: addi a0, a0, 16
458 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
459 ; ZVFHMIN-NEXT: vfmadd.vv v0, v16, v24
460 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
461 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
462 ; ZVFHMIN-NEXT: addi a0, sp, 16
463 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
464 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
465 ; ZVFHMIN-NEXT: csrr a0, vlenb
466 ; ZVFHMIN-NEXT: slli a0, a0, 4
467 ; ZVFHMIN-NEXT: add a0, sp, a0
468 ; ZVFHMIN-NEXT: addi a0, a0, 16
469 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
470 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
471 ; ZVFHMIN-NEXT: csrr a0, vlenb
472 ; ZVFHMIN-NEXT: li a1, 24
473 ; ZVFHMIN-NEXT: mul a0, a0, a1
474 ; ZVFHMIN-NEXT: add a0, sp, a0
475 ; ZVFHMIN-NEXT: addi a0, a0, 16
476 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
477 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v28
478 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
479 ; ZVFHMIN-NEXT: csrr a0, vlenb
480 ; ZVFHMIN-NEXT: slli a0, a0, 4
481 ; ZVFHMIN-NEXT: add a0, sp, a0
482 ; ZVFHMIN-NEXT: addi a0, a0, 16
483 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
484 ; ZVFHMIN-NEXT: vfmadd.vv v0, v16, v24
485 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
486 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v0
487 ; ZVFHMIN-NEXT: csrr a0, vlenb
488 ; ZVFHMIN-NEXT: slli a0, a0, 5
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 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
495 ret <vscale x 32 x half> %vd
498 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)
500 define <vscale x 1 x float> @vfmadd_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %vc) strictfp {
501 ; CHECK-LABEL: vfmadd_vv_nxv1f32:
503 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
504 ; CHECK-NEXT: vfmadd.vv v8, v9, v10
506 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
507 ret <vscale x 1 x float> %vd
510 define <vscale x 1 x float> @vfmadd_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) strictfp {
511 ; CHECK-LABEL: vfmadd_vf_nxv1f32:
513 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
514 ; CHECK-NEXT: vfmadd.vf v8, fa0, v9
516 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
517 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
518 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
519 ret <vscale x 1 x float> %vd
522 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)
524 define <vscale x 2 x float> @vfmadd_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x float> %vc) strictfp {
525 ; CHECK-LABEL: vfmadd_vv_nxv2f32:
527 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
528 ; CHECK-NEXT: vfmadd.vv v8, v10, v9
530 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
531 ret <vscale x 2 x float> %vd
534 define <vscale x 2 x float> @vfmadd_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) strictfp {
535 ; CHECK-LABEL: vfmadd_vf_nxv2f32:
537 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
538 ; CHECK-NEXT: vfmacc.vf v8, fa0, v9
540 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
541 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
542 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
543 ret <vscale x 2 x float> %vd
546 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)
548 define <vscale x 4 x float> @vfmadd_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x float> %vc) strictfp {
549 ; CHECK-LABEL: vfmadd_vv_nxv4f32:
551 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
552 ; CHECK-NEXT: vfmadd.vv v8, v10, v12
554 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
555 ret <vscale x 4 x float> %vd
558 define <vscale x 4 x float> @vfmadd_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) strictfp {
559 ; CHECK-LABEL: vfmadd_vf_nxv4f32:
561 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
562 ; CHECK-NEXT: vfmadd.vf v8, fa0, v10
564 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
565 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
566 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
567 ret <vscale x 4 x float> %vd
570 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)
572 define <vscale x 8 x float> @vfmadd_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x float> %vc) strictfp {
573 ; CHECK-LABEL: vfmadd_vv_nxv8f32:
575 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
576 ; CHECK-NEXT: vfmacc.vv v8, v16, v12
578 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
579 ret <vscale x 8 x float> %vd
582 define <vscale x 8 x float> @vfmadd_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) strictfp {
583 ; CHECK-LABEL: vfmadd_vf_nxv8f32:
585 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
586 ; CHECK-NEXT: vfmacc.vf v8, fa0, v12
588 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
589 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
590 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
591 ret <vscale x 8 x float> %vd
594 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)
596 define <vscale x 16 x float> @vfmadd_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x float> %vc) strictfp {
597 ; CHECK-LABEL: vfmadd_vv_nxv16f32:
599 ; CHECK-NEXT: vl8re32.v v24, (a0)
600 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
601 ; CHECK-NEXT: vfmadd.vv v8, v24, v16
603 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
604 ret <vscale x 16 x float> %vd
607 define <vscale x 16 x float> @vfmadd_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) strictfp {
608 ; CHECK-LABEL: vfmadd_vf_nxv16f32:
610 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
611 ; CHECK-NEXT: vfmadd.vf v8, fa0, v16
613 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
614 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
615 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
616 ret <vscale x 16 x float> %vd
619 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)
621 define <vscale x 1 x double> @vfmadd_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %vc) strictfp {
622 ; CHECK-LABEL: vfmadd_vv_nxv1f64:
624 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
625 ; CHECK-NEXT: vfmadd.vv v8, v9, v10
627 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
628 ret <vscale x 1 x double> %vd
631 define <vscale x 1 x double> @vfmadd_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) strictfp {
632 ; CHECK-LABEL: vfmadd_vf_nxv1f64:
634 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
635 ; CHECK-NEXT: vfmadd.vf v8, fa0, v9
637 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
638 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
639 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
640 ret <vscale x 1 x double> %vd
643 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)
645 define <vscale x 2 x double> @vfmadd_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x double> %vc) strictfp {
646 ; CHECK-LABEL: vfmadd_vv_nxv2f64:
648 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
649 ; CHECK-NEXT: vfmadd.vv v8, v12, v10
651 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
652 ret <vscale x 2 x double> %vd
655 define <vscale x 2 x double> @vfmadd_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) strictfp {
656 ; CHECK-LABEL: vfmadd_vf_nxv2f64:
658 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
659 ; CHECK-NEXT: vfmacc.vf v8, fa0, v10
661 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
662 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
663 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
664 ret <vscale x 2 x double> %vd
667 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)
669 define <vscale x 4 x double> @vfmadd_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x double> %vc) strictfp {
670 ; CHECK-LABEL: vfmadd_vv_nxv4f64:
672 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
673 ; CHECK-NEXT: vfmadd.vv v8, v12, v16
675 %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> %vc, metadata !"round.dynamic", metadata !"fpexcept.strict")
676 ret <vscale x 4 x double> %vd
679 define <vscale x 4 x double> @vfmadd_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) strictfp {
680 ; CHECK-LABEL: vfmadd_vf_nxv4f64:
682 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
683 ; CHECK-NEXT: vfmadd.vf v8, fa0, v12
685 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
686 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
687 %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> %vb, metadata !"round.dynamic", metadata !"fpexcept.strict")
688 ret <vscale x 4 x double> %vd
691 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)
693 define <vscale x 8 x double> @vfmadd_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x double> %vc) strictfp {
694 ; CHECK-LABEL: vfmadd_vv_nxv8f64:
696 ; CHECK-NEXT: vl8re64.v v24, (a0)
697 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
698 ; CHECK-NEXT: vfmacc.vv v8, v16, v24
700 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
701 ret <vscale x 8 x double> %vd
704 define <vscale x 8 x double> @vfmadd_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) strictfp {
705 ; CHECK-LABEL: vfmadd_vf_nxv8f64:
707 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
708 ; CHECK-NEXT: vfmacc.vf v8, fa0, v16
710 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
711 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
712 %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> %va, metadata !"round.dynamic", metadata !"fpexcept.strict")
713 ret <vscale x 8 x double> %vd