1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+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.fma.v1f16(<vscale x 1 x half>, <vscale x 1 x half>, <vscale x 1 x half>)
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) {
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, v8
28 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
29 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
30 ; ZVFHMIN-NEXT: vfmadd.vv v12, v10, v11
31 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
32 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
34 %vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc)
35 ret <vscale x 1 x half> %vd
38 define <vscale x 1 x half> @vfmadd_vv_nxv1f16_commuted(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x half> %vc) {
39 ; ZVFH-LABEL: vfmadd_vv_nxv1f16_commuted:
41 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
42 ; ZVFH-NEXT: vfmacc.vv v8, v10, v9
45 ; ZVFHMIN-LABEL: vfmadd_vv_nxv1f16_commuted:
47 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
48 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v8
49 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
50 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v10
51 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
52 ; ZVFHMIN-NEXT: vfmadd.vv v9, v8, v11
53 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
54 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
56 %vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %vb, <vscale x 1 x half> %vc, <vscale x 1 x half> %va)
57 ret <vscale x 1 x half> %vd
60 define <vscale x 1 x half> @vfmadd_vf_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, half %c) {
61 ; ZVFH-LABEL: vfmadd_vf_nxv1f16:
63 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
64 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v9
67 ; ZVFHMIN-LABEL: vfmadd_vf_nxv1f16:
69 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
70 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
71 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
72 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
73 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
74 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
75 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
76 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v11
77 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
78 ; ZVFHMIN-NEXT: vfmadd.vv v12, v9, v10
79 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
80 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
82 %head = insertelement <vscale x 1 x half> poison, half %c, i32 0
83 %splat = shufflevector <vscale x 1 x half> %head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
84 %vd = call <vscale x 1 x half> @llvm.fma.v1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %splat, <vscale x 1 x half> %vb)
85 ret <vscale x 1 x half> %vd
88 declare <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half>, <vscale x 2 x half>, <vscale x 2 x half>)
90 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) {
91 ; ZVFH-LABEL: vfmadd_vv_nxv2f16:
93 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
94 ; ZVFH-NEXT: vfmadd.vv v8, v10, v9
97 ; ZVFHMIN-LABEL: vfmadd_vv_nxv2f16:
99 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
100 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v11, v9
101 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
102 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
103 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
104 ; ZVFHMIN-NEXT: vfmadd.vv v12, v9, v11
105 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
106 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
108 %vd = call <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vc, <vscale x 2 x half> %vb)
109 ret <vscale x 2 x half> %vd
112 define <vscale x 2 x half> @vfmadd_vf_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, half %c) {
113 ; ZVFH-LABEL: vfmadd_vf_nxv2f16:
115 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
116 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v9
119 ; ZVFHMIN-LABEL: vfmadd_vf_nxv2f16:
121 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
122 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m1, ta, ma
123 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
124 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
125 ; ZVFHMIN-NEXT: vfncvt.f.f.w v11, v10
126 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
127 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
128 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v11
129 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
130 ; ZVFHMIN-NEXT: vfmadd.vv v9, v8, v10
131 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
132 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
134 %head = insertelement <vscale x 2 x half> poison, half %c, i32 0
135 %splat = shufflevector <vscale x 2 x half> %head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
136 %vd = call <vscale x 2 x half> @llvm.fma.v2f16(<vscale x 2 x half> %vb, <vscale x 2 x half> %splat, <vscale x 2 x half> %va)
137 ret <vscale x 2 x half> %vd
140 declare <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half>, <vscale x 4 x half>, <vscale x 4 x half>)
142 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) {
143 ; ZVFH-LABEL: vfmadd_vv_nxv4f16:
145 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
146 ; ZVFH-NEXT: vfmadd.vv v8, v9, v10
149 ; ZVFHMIN-LABEL: vfmadd_vv_nxv4f16:
151 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
152 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
153 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
154 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8
155 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
156 ; ZVFHMIN-NEXT: vfmadd.vv v14, v10, v12
157 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
158 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v14
160 %vd = call <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half> %vb, <vscale x 4 x half> %va, <vscale x 4 x half> %vc)
161 ret <vscale x 4 x half> %vd
164 define <vscale x 4 x half> @vfmadd_vf_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, half %c) {
165 ; ZVFH-LABEL: vfmadd_vf_nxv4f16:
167 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
168 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v9
171 ; ZVFHMIN-LABEL: vfmadd_vf_nxv4f16:
173 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
174 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m2, ta, ma
175 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
176 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
177 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v10
178 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
179 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v14, v8
180 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
181 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
182 ; ZVFHMIN-NEXT: vfmadd.vv v16, v14, v10
183 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
184 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
186 %head = insertelement <vscale x 4 x half> poison, half %c, i32 0
187 %splat = shufflevector <vscale x 4 x half> %head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
188 %vd = call <vscale x 4 x half> @llvm.fma.v4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %splat, <vscale x 4 x half> %vb)
189 ret <vscale x 4 x half> %vd
192 declare <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x half>)
194 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) {
195 ; ZVFH-LABEL: vfmadd_vv_nxv8f16:
197 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
198 ; ZVFH-NEXT: vfmacc.vv v8, v12, v10
201 ; ZVFHMIN-LABEL: vfmadd_vv_nxv8f16:
203 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
204 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
205 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v10
206 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
207 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
208 ; ZVFHMIN-NEXT: vfmadd.vv v24, v20, v16
209 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
210 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
212 %vd = call <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %vc, <vscale x 8 x half> %va)
213 ret <vscale x 8 x half> %vd
216 define <vscale x 8 x half> @vfmadd_vf_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, half %c) {
217 ; ZVFH-LABEL: vfmadd_vf_nxv8f16:
219 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
220 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v10
223 ; ZVFHMIN-LABEL: vfmadd_vf_nxv8f16:
225 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
226 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m4, ta, ma
227 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
228 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
229 ; ZVFHMIN-NEXT: vfncvt.f.f.w v16, v12
230 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
231 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v20, v10
232 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
233 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
234 ; ZVFHMIN-NEXT: vfmadd.vv v24, v20, v12
235 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
236 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
238 %head = insertelement <vscale x 8 x half> poison, half %c, i32 0
239 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
240 %vd = call <vscale x 8 x half> @llvm.fma.v8f16(<vscale x 8 x half> %vb, <vscale x 8 x half> %splat, <vscale x 8 x half> %va)
241 ret <vscale x 8 x half> %vd
244 declare <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x half>)
246 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) {
247 ; ZVFH-LABEL: vfmadd_vv_nxv16f16:
249 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
250 ; ZVFH-NEXT: vfmadd.vv v8, v16, v12
253 ; ZVFHMIN-LABEL: vfmadd_vv_nxv16f16:
255 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
256 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
257 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
258 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
259 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
260 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v24
261 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
262 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
264 %vd = call <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half> %vc, <vscale x 16 x half> %va, <vscale x 16 x half> %vb)
265 ret <vscale x 16 x half> %vd
268 define <vscale x 16 x half> @vfmadd_vf_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, half %c) {
269 ; ZVFH-LABEL: vfmadd_vf_nxv16f16:
271 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
272 ; ZVFH-NEXT: vfmadd.vf v8, fa0, v12
275 ; ZVFHMIN-LABEL: vfmadd_vf_nxv16f16:
277 ; ZVFHMIN-NEXT: addi sp, sp, -16
278 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
279 ; ZVFHMIN-NEXT: csrr a0, vlenb
280 ; ZVFHMIN-NEXT: slli a0, a0, 2
281 ; ZVFHMIN-NEXT: sub sp, sp, a0
282 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x04, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 4 * vlenb
283 ; ZVFHMIN-NEXT: vmv4r.v v28, v12
284 ; ZVFHMIN-NEXT: addi a0, sp, 16
285 ; ZVFHMIN-NEXT: vs4r.v v8, (a0) # Unknown-size Folded Spill
286 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
287 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
288 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
289 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
290 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
291 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v28
292 ; ZVFHMIN-NEXT: addi a0, sp, 16
293 ; ZVFHMIN-NEXT: vl4r.v v16, (a0) # Unknown-size Folded Reload
294 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
295 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
296 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
297 ; ZVFHMIN-NEXT: vfmadd.vv v16, v0, v8
298 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
299 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
300 ; ZVFHMIN-NEXT: csrr a0, vlenb
301 ; ZVFHMIN-NEXT: slli a0, a0, 2
302 ; ZVFHMIN-NEXT: add sp, sp, a0
303 ; ZVFHMIN-NEXT: addi sp, sp, 16
305 %head = insertelement <vscale x 16 x half> poison, half %c, i32 0
306 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
307 %vd = call <vscale x 16 x half> @llvm.fma.v16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %splat, <vscale x 16 x half> %vb)
308 ret <vscale x 16 x half> %vd
311 declare <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half>, <vscale x 32 x half>, <vscale x 32 x half>)
313 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) {
314 ; ZVFH-LABEL: vfmadd_vv_nxv32f16:
316 ; ZVFH-NEXT: vl8re16.v v24, (a0)
317 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
318 ; ZVFH-NEXT: vfmacc.vv v8, v16, v24
321 ; ZVFHMIN-LABEL: vfmadd_vv_nxv32f16:
323 ; ZVFHMIN-NEXT: addi sp, sp, -16
324 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
325 ; ZVFHMIN-NEXT: csrr a1, vlenb
326 ; ZVFHMIN-NEXT: slli a1, a1, 5
327 ; ZVFHMIN-NEXT: sub sp, sp, a1
328 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x20, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 32 * vlenb
329 ; ZVFHMIN-NEXT: vl8re16.v v0, (a0)
330 ; ZVFHMIN-NEXT: vmv8r.v v24, v16
331 ; ZVFHMIN-NEXT: csrr a0, vlenb
332 ; ZVFHMIN-NEXT: slli a0, a0, 4
333 ; ZVFHMIN-NEXT: add a0, sp, a0
334 ; ZVFHMIN-NEXT: addi a0, a0, 16
335 ; ZVFHMIN-NEXT: vs8r.v v16, (a0) # Unknown-size Folded Spill
336 ; ZVFHMIN-NEXT: vmv8r.v v16, v8
337 ; ZVFHMIN-NEXT: addi a0, sp, 16
338 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
339 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
340 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v16
341 ; ZVFHMIN-NEXT: csrr a0, vlenb
342 ; ZVFHMIN-NEXT: li a1, 24
343 ; ZVFHMIN-NEXT: mul a0, a0, a1
344 ; ZVFHMIN-NEXT: add a0, sp, a0
345 ; ZVFHMIN-NEXT: addi a0, a0, 16
346 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
347 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v24
348 ; ZVFHMIN-NEXT: csrr a0, vlenb
349 ; ZVFHMIN-NEXT: slli a0, a0, 3
350 ; ZVFHMIN-NEXT: add a0, sp, a0
351 ; ZVFHMIN-NEXT: addi a0, a0, 16
352 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
353 ; ZVFHMIN-NEXT: vmv8r.v v8, v0
354 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
355 ; ZVFHMIN-NEXT: csrr a0, vlenb
356 ; ZVFHMIN-NEXT: li a1, 24
357 ; ZVFHMIN-NEXT: mul a0, a0, a1
358 ; ZVFHMIN-NEXT: add a0, sp, a0
359 ; ZVFHMIN-NEXT: addi a0, a0, 16
360 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
361 ; ZVFHMIN-NEXT: csrr a0, vlenb
362 ; ZVFHMIN-NEXT: slli a0, a0, 3
363 ; ZVFHMIN-NEXT: add a0, sp, a0
364 ; ZVFHMIN-NEXT: addi a0, a0, 16
365 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
366 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
367 ; ZVFHMIN-NEXT: vfmadd.vv v0, v16, v24
368 ; ZVFHMIN-NEXT: addi a0, sp, 16
369 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
370 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
371 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
372 ; ZVFHMIN-NEXT: csrr a0, vlenb
373 ; ZVFHMIN-NEXT: slli a0, a0, 3
374 ; ZVFHMIN-NEXT: add a0, sp, a0
375 ; ZVFHMIN-NEXT: addi a0, a0, 16
376 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
377 ; ZVFHMIN-NEXT: csrr a0, vlenb
378 ; ZVFHMIN-NEXT: slli a0, a0, 4
379 ; ZVFHMIN-NEXT: add a0, sp, a0
380 ; ZVFHMIN-NEXT: addi a0, a0, 16
381 ; ZVFHMIN-NEXT: vl8r.v v16, (a0) # Unknown-size Folded Reload
382 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
383 ; ZVFHMIN-NEXT: csrr a0, vlenb
384 ; ZVFHMIN-NEXT: li a1, 24
385 ; ZVFHMIN-NEXT: mul a0, a0, a1
386 ; ZVFHMIN-NEXT: add a0, sp, a0
387 ; ZVFHMIN-NEXT: addi a0, a0, 16
388 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
389 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
390 ; ZVFHMIN-NEXT: csrr a0, vlenb
391 ; ZVFHMIN-NEXT: li a1, 24
392 ; ZVFHMIN-NEXT: mul a0, a0, a1
393 ; ZVFHMIN-NEXT: add a0, sp, a0
394 ; ZVFHMIN-NEXT: addi a0, a0, 16
395 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
396 ; ZVFHMIN-NEXT: csrr a0, vlenb
397 ; ZVFHMIN-NEXT: slli a0, a0, 3
398 ; ZVFHMIN-NEXT: add a0, sp, a0
399 ; ZVFHMIN-NEXT: addi a0, a0, 16
400 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
401 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
402 ; ZVFHMIN-NEXT: vfmadd.vv v16, v8, v24
403 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
404 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
405 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
406 ; ZVFHMIN-NEXT: csrr a0, vlenb
407 ; ZVFHMIN-NEXT: slli a0, a0, 5
408 ; ZVFHMIN-NEXT: add sp, sp, a0
409 ; ZVFHMIN-NEXT: addi sp, sp, 16
411 %vd = call <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half> %vc, <vscale x 32 x half> %vb, <vscale x 32 x half> %va)
412 ret <vscale x 32 x half> %vd
415 define <vscale x 32 x half> @vfmadd_vf_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, half %c) {
416 ; ZVFH-LABEL: vfmadd_vf_nxv32f16:
418 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
419 ; ZVFH-NEXT: vfmacc.vf v8, fa0, v16
422 ; ZVFHMIN-LABEL: vfmadd_vf_nxv32f16:
424 ; ZVFHMIN-NEXT: addi sp, sp, -16
425 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
426 ; ZVFHMIN-NEXT: csrr a0, vlenb
427 ; ZVFHMIN-NEXT: li a1, 24
428 ; ZVFHMIN-NEXT: mul a0, a0, a1
429 ; ZVFHMIN-NEXT: sub sp, sp, a0
430 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x18, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 24 * vlenb
431 ; ZVFHMIN-NEXT: csrr a0, vlenb
432 ; ZVFHMIN-NEXT: slli a0, a0, 3
433 ; ZVFHMIN-NEXT: add a0, sp, a0
434 ; ZVFHMIN-NEXT: addi a0, a0, 16
435 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
436 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
437 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
438 ; ZVFHMIN-NEXT: vfmv.v.f v24, fa5
439 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
440 ; ZVFHMIN-NEXT: vfncvt.f.f.w v4, v24
441 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
442 ; ZVFHMIN-NEXT: csrr a0, vlenb
443 ; ZVFHMIN-NEXT: slli a0, a0, 4
444 ; ZVFHMIN-NEXT: add a0, sp, a0
445 ; ZVFHMIN-NEXT: addi a0, a0, 16
446 ; ZVFHMIN-NEXT: vs8r.v v24, (a0) # Unknown-size Folded Spill
447 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v4
448 ; ZVFHMIN-NEXT: addi a0, sp, 16
449 ; ZVFHMIN-NEXT: vs8r.v v8, (a0) # Unknown-size Folded Spill
450 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v16
451 ; ZVFHMIN-NEXT: csrr a0, vlenb
452 ; ZVFHMIN-NEXT: slli a0, a0, 4
453 ; ZVFHMIN-NEXT: add a0, sp, a0
454 ; ZVFHMIN-NEXT: addi a0, a0, 16
455 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
456 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
457 ; ZVFHMIN-NEXT: vfmadd.vv v0, v8, v24
458 ; ZVFHMIN-NEXT: csrr a0, vlenb
459 ; ZVFHMIN-NEXT: slli a0, a0, 3
460 ; ZVFHMIN-NEXT: add a0, sp, a0
461 ; ZVFHMIN-NEXT: addi a0, a0, 16
462 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
463 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
464 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
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: vmv4r.v v12, v20
471 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
472 ; ZVFHMIN-NEXT: csrr a0, vlenb
473 ; ZVFHMIN-NEXT: slli a0, a0, 4
474 ; ZVFHMIN-NEXT: add a0, sp, a0
475 ; ZVFHMIN-NEXT: addi a0, a0, 16
476 ; ZVFHMIN-NEXT: vl8r.v v8, (a0) # Unknown-size Folded Reload
477 ; ZVFHMIN-NEXT: addi a0, sp, 16
478 ; ZVFHMIN-NEXT: vl8r.v v24, (a0) # Unknown-size Folded Reload
479 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
480 ; ZVFHMIN-NEXT: vfmadd.vv v16, v24, v8
481 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
482 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v0
483 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
484 ; ZVFHMIN-NEXT: csrr a0, vlenb
485 ; ZVFHMIN-NEXT: li a1, 24
486 ; ZVFHMIN-NEXT: mul a0, a0, a1
487 ; ZVFHMIN-NEXT: add sp, sp, a0
488 ; ZVFHMIN-NEXT: addi sp, sp, 16
490 %head = insertelement <vscale x 32 x half> poison, half %c, i32 0
491 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
492 %vd = call <vscale x 32 x half> @llvm.fma.v32f16(<vscale x 32 x half> %vb, <vscale x 32 x half> %splat, <vscale x 32 x half> %va)
493 ret <vscale x 32 x half> %vd
496 declare <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x float>)
498 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) {
499 ; CHECK-LABEL: vfmadd_vv_nxv1f32:
501 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
502 ; CHECK-NEXT: vfmadd.vv v8, v9, v10
504 %vd = call <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x float> %vc)
505 ret <vscale x 1 x float> %vd
508 define <vscale x 1 x float> @vfmadd_vf_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, float %c) {
509 ; CHECK-LABEL: vfmadd_vf_nxv1f32:
511 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
512 ; CHECK-NEXT: vfmadd.vf v8, fa0, v9
514 %head = insertelement <vscale x 1 x float> poison, float %c, i32 0
515 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
516 %vd = call <vscale x 1 x float> @llvm.fma.v1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %splat, <vscale x 1 x float> %vb)
517 ret <vscale x 1 x float> %vd
520 declare <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x float>)
522 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) {
523 ; CHECK-LABEL: vfmadd_vv_nxv2f32:
525 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
526 ; CHECK-NEXT: vfmadd.vv v8, v10, v9
528 %vd = call <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vc, <vscale x 2 x float> %vb)
529 ret <vscale x 2 x float> %vd
532 define <vscale x 2 x float> @vfmadd_vf_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, float %c) {
533 ; CHECK-LABEL: vfmadd_vf_nxv2f32:
535 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
536 ; CHECK-NEXT: vfmacc.vf v8, fa0, v9
538 %head = insertelement <vscale x 2 x float> poison, float %c, i32 0
539 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
540 %vd = call <vscale x 2 x float> @llvm.fma.v2f32(<vscale x 2 x float> %vb, <vscale x 2 x float> %splat, <vscale x 2 x float> %va)
541 ret <vscale x 2 x float> %vd
544 declare <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x float>)
546 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) {
547 ; CHECK-LABEL: vfmadd_vv_nxv4f32:
549 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
550 ; CHECK-NEXT: vfmadd.vv v8, v10, v12
552 %vd = call <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float> %vb, <vscale x 4 x float> %va, <vscale x 4 x float> %vc)
553 ret <vscale x 4 x float> %vd
556 define <vscale x 4 x float> @vfmadd_vf_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, float %c) {
557 ; CHECK-LABEL: vfmadd_vf_nxv4f32:
559 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
560 ; CHECK-NEXT: vfmadd.vf v8, fa0, v10
562 %head = insertelement <vscale x 4 x float> poison, float %c, i32 0
563 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
564 %vd = call <vscale x 4 x float> @llvm.fma.v4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %splat, <vscale x 4 x float> %vb)
565 ret <vscale x 4 x float> %vd
568 declare <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x float>)
570 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) {
571 ; CHECK-LABEL: vfmadd_vv_nxv8f32:
573 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
574 ; CHECK-NEXT: vfmacc.vv v8, v16, v12
576 %vd = call <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %vc, <vscale x 8 x float> %va)
577 ret <vscale x 8 x float> %vd
580 define <vscale x 8 x float> @vfmadd_vf_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, float %c) {
581 ; CHECK-LABEL: vfmadd_vf_nxv8f32:
583 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
584 ; CHECK-NEXT: vfmacc.vf v8, fa0, v12
586 %head = insertelement <vscale x 8 x float> poison, float %c, i32 0
587 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
588 %vd = call <vscale x 8 x float> @llvm.fma.v8f32(<vscale x 8 x float> %vb, <vscale x 8 x float> %splat, <vscale x 8 x float> %va)
589 ret <vscale x 8 x float> %vd
592 declare <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x float>)
594 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) {
595 ; CHECK-LABEL: vfmadd_vv_nxv16f32:
597 ; CHECK-NEXT: vl8re32.v v24, (a0)
598 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
599 ; CHECK-NEXT: vfmadd.vv v8, v24, v16
601 %vd = call <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float> %vc, <vscale x 16 x float> %va, <vscale x 16 x float> %vb)
602 ret <vscale x 16 x float> %vd
605 define <vscale x 16 x float> @vfmadd_vf_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, float %c) {
606 ; CHECK-LABEL: vfmadd_vf_nxv16f32:
608 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
609 ; CHECK-NEXT: vfmadd.vf v8, fa0, v16
611 %head = insertelement <vscale x 16 x float> poison, float %c, i32 0
612 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
613 %vd = call <vscale x 16 x float> @llvm.fma.v16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %splat, <vscale x 16 x float> %vb)
614 ret <vscale x 16 x float> %vd
617 declare <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x double>)
619 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) {
620 ; CHECK-LABEL: vfmadd_vv_nxv1f64:
622 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
623 ; CHECK-NEXT: vfmadd.vv v8, v9, v10
625 %vd = call <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x double> %vc)
626 ret <vscale x 1 x double> %vd
629 define <vscale x 1 x double> @vfmadd_vf_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, double %c) {
630 ; CHECK-LABEL: vfmadd_vf_nxv1f64:
632 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
633 ; CHECK-NEXT: vfmadd.vf v8, fa0, v9
635 %head = insertelement <vscale x 1 x double> poison, double %c, i32 0
636 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
637 %vd = call <vscale x 1 x double> @llvm.fma.v1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %splat, <vscale x 1 x double> %vb)
638 ret <vscale x 1 x double> %vd
641 declare <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x double>)
643 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) {
644 ; CHECK-LABEL: vfmadd_vv_nxv2f64:
646 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
647 ; CHECK-NEXT: vfmadd.vv v8, v12, v10
649 %vd = call <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vc, <vscale x 2 x double> %vb)
650 ret <vscale x 2 x double> %vd
653 define <vscale x 2 x double> @vfmadd_vf_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, double %c) {
654 ; CHECK-LABEL: vfmadd_vf_nxv2f64:
656 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
657 ; CHECK-NEXT: vfmacc.vf v8, fa0, v10
659 %head = insertelement <vscale x 2 x double> poison, double %c, i32 0
660 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
661 %vd = call <vscale x 2 x double> @llvm.fma.v2f64(<vscale x 2 x double> %vb, <vscale x 2 x double> %splat, <vscale x 2 x double> %va)
662 ret <vscale x 2 x double> %vd
665 declare <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double>, <vscale x 4 x double>, <vscale x 4 x double>)
667 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) {
668 ; CHECK-LABEL: vfmadd_vv_nxv4f64:
670 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
671 ; CHECK-NEXT: vfmadd.vv v8, v12, v16
673 %vd = call <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double> %vb, <vscale x 4 x double> %va, <vscale x 4 x double> %vc)
674 ret <vscale x 4 x double> %vd
677 define <vscale x 4 x double> @vfmadd_vf_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, double %c) {
678 ; CHECK-LABEL: vfmadd_vf_nxv4f64:
680 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
681 ; CHECK-NEXT: vfmadd.vf v8, fa0, v12
683 %head = insertelement <vscale x 4 x double> poison, double %c, i32 0
684 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
685 %vd = call <vscale x 4 x double> @llvm.fma.v4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %splat, <vscale x 4 x double> %vb)
686 ret <vscale x 4 x double> %vd
689 declare <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double>, <vscale x 8 x double>, <vscale x 8 x double>)
691 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) {
692 ; CHECK-LABEL: vfmadd_vv_nxv8f64:
694 ; CHECK-NEXT: vl8re64.v v24, (a0)
695 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
696 ; CHECK-NEXT: vfmacc.vv v8, v16, v24
698 %vd = call <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %vc, <vscale x 8 x double> %va)
699 ret <vscale x 8 x double> %vd
702 define <vscale x 8 x double> @vfmadd_vf_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, double %c) {
703 ; CHECK-LABEL: vfmadd_vf_nxv8f64:
705 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
706 ; CHECK-NEXT: vfmacc.vf v8, fa0, v16
708 %head = insertelement <vscale x 8 x double> poison, double %c, i32 0
709 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
710 %vd = call <vscale x 8 x double> @llvm.fma.v8f64(<vscale x 8 x double> %vb, <vscale x 8 x double> %splat, <vscale x 8 x double> %va)
711 ret <vscale x 8 x double> %vd