xref: /llvm-project/llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vfwmacc.ll (revision 1cb599835ccf7ee8b2d1d5a7f3107e19a26fc6f5)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=riscv32 -mattr=+d,+zvfh,+v -target-abi=ilp32d \
3; RUN:     -verify-machineinstrs < %s | FileCheck %s
4; RUN: llc -mtriple=riscv64 -mattr=+d,+zvfh,+v -target-abi=lp64d \
5; RUN:     -verify-machineinstrs < %s | FileCheck %s
6
7declare <1 x float> @llvm.fma.v1f32(<1 x float>, <1 x float>, <1 x float>)
8
9define <1 x float> @vfwmacc_vv_v1f32(<1 x float> %va, <1 x half> %vb, <1 x half> %vc) {
10; CHECK-LABEL: vfwmacc_vv_v1f32:
11; CHECK:       # %bb.0:
12; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
13; CHECK-NEXT:    vfwmacc.vv v8, v9, v10
14; CHECK-NEXT:    ret
15  %vd = fpext <1 x half> %vb to <1 x float>
16  %ve = fpext <1 x half> %vc to <1 x float>
17  %vf = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %ve, <1 x float> %va)
18  ret <1 x float> %vf
19}
20
21define <1 x float> @vfwmacc_vf_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
22; CHECK-LABEL: vfwmacc_vf_v1f32:
23; CHECK:       # %bb.0:
24; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
25; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
26; CHECK-NEXT:    ret
27  %head = insertelement <1 x half> poison, half %c, i32 0
28  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
29  %vd = fpext <1 x half> %vb to <1 x float>
30  %ve = fpext <1 x half> %splat to <1 x float>
31  %vf = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %ve, <1 x float> %va)
32  ret <1 x float> %vf
33}
34
35define <1 x float> @vfwnmacc_vv_v1f32(<1 x float> %va, <1 x half> %vb, <1 x half> %vc) {
36; CHECK-LABEL: vfwnmacc_vv_v1f32:
37; CHECK:       # %bb.0:
38; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
39; CHECK-NEXT:    vfwnmacc.vv v8, v9, v10
40; CHECK-NEXT:    ret
41  %vd = fpext <1 x half> %vb to <1 x float>
42  %ve = fpext <1 x half> %vc to <1 x float>
43  %vf = fneg <1 x float> %va
44  %vg = fneg <1 x float> %vd
45  %vh = call <1 x float> @llvm.fma.v1f32(<1 x float> %vg, <1 x float> %ve, <1 x float> %vf)
46  ret <1 x float> %vh
47}
48
49define <1 x float> @vfwnmacc_vf_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
50; CHECK-LABEL: vfwnmacc_vf_v1f32:
51; CHECK:       # %bb.0:
52; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
53; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
54; CHECK-NEXT:    ret
55  %head = insertelement <1 x half> poison, half %c, i32 0
56  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
57  %vd = fpext <1 x half> %vb to <1 x float>
58  %ve = fpext <1 x half> %splat to <1 x float>
59  %vf = fneg <1 x float> %va
60  %vg = fneg <1 x float> %vd
61  %vh = call <1 x float> @llvm.fma.v1f32(<1 x float> %vg, <1 x float> %ve, <1 x float> %vf)
62  ret <1 x float> %vh
63}
64
65define <1 x float> @vfwnmacc_fv_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
66; CHECK-LABEL: vfwnmacc_fv_v1f32:
67; CHECK:       # %bb.0:
68; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
69; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
70; CHECK-NEXT:    ret
71  %head = insertelement <1 x half> poison, half %c, i32 0
72  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
73  %vd = fpext <1 x half> %vb to <1 x float>
74  %ve = fpext <1 x half> %splat to <1 x float>
75  %vf = fneg <1 x float> %va
76  %vg = fneg <1 x float> %ve
77  %vh = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %vg, <1 x float> %vf)
78  ret <1 x float> %vh
79}
80
81define <1 x float> @vfwmsac_vv_v1f32(<1 x float> %va, <1 x half> %vb, <1 x half> %vc) {
82; CHECK-LABEL: vfwmsac_vv_v1f32:
83; CHECK:       # %bb.0:
84; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
85; CHECK-NEXT:    vfwmsac.vv v8, v9, v10
86; CHECK-NEXT:    ret
87  %vd = fpext <1 x half> %vb to <1 x float>
88  %ve = fpext <1 x half> %vc to <1 x float>
89  %vf = fneg <1 x float> %va
90  %vg = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %ve, <1 x float> %vf)
91  ret <1 x float> %vg
92}
93
94define <1 x float> @vfwmsac_vf_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
95; CHECK-LABEL: vfwmsac_vf_v1f32:
96; CHECK:       # %bb.0:
97; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
98; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
99; CHECK-NEXT:    ret
100  %head = insertelement <1 x half> poison, half %c, i32 0
101  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
102  %vd = fpext <1 x half> %vb to <1 x float>
103  %ve = fpext <1 x half> %splat to <1 x float>
104  %vf = fneg <1 x float> %va
105  %vg = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %ve, <1 x float> %vf)
106  ret <1 x float> %vg
107}
108
109define <1 x float> @vfwnmsac_vv_v1f32(<1 x float> %va, <1 x half> %vb, <1 x half> %vc) {
110; CHECK-LABEL: vfwnmsac_vv_v1f32:
111; CHECK:       # %bb.0:
112; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
113; CHECK-NEXT:    vfwnmsac.vv v8, v9, v10
114; CHECK-NEXT:    ret
115  %vd = fpext <1 x half> %vb to <1 x float>
116  %ve = fpext <1 x half> %vc to <1 x float>
117  %vf = fneg <1 x float> %vd
118  %vg = call <1 x float> @llvm.fma.v1f32(<1 x float> %vf, <1 x float> %ve, <1 x float> %va)
119  ret <1 x float> %vg
120}
121
122define <1 x float> @vfwnmsac_vf_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
123; CHECK-LABEL: vfwnmsac_vf_v1f32:
124; CHECK:       # %bb.0:
125; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
126; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
127; CHECK-NEXT:    ret
128  %head = insertelement <1 x half> poison, half %c, i32 0
129  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
130  %vd = fpext <1 x half> %vb to <1 x float>
131  %ve = fpext <1 x half> %splat to <1 x float>
132  %vf = fneg <1 x float> %vd
133  %vg = call <1 x float> @llvm.fma.v1f32(<1 x float> %vf, <1 x float> %ve, <1 x float> %va)
134  ret <1 x float> %vg
135}
136
137define <1 x float> @vfwnmsac_fv_v1f32(<1 x float> %va, <1 x half> %vb, half %c) {
138; CHECK-LABEL: vfwnmsac_fv_v1f32:
139; CHECK:       # %bb.0:
140; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
141; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
142; CHECK-NEXT:    ret
143  %head = insertelement <1 x half> poison, half %c, i32 0
144  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
145  %vd = fpext <1 x half> %vb to <1 x float>
146  %ve = fpext <1 x half> %splat to <1 x float>
147  %vf = fneg <1 x float> %ve
148  %vg = call <1 x float> @llvm.fma.v1f32(<1 x float> %vd, <1 x float> %vf, <1 x float> %va)
149  ret <1 x float> %vg
150}
151
152declare <2 x float> @llvm.fma.v2f32(<2 x float>, <2 x float>, <2 x float>)
153
154define <2 x float> @vfwmacc_vv_v2f32(<2 x float> %va, <2 x half> %vb, <2 x half> %vc) {
155; CHECK-LABEL: vfwmacc_vv_v2f32:
156; CHECK:       # %bb.0:
157; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
158; CHECK-NEXT:    vfwmacc.vv v8, v9, v10
159; CHECK-NEXT:    ret
160  %vd = fpext <2 x half> %vb to <2 x float>
161  %ve = fpext <2 x half> %vc to <2 x float>
162  %vf = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %ve, <2 x float> %va)
163  ret <2 x float> %vf
164}
165
166define <2 x float> @vfwmacc_vf_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
167; CHECK-LABEL: vfwmacc_vf_v2f32:
168; CHECK:       # %bb.0:
169; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
170; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
171; CHECK-NEXT:    ret
172  %head = insertelement <2 x half> poison, half %c, i32 0
173  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
174  %vd = fpext <2 x half> %vb to <2 x float>
175  %ve = fpext <2 x half> %splat to <2 x float>
176  %vf = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %ve, <2 x float> %va)
177  ret <2 x float> %vf
178}
179
180define <2 x float> @vfwnmacc_vv_v2f32(<2 x float> %va, <2 x half> %vb, <2 x half> %vc) {
181; CHECK-LABEL: vfwnmacc_vv_v2f32:
182; CHECK:       # %bb.0:
183; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
184; CHECK-NEXT:    vfwnmacc.vv v8, v9, v10
185; CHECK-NEXT:    ret
186  %vd = fpext <2 x half> %vb to <2 x float>
187  %ve = fpext <2 x half> %vc to <2 x float>
188  %vf = fneg <2 x float> %va
189  %vg = fneg <2 x float> %vd
190  %vh = call <2 x float> @llvm.fma.v2f32(<2 x float> %vg, <2 x float> %ve, <2 x float> %vf)
191  ret <2 x float> %vh
192}
193
194define <2 x float> @vfwnmacc_vf_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
195; CHECK-LABEL: vfwnmacc_vf_v2f32:
196; CHECK:       # %bb.0:
197; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
198; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
199; CHECK-NEXT:    ret
200  %head = insertelement <2 x half> poison, half %c, i32 0
201  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
202  %vd = fpext <2 x half> %vb to <2 x float>
203  %ve = fpext <2 x half> %splat to <2 x float>
204  %vf = fneg <2 x float> %va
205  %vg = fneg <2 x float> %vd
206  %vh = call <2 x float> @llvm.fma.v2f32(<2 x float> %vg, <2 x float> %ve, <2 x float> %vf)
207  ret <2 x float> %vh
208}
209
210define <2 x float> @vfwnmacc_fv_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
211; CHECK-LABEL: vfwnmacc_fv_v2f32:
212; CHECK:       # %bb.0:
213; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
214; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
215; CHECK-NEXT:    ret
216  %head = insertelement <2 x half> poison, half %c, i32 0
217  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
218  %vd = fpext <2 x half> %vb to <2 x float>
219  %ve = fpext <2 x half> %splat to <2 x float>
220  %vf = fneg <2 x float> %va
221  %vg = fneg <2 x float> %ve
222  %vh = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %vg, <2 x float> %vf)
223  ret <2 x float> %vh
224}
225
226define <2 x float> @vfwmsac_vv_v2f32(<2 x float> %va, <2 x half> %vb, <2 x half> %vc) {
227; CHECK-LABEL: vfwmsac_vv_v2f32:
228; CHECK:       # %bb.0:
229; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
230; CHECK-NEXT:    vfwmsac.vv v8, v9, v10
231; CHECK-NEXT:    ret
232  %vd = fpext <2 x half> %vb to <2 x float>
233  %ve = fpext <2 x half> %vc to <2 x float>
234  %vf = fneg <2 x float> %va
235  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %ve, <2 x float> %vf)
236  ret <2 x float> %vg
237}
238
239define <2 x float> @vfwmsac_vf_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
240; CHECK-LABEL: vfwmsac_vf_v2f32:
241; CHECK:       # %bb.0:
242; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
243; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
244; CHECK-NEXT:    ret
245  %head = insertelement <2 x half> poison, half %c, i32 0
246  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
247  %vd = fpext <2 x half> %vb to <2 x float>
248  %ve = fpext <2 x half> %splat to <2 x float>
249  %vf = fneg <2 x float> %va
250  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %ve, <2 x float> %vf)
251  ret <2 x float> %vg
252}
253
254define <2 x float> @vfwnmsac_vv_v2f32(<2 x float> %va, <2 x half> %vb, <2 x half> %vc) {
255; CHECK-LABEL: vfwnmsac_vv_v2f32:
256; CHECK:       # %bb.0:
257; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
258; CHECK-NEXT:    vfwnmsac.vv v8, v9, v10
259; CHECK-NEXT:    ret
260  %vd = fpext <2 x half> %vb to <2 x float>
261  %ve = fpext <2 x half> %vc to <2 x float>
262  %vf = fneg <2 x float> %vd
263  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vf, <2 x float> %ve, <2 x float> %va)
264  ret <2 x float> %vg
265}
266
267define <2 x float> @vfwnmsac_vf_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
268; CHECK-LABEL: vfwnmsac_vf_v2f32:
269; CHECK:       # %bb.0:
270; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
271; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
272; CHECK-NEXT:    ret
273  %head = insertelement <2 x half> poison, half %c, i32 0
274  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
275  %vd = fpext <2 x half> %vb to <2 x float>
276  %ve = fpext <2 x half> %splat to <2 x float>
277  %vf = fneg <2 x float> %vd
278  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vf, <2 x float> %ve, <2 x float> %va)
279  ret <2 x float> %vg
280}
281
282define <2 x float> @vfwnmsac_fv_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
283; CHECK-LABEL: vfwnmsac_fv_v2f32:
284; CHECK:       # %bb.0:
285; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
286; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
287; CHECK-NEXT:    ret
288  %head = insertelement <2 x half> poison, half %c, i32 0
289  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
290  %vd = fpext <2 x half> %vb to <2 x float>
291  %ve = fpext <2 x half> %splat to <2 x float>
292  %vf = fneg <2 x float> %ve
293  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %vf, <2 x float> %va)
294  ret <2 x float> %vg
295}
296
297
298declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)
299
300define <4 x float> @vfwmacc_vv_v4f32(<4 x float> %va, <4 x half> %vb, <4 x half> %vc) {
301; CHECK-LABEL: vfwmacc_vv_v4f32:
302; CHECK:       # %bb.0:
303; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
304; CHECK-NEXT:    vfwmacc.vv v8, v9, v10
305; CHECK-NEXT:    ret
306  %vd = fpext <4 x half> %vb to <4 x float>
307  %ve = fpext <4 x half> %vc to <4 x float>
308  %vf = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %ve, <4 x float> %va)
309  ret <4 x float> %vf
310}
311
312define <4 x float> @vfwmacc_vf_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
313; CHECK-LABEL: vfwmacc_vf_v4f32:
314; CHECK:       # %bb.0:
315; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
316; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
317; CHECK-NEXT:    ret
318  %head = insertelement <4 x half> poison, half %c, i32 0
319  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
320  %vd = fpext <4 x half> %vb to <4 x float>
321  %ve = fpext <4 x half> %splat to <4 x float>
322  %vf = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %ve, <4 x float> %va)
323  ret <4 x float> %vf
324}
325
326define <4 x float> @vfwnmacc_vv_v4f32(<4 x float> %va, <4 x half> %vb, <4 x half> %vc) {
327; CHECK-LABEL: vfwnmacc_vv_v4f32:
328; CHECK:       # %bb.0:
329; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
330; CHECK-NEXT:    vfwnmacc.vv v8, v9, v10
331; CHECK-NEXT:    ret
332  %vd = fpext <4 x half> %vb to <4 x float>
333  %ve = fpext <4 x half> %vc to <4 x float>
334  %vf = fneg <4 x float> %va
335  %vg = fneg <4 x float> %vd
336  %vh = call <4 x float> @llvm.fma.v4f32(<4 x float> %vg, <4 x float> %ve, <4 x float> %vf)
337  ret <4 x float> %vh
338}
339
340define <4 x float> @vfwnmacc_vf_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
341; CHECK-LABEL: vfwnmacc_vf_v4f32:
342; CHECK:       # %bb.0:
343; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
344; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
345; CHECK-NEXT:    ret
346  %head = insertelement <4 x half> poison, half %c, i32 0
347  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
348  %vd = fpext <4 x half> %vb to <4 x float>
349  %ve = fpext <4 x half> %splat to <4 x float>
350  %vf = fneg <4 x float> %va
351  %vg = fneg <4 x float> %vd
352  %vh = call <4 x float> @llvm.fma.v4f32(<4 x float> %vg, <4 x float> %ve, <4 x float> %vf)
353  ret <4 x float> %vh
354}
355
356define <4 x float> @vfwnmacc_fv_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
357; CHECK-LABEL: vfwnmacc_fv_v4f32:
358; CHECK:       # %bb.0:
359; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
360; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
361; CHECK-NEXT:    ret
362  %head = insertelement <4 x half> poison, half %c, i32 0
363  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
364  %vd = fpext <4 x half> %vb to <4 x float>
365  %ve = fpext <4 x half> %splat to <4 x float>
366  %vf = fneg <4 x float> %va
367  %vg = fneg <4 x float> %ve
368  %vh = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %vg, <4 x float> %vf)
369  ret <4 x float> %vh
370}
371
372define <4 x float> @vfwmsac_vv_v4f32(<4 x float> %va, <4 x half> %vb, <4 x half> %vc) {
373; CHECK-LABEL: vfwmsac_vv_v4f32:
374; CHECK:       # %bb.0:
375; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
376; CHECK-NEXT:    vfwmsac.vv v8, v9, v10
377; CHECK-NEXT:    ret
378  %vd = fpext <4 x half> %vb to <4 x float>
379  %ve = fpext <4 x half> %vc to <4 x float>
380  %vf = fneg <4 x float> %va
381  %vg = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %ve, <4 x float> %vf)
382  ret <4 x float> %vg
383}
384
385define <4 x float> @vfwmsac_vf_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
386; CHECK-LABEL: vfwmsac_vf_v4f32:
387; CHECK:       # %bb.0:
388; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
389; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
390; CHECK-NEXT:    ret
391  %head = insertelement <4 x half> poison, half %c, i32 0
392  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
393  %vd = fpext <4 x half> %vb to <4 x float>
394  %ve = fpext <4 x half> %splat to <4 x float>
395  %vf = fneg <4 x float> %va
396  %vg = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %ve, <4 x float> %vf)
397  ret <4 x float> %vg
398}
399
400define <4 x float> @vfwnmsac_vv_v4f32(<4 x float> %va, <4 x half> %vb, <4 x half> %vc) {
401; CHECK-LABEL: vfwnmsac_vv_v4f32:
402; CHECK:       # %bb.0:
403; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
404; CHECK-NEXT:    vfwnmsac.vv v8, v9, v10
405; CHECK-NEXT:    ret
406  %vd = fpext <4 x half> %vb to <4 x float>
407  %ve = fpext <4 x half> %vc to <4 x float>
408  %vf = fneg <4 x float> %vd
409  %vg = call <4 x float> @llvm.fma.v4f32(<4 x float> %vf, <4 x float> %ve, <4 x float> %va)
410  ret <4 x float> %vg
411}
412
413define <4 x float> @vfwnmsac_vf_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
414; CHECK-LABEL: vfwnmsac_vf_v4f32:
415; CHECK:       # %bb.0:
416; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
417; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
418; CHECK-NEXT:    ret
419  %head = insertelement <4 x half> poison, half %c, i32 0
420  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
421  %vd = fpext <4 x half> %vb to <4 x float>
422  %ve = fpext <4 x half> %splat to <4 x float>
423  %vf = fneg <4 x float> %vd
424  %vg = call <4 x float> @llvm.fma.v4f32(<4 x float> %vf, <4 x float> %ve, <4 x float> %va)
425  ret <4 x float> %vg
426}
427
428define <4 x float> @vfwnmsac_fv_v4f32(<4 x float> %va, <4 x half> %vb, half %c) {
429; CHECK-LABEL: vfwnmsac_fv_v4f32:
430; CHECK:       # %bb.0:
431; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
432; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
433; CHECK-NEXT:    ret
434  %head = insertelement <4 x half> poison, half %c, i32 0
435  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
436  %vd = fpext <4 x half> %vb to <4 x float>
437  %ve = fpext <4 x half> %splat to <4 x float>
438  %vf = fneg <4 x float> %ve
439  %vg = call <4 x float> @llvm.fma.v4f32(<4 x float> %vd, <4 x float> %vf, <4 x float> %va)
440  ret <4 x float> %vg
441}
442
443declare <8 x float> @llvm.fma.v8f32(<8 x float>, <8 x float>, <8 x float>)
444
445define <8 x float> @vfwmacc_vv_v8f32(<8 x float> %va, <8 x half> %vb, <8 x half> %vc) {
446; CHECK-LABEL: vfwmacc_vv_v8f32:
447; CHECK:       # %bb.0:
448; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
449; CHECK-NEXT:    vfwmacc.vv v8, v10, v11
450; CHECK-NEXT:    ret
451  %vd = fpext <8 x half> %vb to <8 x float>
452  %ve = fpext <8 x half> %vc to <8 x float>
453  %vf = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %ve, <8 x float> %va)
454  ret <8 x float> %vf
455}
456
457define <8 x float> @vfwmacc_vf_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
458; CHECK-LABEL: vfwmacc_vf_v8f32:
459; CHECK:       # %bb.0:
460; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
461; CHECK-NEXT:    vfwmacc.vf v8, fa0, v10
462; CHECK-NEXT:    ret
463  %head = insertelement <8 x half> poison, half %c, i32 0
464  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
465  %vd = fpext <8 x half> %vb to <8 x float>
466  %ve = fpext <8 x half> %splat to <8 x float>
467  %vf = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %ve, <8 x float> %va)
468  ret <8 x float> %vf
469}
470
471define <8 x float> @vfwnmacc_vv_v8f32(<8 x float> %va, <8 x half> %vb, <8 x half> %vc) {
472; CHECK-LABEL: vfwnmacc_vv_v8f32:
473; CHECK:       # %bb.0:
474; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
475; CHECK-NEXT:    vfwnmacc.vv v8, v10, v11
476; CHECK-NEXT:    ret
477  %vd = fpext <8 x half> %vb to <8 x float>
478  %ve = fpext <8 x half> %vc to <8 x float>
479  %vf = fneg <8 x float> %va
480  %vg = fneg <8 x float> %vd
481  %vh = call <8 x float> @llvm.fma.v8f32(<8 x float> %vg, <8 x float> %ve, <8 x float> %vf)
482  ret <8 x float> %vh
483}
484
485define <8 x float> @vfwnmacc_vf_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
486; CHECK-LABEL: vfwnmacc_vf_v8f32:
487; CHECK:       # %bb.0:
488; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
489; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v10
490; CHECK-NEXT:    ret
491  %head = insertelement <8 x half> poison, half %c, i32 0
492  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
493  %vd = fpext <8 x half> %vb to <8 x float>
494  %ve = fpext <8 x half> %splat to <8 x float>
495  %vf = fneg <8 x float> %va
496  %vg = fneg <8 x float> %vd
497  %vh = call <8 x float> @llvm.fma.v8f32(<8 x float> %vg, <8 x float> %ve, <8 x float> %vf)
498  ret <8 x float> %vh
499}
500
501define <8 x float> @vfwnmacc_fv_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
502; CHECK-LABEL: vfwnmacc_fv_v8f32:
503; CHECK:       # %bb.0:
504; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
505; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v10
506; CHECK-NEXT:    ret
507  %head = insertelement <8 x half> poison, half %c, i32 0
508  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
509  %vd = fpext <8 x half> %vb to <8 x float>
510  %ve = fpext <8 x half> %splat to <8 x float>
511  %vf = fneg <8 x float> %va
512  %vg = fneg <8 x float> %ve
513  %vh = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %vg, <8 x float> %vf)
514  ret <8 x float> %vh
515}
516
517define <8 x float> @vfwmsac_vv_v8f32(<8 x float> %va, <8 x half> %vb, <8 x half> %vc) {
518; CHECK-LABEL: vfwmsac_vv_v8f32:
519; CHECK:       # %bb.0:
520; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
521; CHECK-NEXT:    vfwmsac.vv v8, v10, v11
522; CHECK-NEXT:    ret
523  %vd = fpext <8 x half> %vb to <8 x float>
524  %ve = fpext <8 x half> %vc to <8 x float>
525  %vf = fneg <8 x float> %va
526  %vg = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %ve, <8 x float> %vf)
527  ret <8 x float> %vg
528}
529
530define <8 x float> @vfwmsac_vf_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
531; CHECK-LABEL: vfwmsac_vf_v8f32:
532; CHECK:       # %bb.0:
533; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
534; CHECK-NEXT:    vfwmsac.vf v8, fa0, v10
535; CHECK-NEXT:    ret
536  %head = insertelement <8 x half> poison, half %c, i32 0
537  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
538  %vd = fpext <8 x half> %vb to <8 x float>
539  %ve = fpext <8 x half> %splat to <8 x float>
540  %vf = fneg <8 x float> %va
541  %vg = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %ve, <8 x float> %vf)
542  ret <8 x float> %vg
543}
544
545define <8 x float> @vfwnmsac_vv_v8f32(<8 x float> %va, <8 x half> %vb, <8 x half> %vc) {
546; CHECK-LABEL: vfwnmsac_vv_v8f32:
547; CHECK:       # %bb.0:
548; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
549; CHECK-NEXT:    vfwnmsac.vv v8, v10, v11
550; CHECK-NEXT:    ret
551  %vd = fpext <8 x half> %vb to <8 x float>
552  %ve = fpext <8 x half> %vc to <8 x float>
553  %vf = fneg <8 x float> %vd
554  %vg = call <8 x float> @llvm.fma.v8f32(<8 x float> %vf, <8 x float> %ve, <8 x float> %va)
555  ret <8 x float> %vg
556}
557
558define <8 x float> @vfwnmsac_vf_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
559; CHECK-LABEL: vfwnmsac_vf_v8f32:
560; CHECK:       # %bb.0:
561; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
562; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v10
563; CHECK-NEXT:    ret
564  %head = insertelement <8 x half> poison, half %c, i32 0
565  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
566  %vd = fpext <8 x half> %vb to <8 x float>
567  %ve = fpext <8 x half> %splat to <8 x float>
568  %vf = fneg <8 x float> %vd
569  %vg = call <8 x float> @llvm.fma.v8f32(<8 x float> %vf, <8 x float> %ve, <8 x float> %va)
570  ret <8 x float> %vg
571}
572
573define <8 x float> @vfwnmsac_fv_v8f32(<8 x float> %va, <8 x half> %vb, half %c) {
574; CHECK-LABEL: vfwnmsac_fv_v8f32:
575; CHECK:       # %bb.0:
576; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
577; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v10
578; CHECK-NEXT:    ret
579  %head = insertelement <8 x half> poison, half %c, i32 0
580  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
581  %vd = fpext <8 x half> %vb to <8 x float>
582  %ve = fpext <8 x half> %splat to <8 x float>
583  %vf = fneg <8 x float> %ve
584  %vg = call <8 x float> @llvm.fma.v8f32(<8 x float> %vd, <8 x float> %vf, <8 x float> %va)
585  ret <8 x float> %vg
586}
587
588declare <16 x float> @llvm.fma.v16f32(<16 x float>, <16 x float>, <16 x float>)
589
590define <16 x float> @vfwmacc_vv_v16f32(<16 x float> %va, <16 x half> %vb, <16 x half> %vc) {
591; CHECK-LABEL: vfwmacc_vv_v16f32:
592; CHECK:       # %bb.0:
593; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
594; CHECK-NEXT:    vfwmacc.vv v8, v12, v14
595; CHECK-NEXT:    ret
596  %vd = fpext <16 x half> %vb to <16 x float>
597  %ve = fpext <16 x half> %vc to <16 x float>
598  %vf = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %ve, <16 x float> %va)
599  ret <16 x float> %vf
600}
601
602define <16 x float> @vfwmacc_vf_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
603; CHECK-LABEL: vfwmacc_vf_v16f32:
604; CHECK:       # %bb.0:
605; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
606; CHECK-NEXT:    vfwmacc.vf v8, fa0, v12
607; CHECK-NEXT:    ret
608  %head = insertelement <16 x half> poison, half %c, i32 0
609  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
610  %vd = fpext <16 x half> %vb to <16 x float>
611  %ve = fpext <16 x half> %splat to <16 x float>
612  %vf = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %ve, <16 x float> %va)
613  ret <16 x float> %vf
614}
615
616define <16 x float> @vfwnmacc_vv_v16f32(<16 x float> %va, <16 x half> %vb, <16 x half> %vc) {
617; CHECK-LABEL: vfwnmacc_vv_v16f32:
618; CHECK:       # %bb.0:
619; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
620; CHECK-NEXT:    vfwnmacc.vv v8, v12, v14
621; CHECK-NEXT:    ret
622  %vd = fpext <16 x half> %vb to <16 x float>
623  %ve = fpext <16 x half> %vc to <16 x float>
624  %vf = fneg <16 x float> %va
625  %vg = fneg <16 x float> %vd
626  %vh = call <16 x float> @llvm.fma.v16f32(<16 x float> %vg, <16 x float> %ve, <16 x float> %vf)
627  ret <16 x float> %vh
628}
629
630define <16 x float> @vfwnmacc_vf_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
631; CHECK-LABEL: vfwnmacc_vf_v16f32:
632; CHECK:       # %bb.0:
633; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
634; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v12
635; CHECK-NEXT:    ret
636  %head = insertelement <16 x half> poison, half %c, i32 0
637  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
638  %vd = fpext <16 x half> %vb to <16 x float>
639  %ve = fpext <16 x half> %splat to <16 x float>
640  %vf = fneg <16 x float> %va
641  %vg = fneg <16 x float> %vd
642  %vh = call <16 x float> @llvm.fma.v16f32(<16 x float> %vg, <16 x float> %ve, <16 x float> %vf)
643  ret <16 x float> %vh
644}
645
646define <16 x float> @vfwnmacc_fv_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
647; CHECK-LABEL: vfwnmacc_fv_v16f32:
648; CHECK:       # %bb.0:
649; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
650; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v12
651; CHECK-NEXT:    ret
652  %head = insertelement <16 x half> poison, half %c, i32 0
653  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
654  %vd = fpext <16 x half> %vb to <16 x float>
655  %ve = fpext <16 x half> %splat to <16 x float>
656  %vf = fneg <16 x float> %va
657  %vg = fneg <16 x float> %ve
658  %vh = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %vg, <16 x float> %vf)
659  ret <16 x float> %vh
660}
661
662define <16 x float> @vfwmsac_vv_v16f32(<16 x float> %va, <16 x half> %vb, <16 x half> %vc) {
663; CHECK-LABEL: vfwmsac_vv_v16f32:
664; CHECK:       # %bb.0:
665; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
666; CHECK-NEXT:    vfwmsac.vv v8, v12, v14
667; CHECK-NEXT:    ret
668  %vd = fpext <16 x half> %vb to <16 x float>
669  %ve = fpext <16 x half> %vc to <16 x float>
670  %vf = fneg <16 x float> %va
671  %vg = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %ve, <16 x float> %vf)
672  ret <16 x float> %vg
673}
674
675define <16 x float> @vfwmsac_vf_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
676; CHECK-LABEL: vfwmsac_vf_v16f32:
677; CHECK:       # %bb.0:
678; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
679; CHECK-NEXT:    vfwmsac.vf v8, fa0, v12
680; CHECK-NEXT:    ret
681  %head = insertelement <16 x half> poison, half %c, i32 0
682  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
683  %vd = fpext <16 x half> %vb to <16 x float>
684  %ve = fpext <16 x half> %splat to <16 x float>
685  %vf = fneg <16 x float> %va
686  %vg = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %ve, <16 x float> %vf)
687  ret <16 x float> %vg
688}
689
690define <16 x float> @vfwnmsac_vv_v16f32(<16 x float> %va, <16 x half> %vb, <16 x half> %vc) {
691; CHECK-LABEL: vfwnmsac_vv_v16f32:
692; CHECK:       # %bb.0:
693; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
694; CHECK-NEXT:    vfwnmsac.vv v8, v12, v14
695; CHECK-NEXT:    ret
696  %vd = fpext <16 x half> %vb to <16 x float>
697  %ve = fpext <16 x half> %vc to <16 x float>
698  %vf = fneg <16 x float> %vd
699  %vg = call <16 x float> @llvm.fma.v16f32(<16 x float> %vf, <16 x float> %ve, <16 x float> %va)
700  ret <16 x float> %vg
701}
702
703define <16 x float> @vfwnmsac_vf_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
704; CHECK-LABEL: vfwnmsac_vf_v16f32:
705; CHECK:       # %bb.0:
706; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
707; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v12
708; CHECK-NEXT:    ret
709  %head = insertelement <16 x half> poison, half %c, i32 0
710  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
711  %vd = fpext <16 x half> %vb to <16 x float>
712  %ve = fpext <16 x half> %splat to <16 x float>
713  %vf = fneg <16 x float> %vd
714  %vg = call <16 x float> @llvm.fma.v16f32(<16 x float> %vf, <16 x float> %ve, <16 x float> %va)
715  ret <16 x float> %vg
716}
717
718define <16 x float> @vfwnmsac_fv_v16f32(<16 x float> %va, <16 x half> %vb, half %c) {
719; CHECK-LABEL: vfwnmsac_fv_v16f32:
720; CHECK:       # %bb.0:
721; CHECK-NEXT:    vsetivli zero, 16, e16, m2, ta, ma
722; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v12
723; CHECK-NEXT:    ret
724  %head = insertelement <16 x half> poison, half %c, i32 0
725  %splat = shufflevector <16 x half> %head, <16 x half> poison, <16 x i32> zeroinitializer
726  %vd = fpext <16 x half> %vb to <16 x float>
727  %ve = fpext <16 x half> %splat to <16 x float>
728  %vf = fneg <16 x float> %ve
729  %vg = call <16 x float> @llvm.fma.v16f32(<16 x float> %vd, <16 x float> %vf, <16 x float> %va)
730  ret <16 x float> %vg
731}
732
733declare <1 x double> @llvm.fma.v1f64(<1 x double>, <1 x double>, <1 x double>)
734
735define <1 x double> @vfwmacc_vv_v1f64(<1 x double> %va, <1 x float> %vb, <1 x float> %vc) {
736; CHECK-LABEL: vfwmacc_vv_v1f64:
737; CHECK:       # %bb.0:
738; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
739; CHECK-NEXT:    vfwmacc.vv v8, v9, v10
740; CHECK-NEXT:    ret
741  %vd = fpext <1 x float> %vb to <1 x double>
742  %ve = fpext <1 x float> %vc to <1 x double>
743  %vf = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %va)
744  ret <1 x double> %vf
745}
746
747define <1 x double> @vfwmacc_vf_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
748; CHECK-LABEL: vfwmacc_vf_v1f64:
749; CHECK:       # %bb.0:
750; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
751; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
752; CHECK-NEXT:    ret
753  %head = insertelement <1 x float> poison, float %c, i32 0
754  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
755  %vd = fpext <1 x float> %vb to <1 x double>
756  %ve = fpext <1 x float> %splat to <1 x double>
757  %vf = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %va)
758  ret <1 x double> %vf
759}
760
761define <1 x double> @vfwnmacc_vv_v1f64(<1 x double> %va, <1 x float> %vb, <1 x float> %vc) {
762; CHECK-LABEL: vfwnmacc_vv_v1f64:
763; CHECK:       # %bb.0:
764; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
765; CHECK-NEXT:    vfwnmacc.vv v8, v9, v10
766; CHECK-NEXT:    ret
767  %vd = fpext <1 x float> %vb to <1 x double>
768  %ve = fpext <1 x float> %vc to <1 x double>
769  %vf = fneg <1 x double> %va
770  %vg = fneg <1 x double> %vd
771  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vg, <1 x double> %ve, <1 x double> %vf)
772  ret <1 x double> %vh
773}
774
775define <1 x double> @vfwnmacc_vf_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
776; CHECK-LABEL: vfwnmacc_vf_v1f64:
777; CHECK:       # %bb.0:
778; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
779; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
780; CHECK-NEXT:    ret
781  %head = insertelement <1 x float> poison, float %c, i32 0
782  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
783  %vd = fpext <1 x float> %vb to <1 x double>
784  %ve = fpext <1 x float> %splat to <1 x double>
785  %vf = fneg <1 x double> %va
786  %vg = fneg <1 x double> %vd
787  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vg, <1 x double> %ve, <1 x double> %vf)
788  ret <1 x double> %vh
789}
790
791define <1 x double> @vfwnmacc_fv_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
792; CHECK-LABEL: vfwnmacc_fv_v1f64:
793; CHECK:       # %bb.0:
794; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
795; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
796; CHECK-NEXT:    ret
797  %head = insertelement <1 x float> poison, float %c, i32 0
798  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
799  %vd = fpext <1 x float> %vb to <1 x double>
800  %ve = fpext <1 x float> %splat to <1 x double>
801  %vf = fneg <1 x double> %va
802  %vg = fneg <1 x double> %ve
803  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %vg, <1 x double> %vf)
804  ret <1 x double> %vh
805}
806
807define <1 x double> @vfwmsac_vv_v1f64(<1 x double> %va, <1 x float> %vb, <1 x float> %vc) {
808; CHECK-LABEL: vfwmsac_vv_v1f64:
809; CHECK:       # %bb.0:
810; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
811; CHECK-NEXT:    vfwmsac.vv v8, v9, v10
812; CHECK-NEXT:    ret
813  %vd = fpext <1 x float> %vb to <1 x double>
814  %ve = fpext <1 x float> %vc to <1 x double>
815  %vf = fneg <1 x double> %va
816  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %vf)
817  ret <1 x double> %vg
818}
819
820define <1 x double> @vfwmsac_vf_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
821; CHECK-LABEL: vfwmsac_vf_v1f64:
822; CHECK:       # %bb.0:
823; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
824; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
825; CHECK-NEXT:    ret
826  %head = insertelement <1 x float> poison, float %c, i32 0
827  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
828  %vd = fpext <1 x float> %vb to <1 x double>
829  %ve = fpext <1 x float> %splat to <1 x double>
830  %vf = fneg <1 x double> %va
831  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %vf)
832  ret <1 x double> %vg
833}
834
835define <1 x double> @vfwnmsac_vv_v1f64(<1 x double> %va, <1 x float> %vb, <1 x float> %vc) {
836; CHECK-LABEL: vfwnmsac_vv_v1f64:
837; CHECK:       # %bb.0:
838; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
839; CHECK-NEXT:    vfwnmsac.vv v8, v9, v10
840; CHECK-NEXT:    ret
841  %vd = fpext <1 x float> %vb to <1 x double>
842  %ve = fpext <1 x float> %vc to <1 x double>
843  %vf = fneg <1 x double> %vd
844  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vf, <1 x double> %ve, <1 x double> %va)
845  ret <1 x double> %vg
846}
847
848define <1 x double> @vfwnmsac_vf_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
849; CHECK-LABEL: vfwnmsac_vf_v1f64:
850; CHECK:       # %bb.0:
851; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
852; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
853; CHECK-NEXT:    ret
854  %head = insertelement <1 x float> poison, float %c, i32 0
855  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
856  %vd = fpext <1 x float> %vb to <1 x double>
857  %ve = fpext <1 x float> %splat to <1 x double>
858  %vf = fneg <1 x double> %vd
859  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vf, <1 x double> %ve, <1 x double> %va)
860  ret <1 x double> %vg
861}
862
863define <1 x double> @vfwnmsac_fv_v1f64(<1 x double> %va, <1 x float> %vb, float %c) {
864; CHECK-LABEL: vfwnmsac_fv_v1f64:
865; CHECK:       # %bb.0:
866; CHECK-NEXT:    vsetivli zero, 1, e32, mf2, ta, ma
867; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
868; CHECK-NEXT:    ret
869  %head = insertelement <1 x float> poison, float %c, i32 0
870  %splat = shufflevector <1 x float> %head, <1 x float> poison, <1 x i32> zeroinitializer
871  %vd = fpext <1 x float> %vb to <1 x double>
872  %ve = fpext <1 x float> %splat to <1 x double>
873  %vf = fneg <1 x double> %ve
874  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %vf, <1 x double> %va)
875  ret <1 x double> %vg
876}
877
878declare <2 x double> @llvm.fma.v2f64(<2 x double>, <2 x double>, <2 x double>)
879
880define <2 x double> @vfwmacc_vv_v2f64(<2 x double> %va, <2 x float> %vb, <2 x float> %vc) {
881; CHECK-LABEL: vfwmacc_vv_v2f64:
882; CHECK:       # %bb.0:
883; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
884; CHECK-NEXT:    vfwmacc.vv v8, v9, v10
885; CHECK-NEXT:    ret
886  %vd = fpext <2 x float> %vb to <2 x double>
887  %ve = fpext <2 x float> %vc to <2 x double>
888  %vf = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %va)
889  ret <2 x double> %vf
890}
891
892define <2 x double> @vfwmacc_vf_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
893; CHECK-LABEL: vfwmacc_vf_v2f64:
894; CHECK:       # %bb.0:
895; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
896; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
897; CHECK-NEXT:    ret
898  %head = insertelement <2 x float> poison, float %c, i32 0
899  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
900  %vd = fpext <2 x float> %vb to <2 x double>
901  %ve = fpext <2 x float> %splat to <2 x double>
902  %vf = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %va)
903  ret <2 x double> %vf
904}
905
906define <2 x double> @vfwnmacc_vv_v2f64(<2 x double> %va, <2 x float> %vb, <2 x float> %vc) {
907; CHECK-LABEL: vfwnmacc_vv_v2f64:
908; CHECK:       # %bb.0:
909; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
910; CHECK-NEXT:    vfwnmacc.vv v8, v9, v10
911; CHECK-NEXT:    ret
912  %vd = fpext <2 x float> %vb to <2 x double>
913  %ve = fpext <2 x float> %vc to <2 x double>
914  %vf = fneg <2 x double> %va
915  %vg = fneg <2 x double> %vd
916  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vg, <2 x double> %ve, <2 x double> %vf)
917  ret <2 x double> %vh
918}
919
920define <2 x double> @vfwnmacc_vf_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
921; CHECK-LABEL: vfwnmacc_vf_v2f64:
922; CHECK:       # %bb.0:
923; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
924; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
925; CHECK-NEXT:    ret
926  %head = insertelement <2 x float> poison, float %c, i32 0
927  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
928  %vd = fpext <2 x float> %vb to <2 x double>
929  %ve = fpext <2 x float> %splat to <2 x double>
930  %vf = fneg <2 x double> %va
931  %vg = fneg <2 x double> %vd
932  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vg, <2 x double> %ve, <2 x double> %vf)
933  ret <2 x double> %vh
934}
935
936define <2 x double> @vfwnmacc_fv_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
937; CHECK-LABEL: vfwnmacc_fv_v2f64:
938; CHECK:       # %bb.0:
939; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
940; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
941; CHECK-NEXT:    ret
942  %head = insertelement <2 x float> poison, float %c, i32 0
943  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
944  %vd = fpext <2 x float> %vb to <2 x double>
945  %ve = fpext <2 x float> %splat to <2 x double>
946  %vf = fneg <2 x double> %va
947  %vg = fneg <2 x double> %ve
948  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %vg, <2 x double> %vf)
949  ret <2 x double> %vh
950}
951
952define <2 x double> @vfwmsac_vv_v2f64(<2 x double> %va, <2 x float> %vb, <2 x float> %vc) {
953; CHECK-LABEL: vfwmsac_vv_v2f64:
954; CHECK:       # %bb.0:
955; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
956; CHECK-NEXT:    vfwmsac.vv v8, v9, v10
957; CHECK-NEXT:    ret
958  %vd = fpext <2 x float> %vb to <2 x double>
959  %ve = fpext <2 x float> %vc to <2 x double>
960  %vf = fneg <2 x double> %va
961  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %vf)
962  ret <2 x double> %vg
963}
964
965define <2 x double> @vfwmsac_vf_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
966; CHECK-LABEL: vfwmsac_vf_v2f64:
967; CHECK:       # %bb.0:
968; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
969; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
970; CHECK-NEXT:    ret
971  %head = insertelement <2 x float> poison, float %c, i32 0
972  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
973  %vd = fpext <2 x float> %vb to <2 x double>
974  %ve = fpext <2 x float> %splat to <2 x double>
975  %vf = fneg <2 x double> %va
976  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %vf)
977  ret <2 x double> %vg
978}
979
980define <2 x double> @vfwnmsac_vv_v2f64(<2 x double> %va, <2 x float> %vb, <2 x float> %vc) {
981; CHECK-LABEL: vfwnmsac_vv_v2f64:
982; CHECK:       # %bb.0:
983; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
984; CHECK-NEXT:    vfwnmsac.vv v8, v9, v10
985; CHECK-NEXT:    ret
986  %vd = fpext <2 x float> %vb to <2 x double>
987  %ve = fpext <2 x float> %vc to <2 x double>
988  %vf = fneg <2 x double> %vd
989  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vf, <2 x double> %ve, <2 x double> %va)
990  ret <2 x double> %vg
991}
992
993define <2 x double> @vfwnmsac_vf_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
994; CHECK-LABEL: vfwnmsac_vf_v2f64:
995; CHECK:       # %bb.0:
996; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
997; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
998; CHECK-NEXT:    ret
999  %head = insertelement <2 x float> poison, float %c, i32 0
1000  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
1001  %vd = fpext <2 x float> %vb to <2 x double>
1002  %ve = fpext <2 x float> %splat to <2 x double>
1003  %vf = fneg <2 x double> %vd
1004  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vf, <2 x double> %ve, <2 x double> %va)
1005  ret <2 x double> %vg
1006}
1007
1008define <2 x double> @vfwnmsac_fv_v2f64(<2 x double> %va, <2 x float> %vb, float %c) {
1009; CHECK-LABEL: vfwnmsac_fv_v2f64:
1010; CHECK:       # %bb.0:
1011; CHECK-NEXT:    vsetivli zero, 2, e32, mf2, ta, ma
1012; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
1013; CHECK-NEXT:    ret
1014  %head = insertelement <2 x float> poison, float %c, i32 0
1015  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
1016  %vd = fpext <2 x float> %vb to <2 x double>
1017  %ve = fpext <2 x float> %splat to <2 x double>
1018  %vf = fneg <2 x double> %ve
1019  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %vf, <2 x double> %va)
1020  ret <2 x double> %vg
1021}
1022
1023
1024declare <4 x double> @llvm.fma.v4f64(<4 x double>, <4 x double>, <4 x double>)
1025
1026define <4 x double> @vfwmacc_vv_v4f64(<4 x double> %va, <4 x float> %vb, <4 x float> %vc) {
1027; CHECK-LABEL: vfwmacc_vv_v4f64:
1028; CHECK:       # %bb.0:
1029; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1030; CHECK-NEXT:    vfwmacc.vv v8, v10, v11
1031; CHECK-NEXT:    ret
1032  %vd = fpext <4 x float> %vb to <4 x double>
1033  %ve = fpext <4 x float> %vc to <4 x double>
1034  %vf = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %va)
1035  ret <4 x double> %vf
1036}
1037
1038define <4 x double> @vfwmacc_vf_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1039; CHECK-LABEL: vfwmacc_vf_v4f64:
1040; CHECK:       # %bb.0:
1041; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1042; CHECK-NEXT:    vfwmacc.vf v8, fa0, v10
1043; CHECK-NEXT:    ret
1044  %head = insertelement <4 x float> poison, float %c, i32 0
1045  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1046  %vd = fpext <4 x float> %vb to <4 x double>
1047  %ve = fpext <4 x float> %splat to <4 x double>
1048  %vf = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %va)
1049  ret <4 x double> %vf
1050}
1051
1052define <4 x double> @vfwnmacc_vv_v4f64(<4 x double> %va, <4 x float> %vb, <4 x float> %vc) {
1053; CHECK-LABEL: vfwnmacc_vv_v4f64:
1054; CHECK:       # %bb.0:
1055; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1056; CHECK-NEXT:    vfwnmacc.vv v8, v10, v11
1057; CHECK-NEXT:    ret
1058  %vd = fpext <4 x float> %vb to <4 x double>
1059  %ve = fpext <4 x float> %vc to <4 x double>
1060  %vf = fneg <4 x double> %va
1061  %vg = fneg <4 x double> %vd
1062  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vg, <4 x double> %ve, <4 x double> %vf)
1063  ret <4 x double> %vh
1064}
1065
1066define <4 x double> @vfwnmacc_vf_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1067; CHECK-LABEL: vfwnmacc_vf_v4f64:
1068; CHECK:       # %bb.0:
1069; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1070; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v10
1071; CHECK-NEXT:    ret
1072  %head = insertelement <4 x float> poison, float %c, i32 0
1073  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1074  %vd = fpext <4 x float> %vb to <4 x double>
1075  %ve = fpext <4 x float> %splat to <4 x double>
1076  %vf = fneg <4 x double> %va
1077  %vg = fneg <4 x double> %vd
1078  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vg, <4 x double> %ve, <4 x double> %vf)
1079  ret <4 x double> %vh
1080}
1081
1082define <4 x double> @vfwnmacc_fv_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1083; CHECK-LABEL: vfwnmacc_fv_v4f64:
1084; CHECK:       # %bb.0:
1085; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1086; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v10
1087; CHECK-NEXT:    ret
1088  %head = insertelement <4 x float> poison, float %c, i32 0
1089  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1090  %vd = fpext <4 x float> %vb to <4 x double>
1091  %ve = fpext <4 x float> %splat to <4 x double>
1092  %vf = fneg <4 x double> %va
1093  %vg = fneg <4 x double> %ve
1094  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %vg, <4 x double> %vf)
1095  ret <4 x double> %vh
1096}
1097
1098define <4 x double> @vfwmsac_vv_v4f64(<4 x double> %va, <4 x float> %vb, <4 x float> %vc) {
1099; CHECK-LABEL: vfwmsac_vv_v4f64:
1100; CHECK:       # %bb.0:
1101; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1102; CHECK-NEXT:    vfwmsac.vv v8, v10, v11
1103; CHECK-NEXT:    ret
1104  %vd = fpext <4 x float> %vb to <4 x double>
1105  %ve = fpext <4 x float> %vc to <4 x double>
1106  %vf = fneg <4 x double> %va
1107  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %vf)
1108  ret <4 x double> %vg
1109}
1110
1111define <4 x double> @vfwmsac_vf_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1112; CHECK-LABEL: vfwmsac_vf_v4f64:
1113; CHECK:       # %bb.0:
1114; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1115; CHECK-NEXT:    vfwmsac.vf v8, fa0, v10
1116; CHECK-NEXT:    ret
1117  %head = insertelement <4 x float> poison, float %c, i32 0
1118  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1119  %vd = fpext <4 x float> %vb to <4 x double>
1120  %ve = fpext <4 x float> %splat to <4 x double>
1121  %vf = fneg <4 x double> %va
1122  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %vf)
1123  ret <4 x double> %vg
1124}
1125
1126define <4 x double> @vfwnmsac_vv_v4f64(<4 x double> %va, <4 x float> %vb, <4 x float> %vc) {
1127; CHECK-LABEL: vfwnmsac_vv_v4f64:
1128; CHECK:       # %bb.0:
1129; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1130; CHECK-NEXT:    vfwnmsac.vv v8, v10, v11
1131; CHECK-NEXT:    ret
1132  %vd = fpext <4 x float> %vb to <4 x double>
1133  %ve = fpext <4 x float> %vc to <4 x double>
1134  %vf = fneg <4 x double> %vd
1135  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vf, <4 x double> %ve, <4 x double> %va)
1136  ret <4 x double> %vg
1137}
1138
1139define <4 x double> @vfwnmsac_vf_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1140; CHECK-LABEL: vfwnmsac_vf_v4f64:
1141; CHECK:       # %bb.0:
1142; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1143; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v10
1144; CHECK-NEXT:    ret
1145  %head = insertelement <4 x float> poison, float %c, i32 0
1146  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1147  %vd = fpext <4 x float> %vb to <4 x double>
1148  %ve = fpext <4 x float> %splat to <4 x double>
1149  %vf = fneg <4 x double> %vd
1150  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vf, <4 x double> %ve, <4 x double> %va)
1151  ret <4 x double> %vg
1152}
1153
1154define <4 x double> @vfwnmsac_fv_v4f64(<4 x double> %va, <4 x float> %vb, float %c) {
1155; CHECK-LABEL: vfwnmsac_fv_v4f64:
1156; CHECK:       # %bb.0:
1157; CHECK-NEXT:    vsetivli zero, 4, e32, m1, ta, ma
1158; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v10
1159; CHECK-NEXT:    ret
1160  %head = insertelement <4 x float> poison, float %c, i32 0
1161  %splat = shufflevector <4 x float> %head, <4 x float> poison, <4 x i32> zeroinitializer
1162  %vd = fpext <4 x float> %vb to <4 x double>
1163  %ve = fpext <4 x float> %splat to <4 x double>
1164  %vf = fneg <4 x double> %ve
1165  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %vf, <4 x double> %va)
1166  ret <4 x double> %vg
1167}
1168
1169declare <8 x double> @llvm.fma.v8f64(<8 x double>, <8 x double>, <8 x double>)
1170
1171define <8 x double> @vfwmacc_vv_v8f64(<8 x double> %va, <8 x float> %vb, <8 x float> %vc) {
1172; CHECK-LABEL: vfwmacc_vv_v8f64:
1173; CHECK:       # %bb.0:
1174; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1175; CHECK-NEXT:    vfwmacc.vv v8, v12, v14
1176; CHECK-NEXT:    ret
1177  %vd = fpext <8 x float> %vb to <8 x double>
1178  %ve = fpext <8 x float> %vc to <8 x double>
1179  %vf = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %va)
1180  ret <8 x double> %vf
1181}
1182
1183define <8 x double> @vfwmacc_vf_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1184; CHECK-LABEL: vfwmacc_vf_v8f64:
1185; CHECK:       # %bb.0:
1186; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1187; CHECK-NEXT:    vfwmacc.vf v8, fa0, v12
1188; CHECK-NEXT:    ret
1189  %head = insertelement <8 x float> poison, float %c, i32 0
1190  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1191  %vd = fpext <8 x float> %vb to <8 x double>
1192  %ve = fpext <8 x float> %splat to <8 x double>
1193  %vf = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %va)
1194  ret <8 x double> %vf
1195}
1196
1197define <8 x double> @vfwnmacc_vv_v8f64(<8 x double> %va, <8 x float> %vb, <8 x float> %vc) {
1198; CHECK-LABEL: vfwnmacc_vv_v8f64:
1199; CHECK:       # %bb.0:
1200; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1201; CHECK-NEXT:    vfwnmacc.vv v8, v12, v14
1202; CHECK-NEXT:    ret
1203  %vd = fpext <8 x float> %vb to <8 x double>
1204  %ve = fpext <8 x float> %vc to <8 x double>
1205  %vf = fneg <8 x double> %va
1206  %vg = fneg <8 x double> %vd
1207  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vg, <8 x double> %ve, <8 x double> %vf)
1208  ret <8 x double> %vh
1209}
1210
1211define <8 x double> @vfwnmacc_vf_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1212; CHECK-LABEL: vfwnmacc_vf_v8f64:
1213; CHECK:       # %bb.0:
1214; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1215; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v12
1216; CHECK-NEXT:    ret
1217  %head = insertelement <8 x float> poison, float %c, i32 0
1218  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1219  %vd = fpext <8 x float> %vb to <8 x double>
1220  %ve = fpext <8 x float> %splat to <8 x double>
1221  %vf = fneg <8 x double> %va
1222  %vg = fneg <8 x double> %vd
1223  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vg, <8 x double> %ve, <8 x double> %vf)
1224  ret <8 x double> %vh
1225}
1226
1227define <8 x double> @vfwnmacc_fv_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1228; CHECK-LABEL: vfwnmacc_fv_v8f64:
1229; CHECK:       # %bb.0:
1230; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1231; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v12
1232; CHECK-NEXT:    ret
1233  %head = insertelement <8 x float> poison, float %c, i32 0
1234  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1235  %vd = fpext <8 x float> %vb to <8 x double>
1236  %ve = fpext <8 x float> %splat to <8 x double>
1237  %vf = fneg <8 x double> %va
1238  %vg = fneg <8 x double> %ve
1239  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %vg, <8 x double> %vf)
1240  ret <8 x double> %vh
1241}
1242
1243define <8 x double> @vfwmsac_vv_v8f64(<8 x double> %va, <8 x float> %vb, <8 x float> %vc) {
1244; CHECK-LABEL: vfwmsac_vv_v8f64:
1245; CHECK:       # %bb.0:
1246; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1247; CHECK-NEXT:    vfwmsac.vv v8, v12, v14
1248; CHECK-NEXT:    ret
1249  %vd = fpext <8 x float> %vb to <8 x double>
1250  %ve = fpext <8 x float> %vc to <8 x double>
1251  %vf = fneg <8 x double> %va
1252  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %vf)
1253  ret <8 x double> %vg
1254}
1255
1256define <8 x double> @vfwmsac_vf_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1257; CHECK-LABEL: vfwmsac_vf_v8f64:
1258; CHECK:       # %bb.0:
1259; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1260; CHECK-NEXT:    vfwmsac.vf v8, fa0, v12
1261; CHECK-NEXT:    ret
1262  %head = insertelement <8 x float> poison, float %c, i32 0
1263  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1264  %vd = fpext <8 x float> %vb to <8 x double>
1265  %ve = fpext <8 x float> %splat to <8 x double>
1266  %vf = fneg <8 x double> %va
1267  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %vf)
1268  ret <8 x double> %vg
1269}
1270
1271define <8 x double> @vfwnmsac_vv_v8f64(<8 x double> %va, <8 x float> %vb, <8 x float> %vc) {
1272; CHECK-LABEL: vfwnmsac_vv_v8f64:
1273; CHECK:       # %bb.0:
1274; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1275; CHECK-NEXT:    vfwnmsac.vv v8, v12, v14
1276; CHECK-NEXT:    ret
1277  %vd = fpext <8 x float> %vb to <8 x double>
1278  %ve = fpext <8 x float> %vc to <8 x double>
1279  %vf = fneg <8 x double> %vd
1280  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vf, <8 x double> %ve, <8 x double> %va)
1281  ret <8 x double> %vg
1282}
1283
1284define <8 x double> @vfwnmsac_vf_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1285; CHECK-LABEL: vfwnmsac_vf_v8f64:
1286; CHECK:       # %bb.0:
1287; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1288; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v12
1289; CHECK-NEXT:    ret
1290  %head = insertelement <8 x float> poison, float %c, i32 0
1291  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1292  %vd = fpext <8 x float> %vb to <8 x double>
1293  %ve = fpext <8 x float> %splat to <8 x double>
1294  %vf = fneg <8 x double> %vd
1295  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vf, <8 x double> %ve, <8 x double> %va)
1296  ret <8 x double> %vg
1297}
1298
1299define <8 x double> @vfwnmsac_fv_v8f64(<8 x double> %va, <8 x float> %vb, float %c) {
1300; CHECK-LABEL: vfwnmsac_fv_v8f64:
1301; CHECK:       # %bb.0:
1302; CHECK-NEXT:    vsetivli zero, 8, e32, m2, ta, ma
1303; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v12
1304; CHECK-NEXT:    ret
1305  %head = insertelement <8 x float> poison, float %c, i32 0
1306  %splat = shufflevector <8 x float> %head, <8 x float> poison, <8 x i32> zeroinitializer
1307  %vd = fpext <8 x float> %vb to <8 x double>
1308  %ve = fpext <8 x float> %splat to <8 x double>
1309  %vf = fneg <8 x double> %ve
1310  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %vf, <8 x double> %va)
1311  ret <8 x double> %vg
1312}
1313
1314define <1 x double> @vfwmacc_vv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, <1 x half> %vc) {
1315; CHECK-LABEL: vfwmacc_vv_v1f64_v1f16:
1316; CHECK:       # %bb.0:
1317; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1318; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1319; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1320; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1321; CHECK-NEXT:    vfwmacc.vv v8, v11, v9
1322; CHECK-NEXT:    ret
1323  %vd = fpext <1 x half> %vb to <1 x double>
1324  %ve = fpext <1 x half> %vc to <1 x double>
1325  %vf = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %va)
1326  ret <1 x double> %vf
1327}
1328
1329define <1 x double> @vfwmacc_vf_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1330; CHECK-LABEL: vfwmacc_vf_v1f64_v1f16:
1331; CHECK:       # %bb.0:
1332; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1333; CHECK-NEXT:    vfmv.s.f v10, fa0
1334; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1335; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1336; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1337; CHECK-NEXT:    vfwmacc.vv v8, v11, v9
1338; CHECK-NEXT:    ret
1339  %head = insertelement <1 x half> poison, half %c, i32 0
1340  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1341  %vd = fpext <1 x half> %vb to <1 x double>
1342  %ve = fpext <1 x half> %splat to <1 x double>
1343  %vf = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %va)
1344  ret <1 x double> %vf
1345}
1346
1347define <1 x double> @vfwnmacc_vv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, <1 x half> %vc) {
1348; CHECK-LABEL: vfwnmacc_vv_v1f64_v1f16:
1349; CHECK:       # %bb.0:
1350; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1351; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1352; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1353; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1354; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1355; CHECK-NEXT:    ret
1356  %vd = fpext <1 x half> %vb to <1 x double>
1357  %ve = fpext <1 x half> %vc to <1 x double>
1358  %vf = fneg <1 x double> %va
1359  %vg = fneg <1 x double> %vd
1360  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vg, <1 x double> %ve, <1 x double> %vf)
1361  ret <1 x double> %vh
1362}
1363
1364define <1 x double> @vfwnmacc_vf_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1365; CHECK-LABEL: vfwnmacc_vf_v1f64_v1f16:
1366; CHECK:       # %bb.0:
1367; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1368; CHECK-NEXT:    vfmv.s.f v10, fa0
1369; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1370; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1371; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1372; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1373; CHECK-NEXT:    ret
1374  %head = insertelement <1 x half> poison, half %c, i32 0
1375  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1376  %vd = fpext <1 x half> %vb to <1 x double>
1377  %ve = fpext <1 x half> %splat to <1 x double>
1378  %vf = fneg <1 x double> %va
1379  %vg = fneg <1 x double> %vd
1380  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vg, <1 x double> %ve, <1 x double> %vf)
1381  ret <1 x double> %vh
1382}
1383
1384define <1 x double> @vfwnmacc_fv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1385; CHECK-LABEL: vfwnmacc_fv_v1f64_v1f16:
1386; CHECK:       # %bb.0:
1387; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1388; CHECK-NEXT:    vfmv.s.f v10, fa0
1389; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1390; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1391; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1392; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1393; CHECK-NEXT:    ret
1394  %head = insertelement <1 x half> poison, half %c, i32 0
1395  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1396  %vd = fpext <1 x half> %vb to <1 x double>
1397  %ve = fpext <1 x half> %splat to <1 x double>
1398  %vf = fneg <1 x double> %va
1399  %vg = fneg <1 x double> %ve
1400  %vh = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %vg, <1 x double> %vf)
1401  ret <1 x double> %vh
1402}
1403
1404define <1 x double> @vfwmsac_vv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, <1 x half> %vc) {
1405; CHECK-LABEL: vfwmsac_vv_v1f64_v1f16:
1406; CHECK:       # %bb.0:
1407; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1408; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1409; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1410; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1411; CHECK-NEXT:    vfwmsac.vv v8, v11, v9
1412; CHECK-NEXT:    ret
1413  %vd = fpext <1 x half> %vb to <1 x double>
1414  %ve = fpext <1 x half> %vc to <1 x double>
1415  %vf = fneg <1 x double> %va
1416  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %vf)
1417  ret <1 x double> %vg
1418}
1419
1420define <1 x double> @vfwmsac_vf_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1421; CHECK-LABEL: vfwmsac_vf_v1f64_v1f16:
1422; CHECK:       # %bb.0:
1423; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1424; CHECK-NEXT:    vfmv.s.f v10, fa0
1425; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1426; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1427; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1428; CHECK-NEXT:    vfwmsac.vv v8, v11, v9
1429; CHECK-NEXT:    ret
1430  %head = insertelement <1 x half> poison, half %c, i32 0
1431  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1432  %vd = fpext <1 x half> %vb to <1 x double>
1433  %ve = fpext <1 x half> %splat to <1 x double>
1434  %vf = fneg <1 x double> %va
1435  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %ve, <1 x double> %vf)
1436  ret <1 x double> %vg
1437}
1438
1439define <1 x double> @vfwnmsac_vv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, <1 x half> %vc) {
1440; CHECK-LABEL: vfwnmsac_vv_v1f64_v1f16:
1441; CHECK:       # %bb.0:
1442; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1443; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1444; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1445; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1446; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1447; CHECK-NEXT:    ret
1448  %vd = fpext <1 x half> %vb to <1 x double>
1449  %ve = fpext <1 x half> %vc to <1 x double>
1450  %vf = fneg <1 x double> %vd
1451  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vf, <1 x double> %ve, <1 x double> %va)
1452  ret <1 x double> %vg
1453}
1454
1455define <1 x double> @vfwnmsac_vf_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1456; CHECK-LABEL: vfwnmsac_vf_v1f64_v1f16:
1457; CHECK:       # %bb.0:
1458; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1459; CHECK-NEXT:    vfmv.s.f v10, fa0
1460; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1461; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1462; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1463; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1464; CHECK-NEXT:    ret
1465  %head = insertelement <1 x half> poison, half %c, i32 0
1466  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1467  %vd = fpext <1 x half> %vb to <1 x double>
1468  %ve = fpext <1 x half> %splat to <1 x double>
1469  %vf = fneg <1 x double> %vd
1470  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vf, <1 x double> %ve, <1 x double> %va)
1471  ret <1 x double> %vg
1472}
1473
1474define <1 x double> @vfwnmsac_fv_v1f64_v1f16(<1 x double> %va, <1 x half> %vb, half %c) {
1475; CHECK-LABEL: vfwnmsac_fv_v1f64_v1f16:
1476; CHECK:       # %bb.0:
1477; CHECK-NEXT:    vsetivli zero, 1, e16, mf4, ta, ma
1478; CHECK-NEXT:    vfmv.s.f v10, fa0
1479; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1480; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1481; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1482; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1483; CHECK-NEXT:    ret
1484  %head = insertelement <1 x half> poison, half %c, i32 0
1485  %splat = shufflevector <1 x half> %head, <1 x half> poison, <1 x i32> zeroinitializer
1486  %vd = fpext <1 x half> %vb to <1 x double>
1487  %ve = fpext <1 x half> %splat to <1 x double>
1488  %vf = fneg <1 x double> %ve
1489  %vg = call <1 x double> @llvm.fma.v1f64(<1 x double> %vd, <1 x double> %vf, <1 x double> %va)
1490  ret <1 x double> %vg
1491}
1492
1493define <2 x double> @vfwmacc_vv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, <2 x half> %vc) {
1494; CHECK-LABEL: vfwmacc_vv_v2f64_v2f16:
1495; CHECK:       # %bb.0:
1496; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1497; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1498; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1499; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1500; CHECK-NEXT:    vfwmacc.vv v8, v11, v9
1501; CHECK-NEXT:    ret
1502  %vd = fpext <2 x half> %vb to <2 x double>
1503  %ve = fpext <2 x half> %vc to <2 x double>
1504  %vf = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %va)
1505  ret <2 x double> %vf
1506}
1507
1508define <2 x double> @vfwmacc_vf_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1509; CHECK-LABEL: vfwmacc_vf_v2f64_v2f16:
1510; CHECK:       # %bb.0:
1511; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1512; CHECK-NEXT:    vfmv.v.f v10, fa0
1513; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1514; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1515; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1516; CHECK-NEXT:    vfwmacc.vv v8, v11, v9
1517; CHECK-NEXT:    ret
1518  %head = insertelement <2 x half> poison, half %c, i32 0
1519  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1520  %vd = fpext <2 x half> %vb to <2 x double>
1521  %ve = fpext <2 x half> %splat to <2 x double>
1522  %vf = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %va)
1523  ret <2 x double> %vf
1524}
1525
1526define <2 x double> @vfwnmacc_vv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, <2 x half> %vc) {
1527; CHECK-LABEL: vfwnmacc_vv_v2f64_v2f16:
1528; CHECK:       # %bb.0:
1529; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1530; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1531; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1532; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1533; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1534; CHECK-NEXT:    ret
1535  %vd = fpext <2 x half> %vb to <2 x double>
1536  %ve = fpext <2 x half> %vc to <2 x double>
1537  %vf = fneg <2 x double> %va
1538  %vg = fneg <2 x double> %vd
1539  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vg, <2 x double> %ve, <2 x double> %vf)
1540  ret <2 x double> %vh
1541}
1542
1543define <2 x double> @vfwnmacc_vf_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1544; CHECK-LABEL: vfwnmacc_vf_v2f64_v2f16:
1545; CHECK:       # %bb.0:
1546; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1547; CHECK-NEXT:    vfmv.v.f v10, fa0
1548; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1549; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1550; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1551; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1552; CHECK-NEXT:    ret
1553  %head = insertelement <2 x half> poison, half %c, i32 0
1554  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1555  %vd = fpext <2 x half> %vb to <2 x double>
1556  %ve = fpext <2 x half> %splat to <2 x double>
1557  %vf = fneg <2 x double> %va
1558  %vg = fneg <2 x double> %vd
1559  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vg, <2 x double> %ve, <2 x double> %vf)
1560  ret <2 x double> %vh
1561}
1562
1563define <2 x double> @vfwnmacc_fv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1564; CHECK-LABEL: vfwnmacc_fv_v2f64_v2f16:
1565; CHECK:       # %bb.0:
1566; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1567; CHECK-NEXT:    vfmv.v.f v10, fa0
1568; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1569; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1570; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1571; CHECK-NEXT:    vfwnmacc.vv v8, v11, v9
1572; CHECK-NEXT:    ret
1573  %head = insertelement <2 x half> poison, half %c, i32 0
1574  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1575  %vd = fpext <2 x half> %vb to <2 x double>
1576  %ve = fpext <2 x half> %splat to <2 x double>
1577  %vf = fneg <2 x double> %va
1578  %vg = fneg <2 x double> %ve
1579  %vh = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %vg, <2 x double> %vf)
1580  ret <2 x double> %vh
1581}
1582
1583define <2 x double> @vfwmsac_vv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, <2 x half> %vc) {
1584; CHECK-LABEL: vfwmsac_vv_v2f64_v2f16:
1585; CHECK:       # %bb.0:
1586; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1587; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1588; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1589; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1590; CHECK-NEXT:    vfwmsac.vv v8, v11, v9
1591; CHECK-NEXT:    ret
1592  %vd = fpext <2 x half> %vb to <2 x double>
1593  %ve = fpext <2 x half> %vc to <2 x double>
1594  %vf = fneg <2 x double> %va
1595  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %vf)
1596  ret <2 x double> %vg
1597}
1598
1599define <2 x double> @vfwmsac_vf_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1600; CHECK-LABEL: vfwmsac_vf_v2f64_v2f16:
1601; CHECK:       # %bb.0:
1602; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1603; CHECK-NEXT:    vfmv.v.f v10, fa0
1604; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1605; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1606; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1607; CHECK-NEXT:    vfwmsac.vv v8, v11, v9
1608; CHECK-NEXT:    ret
1609  %head = insertelement <2 x half> poison, half %c, i32 0
1610  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1611  %vd = fpext <2 x half> %vb to <2 x double>
1612  %ve = fpext <2 x half> %splat to <2 x double>
1613  %vf = fneg <2 x double> %va
1614  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %ve, <2 x double> %vf)
1615  ret <2 x double> %vg
1616}
1617
1618define <2 x double> @vfwnmsac_vv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, <2 x half> %vc) {
1619; CHECK-LABEL: vfwnmsac_vv_v2f64_v2f16:
1620; CHECK:       # %bb.0:
1621; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1622; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1623; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1624; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1625; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1626; CHECK-NEXT:    ret
1627  %vd = fpext <2 x half> %vb to <2 x double>
1628  %ve = fpext <2 x half> %vc to <2 x double>
1629  %vf = fneg <2 x double> %vd
1630  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vf, <2 x double> %ve, <2 x double> %va)
1631  ret <2 x double> %vg
1632}
1633
1634define <2 x double> @vfwnmsac_vf_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1635; CHECK-LABEL: vfwnmsac_vf_v2f64_v2f16:
1636; CHECK:       # %bb.0:
1637; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1638; CHECK-NEXT:    vfmv.v.f v10, fa0
1639; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1640; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1641; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1642; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1643; CHECK-NEXT:    ret
1644  %head = insertelement <2 x half> poison, half %c, i32 0
1645  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1646  %vd = fpext <2 x half> %vb to <2 x double>
1647  %ve = fpext <2 x half> %splat to <2 x double>
1648  %vf = fneg <2 x double> %vd
1649  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vf, <2 x double> %ve, <2 x double> %va)
1650  ret <2 x double> %vg
1651}
1652
1653define <2 x double> @vfwnmsac_fv_v2f64_v2f16(<2 x double> %va, <2 x half> %vb, half %c) {
1654; CHECK-LABEL: vfwnmsac_fv_v2f64_v2f16:
1655; CHECK:       # %bb.0:
1656; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
1657; CHECK-NEXT:    vfmv.v.f v10, fa0
1658; CHECK-NEXT:    vfwcvt.f.f.v v11, v9
1659; CHECK-NEXT:    vfwcvt.f.f.v v9, v10
1660; CHECK-NEXT:    vsetvli zero, zero, e32, mf2, ta, ma
1661; CHECK-NEXT:    vfwnmsac.vv v8, v11, v9
1662; CHECK-NEXT:    ret
1663  %head = insertelement <2 x half> poison, half %c, i32 0
1664  %splat = shufflevector <2 x half> %head, <2 x half> poison, <2 x i32> zeroinitializer
1665  %vd = fpext <2 x half> %vb to <2 x double>
1666  %ve = fpext <2 x half> %splat to <2 x double>
1667  %vf = fneg <2 x double> %ve
1668  %vg = call <2 x double> @llvm.fma.v2f64(<2 x double> %vd, <2 x double> %vf, <2 x double> %va)
1669  ret <2 x double> %vg
1670}
1671
1672
1673define <4 x double> @vfwmacc_vv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, <4 x half> %vc) {
1674; CHECK-LABEL: vfwmacc_vv_v4f64_v4f16:
1675; CHECK:       # %bb.0:
1676; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1677; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1678; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1679; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1680; CHECK-NEXT:    vfwmacc.vv v8, v12, v10
1681; CHECK-NEXT:    ret
1682  %vd = fpext <4 x half> %vb to <4 x double>
1683  %ve = fpext <4 x half> %vc to <4 x double>
1684  %vf = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %va)
1685  ret <4 x double> %vf
1686}
1687
1688define <4 x double> @vfwmacc_vf_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1689; CHECK-LABEL: vfwmacc_vf_v4f64_v4f16:
1690; CHECK:       # %bb.0:
1691; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1692; CHECK-NEXT:    vfmv.v.f v11, fa0
1693; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1694; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1695; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1696; CHECK-NEXT:    vfwmacc.vv v8, v12, v10
1697; CHECK-NEXT:    ret
1698  %head = insertelement <4 x half> poison, half %c, i32 0
1699  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1700  %vd = fpext <4 x half> %vb to <4 x double>
1701  %ve = fpext <4 x half> %splat to <4 x double>
1702  %vf = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %va)
1703  ret <4 x double> %vf
1704}
1705
1706define <4 x double> @vfwnmacc_vv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, <4 x half> %vc) {
1707; CHECK-LABEL: vfwnmacc_vv_v4f64_v4f16:
1708; CHECK:       # %bb.0:
1709; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1710; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1711; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1712; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1713; CHECK-NEXT:    vfwnmacc.vv v8, v12, v10
1714; CHECK-NEXT:    ret
1715  %vd = fpext <4 x half> %vb to <4 x double>
1716  %ve = fpext <4 x half> %vc to <4 x double>
1717  %vf = fneg <4 x double> %va
1718  %vg = fneg <4 x double> %vd
1719  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vg, <4 x double> %ve, <4 x double> %vf)
1720  ret <4 x double> %vh
1721}
1722
1723define <4 x double> @vfwnmacc_vf_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1724; CHECK-LABEL: vfwnmacc_vf_v4f64_v4f16:
1725; CHECK:       # %bb.0:
1726; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1727; CHECK-NEXT:    vfmv.v.f v11, fa0
1728; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1729; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1730; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1731; CHECK-NEXT:    vfwnmacc.vv v8, v12, v10
1732; CHECK-NEXT:    ret
1733  %head = insertelement <4 x half> poison, half %c, i32 0
1734  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1735  %vd = fpext <4 x half> %vb to <4 x double>
1736  %ve = fpext <4 x half> %splat to <4 x double>
1737  %vf = fneg <4 x double> %va
1738  %vg = fneg <4 x double> %vd
1739  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vg, <4 x double> %ve, <4 x double> %vf)
1740  ret <4 x double> %vh
1741}
1742
1743define <4 x double> @vfwnmacc_fv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1744; CHECK-LABEL: vfwnmacc_fv_v4f64_v4f16:
1745; CHECK:       # %bb.0:
1746; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1747; CHECK-NEXT:    vfmv.v.f v11, fa0
1748; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1749; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1750; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1751; CHECK-NEXT:    vfwnmacc.vv v8, v12, v10
1752; CHECK-NEXT:    ret
1753  %head = insertelement <4 x half> poison, half %c, i32 0
1754  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1755  %vd = fpext <4 x half> %vb to <4 x double>
1756  %ve = fpext <4 x half> %splat to <4 x double>
1757  %vf = fneg <4 x double> %va
1758  %vg = fneg <4 x double> %ve
1759  %vh = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %vg, <4 x double> %vf)
1760  ret <4 x double> %vh
1761}
1762
1763define <4 x double> @vfwmsac_vv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, <4 x half> %vc) {
1764; CHECK-LABEL: vfwmsac_vv_v4f64_v4f16:
1765; CHECK:       # %bb.0:
1766; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1767; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1768; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1769; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1770; CHECK-NEXT:    vfwmsac.vv v8, v12, v10
1771; CHECK-NEXT:    ret
1772  %vd = fpext <4 x half> %vb to <4 x double>
1773  %ve = fpext <4 x half> %vc to <4 x double>
1774  %vf = fneg <4 x double> %va
1775  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %vf)
1776  ret <4 x double> %vg
1777}
1778
1779define <4 x double> @vfwmsac_vf_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1780; CHECK-LABEL: vfwmsac_vf_v4f64_v4f16:
1781; CHECK:       # %bb.0:
1782; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1783; CHECK-NEXT:    vfmv.v.f v11, fa0
1784; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1785; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1786; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1787; CHECK-NEXT:    vfwmsac.vv v8, v12, v10
1788; CHECK-NEXT:    ret
1789  %head = insertelement <4 x half> poison, half %c, i32 0
1790  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1791  %vd = fpext <4 x half> %vb to <4 x double>
1792  %ve = fpext <4 x half> %splat to <4 x double>
1793  %vf = fneg <4 x double> %va
1794  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %ve, <4 x double> %vf)
1795  ret <4 x double> %vg
1796}
1797
1798define <4 x double> @vfwnmsac_vv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, <4 x half> %vc) {
1799; CHECK-LABEL: vfwnmsac_vv_v4f64_v4f16:
1800; CHECK:       # %bb.0:
1801; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1802; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1803; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1804; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1805; CHECK-NEXT:    vfwnmsac.vv v8, v12, v10
1806; CHECK-NEXT:    ret
1807  %vd = fpext <4 x half> %vb to <4 x double>
1808  %ve = fpext <4 x half> %vc to <4 x double>
1809  %vf = fneg <4 x double> %vd
1810  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vf, <4 x double> %ve, <4 x double> %va)
1811  ret <4 x double> %vg
1812}
1813
1814define <4 x double> @vfwnmsac_vf_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1815; CHECK-LABEL: vfwnmsac_vf_v4f64_v4f16:
1816; CHECK:       # %bb.0:
1817; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1818; CHECK-NEXT:    vfmv.v.f v11, fa0
1819; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1820; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1821; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1822; CHECK-NEXT:    vfwnmsac.vv v8, v12, v10
1823; CHECK-NEXT:    ret
1824  %head = insertelement <4 x half> poison, half %c, i32 0
1825  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1826  %vd = fpext <4 x half> %vb to <4 x double>
1827  %ve = fpext <4 x half> %splat to <4 x double>
1828  %vf = fneg <4 x double> %vd
1829  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vf, <4 x double> %ve, <4 x double> %va)
1830  ret <4 x double> %vg
1831}
1832
1833define <4 x double> @vfwnmsac_fv_v4f64_v4f16(<4 x double> %va, <4 x half> %vb, half %c) {
1834; CHECK-LABEL: vfwnmsac_fv_v4f64_v4f16:
1835; CHECK:       # %bb.0:
1836; CHECK-NEXT:    vsetivli zero, 4, e16, mf2, ta, ma
1837; CHECK-NEXT:    vfmv.v.f v11, fa0
1838; CHECK-NEXT:    vfwcvt.f.f.v v12, v10
1839; CHECK-NEXT:    vfwcvt.f.f.v v10, v11
1840; CHECK-NEXT:    vsetvli zero, zero, e32, m1, ta, ma
1841; CHECK-NEXT:    vfwnmsac.vv v8, v12, v10
1842; CHECK-NEXT:    ret
1843  %head = insertelement <4 x half> poison, half %c, i32 0
1844  %splat = shufflevector <4 x half> %head, <4 x half> poison, <4 x i32> zeroinitializer
1845  %vd = fpext <4 x half> %vb to <4 x double>
1846  %ve = fpext <4 x half> %splat to <4 x double>
1847  %vf = fneg <4 x double> %ve
1848  %vg = call <4 x double> @llvm.fma.v4f64(<4 x double> %vd, <4 x double> %vf, <4 x double> %va)
1849  ret <4 x double> %vg
1850}
1851
1852define <8 x double> @vfwmacc_vv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, <8 x half> %vc) {
1853; CHECK-LABEL: vfwmacc_vv_v8f64_v8f16:
1854; CHECK:       # %bb.0:
1855; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1856; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1857; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1858; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1859; CHECK-NEXT:    vfwmacc.vv v8, v14, v16
1860; CHECK-NEXT:    ret
1861  %vd = fpext <8 x half> %vb to <8 x double>
1862  %ve = fpext <8 x half> %vc to <8 x double>
1863  %vf = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %va)
1864  ret <8 x double> %vf
1865}
1866
1867define <8 x double> @vfwmacc_vf_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
1868; CHECK-LABEL: vfwmacc_vf_v8f64_v8f16:
1869; CHECK:       # %bb.0:
1870; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1871; CHECK-NEXT:    vfmv.v.f v13, fa0
1872; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1873; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1874; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1875; CHECK-NEXT:    vfwmacc.vv v8, v14, v16
1876; CHECK-NEXT:    ret
1877  %head = insertelement <8 x half> poison, half %c, i32 0
1878  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
1879  %vd = fpext <8 x half> %vb to <8 x double>
1880  %ve = fpext <8 x half> %splat to <8 x double>
1881  %vf = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %va)
1882  ret <8 x double> %vf
1883}
1884
1885define <8 x double> @vfwnmacc_vv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, <8 x half> %vc) {
1886; CHECK-LABEL: vfwnmacc_vv_v8f64_v8f16:
1887; CHECK:       # %bb.0:
1888; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1889; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1890; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1891; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1892; CHECK-NEXT:    vfwnmacc.vv v8, v14, v16
1893; CHECK-NEXT:    ret
1894  %vd = fpext <8 x half> %vb to <8 x double>
1895  %ve = fpext <8 x half> %vc to <8 x double>
1896  %vf = fneg <8 x double> %va
1897  %vg = fneg <8 x double> %vd
1898  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vg, <8 x double> %ve, <8 x double> %vf)
1899  ret <8 x double> %vh
1900}
1901
1902define <8 x double> @vfwnmacc_vf_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
1903; CHECK-LABEL: vfwnmacc_vf_v8f64_v8f16:
1904; CHECK:       # %bb.0:
1905; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1906; CHECK-NEXT:    vfmv.v.f v13, fa0
1907; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1908; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1909; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1910; CHECK-NEXT:    vfwnmacc.vv v8, v14, v16
1911; CHECK-NEXT:    ret
1912  %head = insertelement <8 x half> poison, half %c, i32 0
1913  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
1914  %vd = fpext <8 x half> %vb to <8 x double>
1915  %ve = fpext <8 x half> %splat to <8 x double>
1916  %vf = fneg <8 x double> %va
1917  %vg = fneg <8 x double> %vd
1918  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vg, <8 x double> %ve, <8 x double> %vf)
1919  ret <8 x double> %vh
1920}
1921
1922define <8 x double> @vfwnmacc_fv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
1923; CHECK-LABEL: vfwnmacc_fv_v8f64_v8f16:
1924; CHECK:       # %bb.0:
1925; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1926; CHECK-NEXT:    vfmv.v.f v13, fa0
1927; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1928; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1929; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1930; CHECK-NEXT:    vfwnmacc.vv v8, v14, v16
1931; CHECK-NEXT:    ret
1932  %head = insertelement <8 x half> poison, half %c, i32 0
1933  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
1934  %vd = fpext <8 x half> %vb to <8 x double>
1935  %ve = fpext <8 x half> %splat to <8 x double>
1936  %vf = fneg <8 x double> %va
1937  %vg = fneg <8 x double> %ve
1938  %vh = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %vg, <8 x double> %vf)
1939  ret <8 x double> %vh
1940}
1941
1942define <8 x double> @vfwmsac_vv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, <8 x half> %vc) {
1943; CHECK-LABEL: vfwmsac_vv_v8f64_v8f16:
1944; CHECK:       # %bb.0:
1945; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1946; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1947; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1948; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1949; CHECK-NEXT:    vfwmsac.vv v8, v14, v16
1950; CHECK-NEXT:    ret
1951  %vd = fpext <8 x half> %vb to <8 x double>
1952  %ve = fpext <8 x half> %vc to <8 x double>
1953  %vf = fneg <8 x double> %va
1954  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %vf)
1955  ret <8 x double> %vg
1956}
1957
1958define <8 x double> @vfwmsac_vf_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
1959; CHECK-LABEL: vfwmsac_vf_v8f64_v8f16:
1960; CHECK:       # %bb.0:
1961; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1962; CHECK-NEXT:    vfmv.v.f v13, fa0
1963; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1964; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1965; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1966; CHECK-NEXT:    vfwmsac.vv v8, v14, v16
1967; CHECK-NEXT:    ret
1968  %head = insertelement <8 x half> poison, half %c, i32 0
1969  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
1970  %vd = fpext <8 x half> %vb to <8 x double>
1971  %ve = fpext <8 x half> %splat to <8 x double>
1972  %vf = fneg <8 x double> %va
1973  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %ve, <8 x double> %vf)
1974  ret <8 x double> %vg
1975}
1976
1977define <8 x double> @vfwnmsac_vv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, <8 x half> %vc) {
1978; CHECK-LABEL: vfwnmsac_vv_v8f64_v8f16:
1979; CHECK:       # %bb.0:
1980; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1981; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1982; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
1983; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
1984; CHECK-NEXT:    vfwnmsac.vv v8, v14, v16
1985; CHECK-NEXT:    ret
1986  %vd = fpext <8 x half> %vb to <8 x double>
1987  %ve = fpext <8 x half> %vc to <8 x double>
1988  %vf = fneg <8 x double> %vd
1989  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vf, <8 x double> %ve, <8 x double> %va)
1990  ret <8 x double> %vg
1991}
1992
1993define <8 x double> @vfwnmsac_vf_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
1994; CHECK-LABEL: vfwnmsac_vf_v8f64_v8f16:
1995; CHECK:       # %bb.0:
1996; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
1997; CHECK-NEXT:    vfmv.v.f v13, fa0
1998; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
1999; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
2000; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
2001; CHECK-NEXT:    vfwnmsac.vv v8, v14, v16
2002; CHECK-NEXT:    ret
2003  %head = insertelement <8 x half> poison, half %c, i32 0
2004  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
2005  %vd = fpext <8 x half> %vb to <8 x double>
2006  %ve = fpext <8 x half> %splat to <8 x double>
2007  %vf = fneg <8 x double> %vd
2008  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vf, <8 x double> %ve, <8 x double> %va)
2009  ret <8 x double> %vg
2010}
2011
2012define <8 x double> @vfwnmsac_fv_v8f64_v8f16(<8 x double> %va, <8 x half> %vb, half %c) {
2013; CHECK-LABEL: vfwnmsac_fv_v8f64_v8f16:
2014; CHECK:       # %bb.0:
2015; CHECK-NEXT:    vsetivli zero, 8, e16, m1, ta, ma
2016; CHECK-NEXT:    vfmv.v.f v13, fa0
2017; CHECK-NEXT:    vfwcvt.f.f.v v14, v12
2018; CHECK-NEXT:    vfwcvt.f.f.v v16, v13
2019; CHECK-NEXT:    vsetvli zero, zero, e32, m2, ta, ma
2020; CHECK-NEXT:    vfwnmsac.vv v8, v14, v16
2021; CHECK-NEXT:    ret
2022  %head = insertelement <8 x half> poison, half %c, i32 0
2023  %splat = shufflevector <8 x half> %head, <8 x half> poison, <8 x i32> zeroinitializer
2024  %vd = fpext <8 x half> %vb to <8 x double>
2025  %ve = fpext <8 x half> %splat to <8 x double>
2026  %vf = fneg <8 x double> %ve
2027  %vg = call <8 x double> @llvm.fma.v8f64(<8 x double> %vd, <8 x double> %vf, <8 x double> %va)
2028  ret <8 x double> %vg
2029}
2030
2031define <2 x float> @vfwmacc_vf2_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
2032; CHECK-LABEL: vfwmacc_vf2_v2f32:
2033; CHECK:       # %bb.0:
2034; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
2035; CHECK-NEXT:    vfwmacc.vf v8, fa0, v9
2036; CHECK-NEXT:    ret
2037  %cext = fpext half %c to float
2038  %head = insertelement <2 x float> poison, float %cext, i32 0
2039  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
2040  %vd = fpext <2 x half> %vb to <2 x float>
2041  %vf = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %splat, <2 x float> %va)
2042  ret <2 x float> %vf
2043}
2044
2045define <2 x float> @vfwmsac_vf2_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
2046; CHECK-LABEL: vfwmsac_vf2_v2f32:
2047; CHECK:       # %bb.0:
2048; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
2049; CHECK-NEXT:    vfwmsac.vf v8, fa0, v9
2050; CHECK-NEXT:    ret
2051  %cext = fpext half %c to float
2052  %head = insertelement <2 x float> poison, float %cext, i32 0
2053  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
2054  %vd = fpext <2 x half> %vb to <2 x float>
2055  %ve = fneg <2 x float> %va
2056  %vf = call <2 x float> @llvm.fma.v2f32(<2 x float> %vd, <2 x float> %splat, <2 x float> %ve)
2057  ret <2 x float> %vf
2058}
2059
2060define <2 x float> @vfwnmacc_vf2_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
2061; CHECK-LABEL: vfwnmacc_vf2_v2f32:
2062; CHECK:       # %bb.0:
2063; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
2064; CHECK-NEXT:    vfwnmacc.vf v8, fa0, v9
2065; CHECK-NEXT:    ret
2066  %cext = fpext half %c to float
2067  %head = insertelement <2 x float> poison, float %cext, i32 0
2068  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
2069  %vd = fpext <2 x half> %vb to <2 x float>
2070  %vf = fneg <2 x float> %va
2071  %vg = fneg <2 x float> %vd
2072  %vh = call <2 x float> @llvm.fma.v2f32(<2 x float> %vg, <2 x float> %splat, <2 x float> %vf)
2073  ret <2 x float> %vh
2074}
2075
2076define <2 x float> @vfwnmsac_vf2_v2f32(<2 x float> %va, <2 x half> %vb, half %c) {
2077; CHECK-LABEL: vfwnmsac_vf2_v2f32:
2078; CHECK:       # %bb.0:
2079; CHECK-NEXT:    vsetivli zero, 2, e16, mf4, ta, ma
2080; CHECK-NEXT:    vfwnmsac.vf v8, fa0, v9
2081; CHECK-NEXT:    ret
2082  %cext = fpext half %c to float
2083  %head = insertelement <2 x float> poison, float %cext, i32 0
2084  %splat = shufflevector <2 x float> %head, <2 x float> poison, <2 x i32> zeroinitializer
2085  %vd = fpext <2 x half> %vb to <2 x float>
2086  %vf = fneg <2 x float> %vd
2087  %vg = call <2 x float> @llvm.fma.v2f32(<2 x float> %vf, <2 x float> %splat, <2 x float> %va)
2088  ret <2 x float> %vg
2089}
2090