1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v,+m -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s
7 declare <2 x half> @llvm.vp.fma.v2f16(<2 x half>, <2 x half>, <2 x half>, <2 x i1>, i32)
8 declare <2 x half> @llvm.vp.fneg.v2f16(<2 x half>, <2 x i1>, i32)
9 declare <2 x half> @llvm.vp.merge.v2f16(<2 x i1>, <2 x half>, <2 x half>, i32)
10 declare <2 x half> @llvm.vp.select.v2f16(<2 x i1>, <2 x half>, <2 x half>, i32)
12 define <2 x half> @vfmsac_vv_v2f16(<2 x half> %a, <2 x half> %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
13 ; CHECK-LABEL: vfmsac_vv_v2f16:
15 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
16 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
17 ; CHECK-NEXT: vmv1r.v v8, v10
19 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
20 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
21 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
22 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %b, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
23 %u = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
27 define <2 x half> @vfmsac_vv_v2f16_unmasked(<2 x half> %a, <2 x half> %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
28 ; CHECK-LABEL: vfmsac_vv_v2f16_unmasked:
30 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
31 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
32 ; CHECK-NEXT: vmv1r.v v8, v10
34 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
35 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
36 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
37 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %b, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
38 %u = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %allones, <2 x half> %v, <2 x half> %c, i32 %evl)
42 define <2 x half> @vfmsac_vf_v2f16(<2 x half> %a, half %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
43 ; CHECK-LABEL: vfmsac_vf_v2f16:
45 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
46 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
47 ; CHECK-NEXT: vmv1r.v v8, v9
49 %elt.head = insertelement <2 x half> poison, half %b, i32 0
50 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
51 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
52 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
53 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
54 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %vb, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
55 %u = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
59 define <2 x half> @vfmsac_vf_v2f16_commute(<2 x half> %a, half %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
60 ; CHECK-LABEL: vfmsac_vf_v2f16_commute:
62 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, mu
63 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
64 ; CHECK-NEXT: vmv1r.v v8, v9
66 %elt.head = insertelement <2 x half> poison, half %b, i32 0
67 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
68 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
69 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
70 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
71 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %vb, <2 x half> %a, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
72 %u = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
76 define <2 x half> @vfmsac_vf_v2f16_unmasked(<2 x half> %a, half %b, <2 x half> %c, i32 zeroext %evl) {
77 ; CHECK-LABEL: vfmsac_vf_v2f16_unmasked:
79 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, tu, ma
80 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
81 ; CHECK-NEXT: vmv1r.v v8, v9
83 %elt.head = insertelement <2 x half> poison, half %b, i32 0
84 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
85 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
86 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
87 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
88 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %vb, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
89 %u = call <2 x half> @llvm.vp.merge.v2f16(<2 x i1> %allones, <2 x half> %v, <2 x half> %c, i32 %evl)
93 define <2 x half> @vfmsac_vv_v2f16_ta(<2 x half> %a, <2 x half> %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
94 ; CHECK-LABEL: vfmsac_vv_v2f16_ta:
96 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
97 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
98 ; CHECK-NEXT: vmv1r.v v8, v10
100 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
101 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
102 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
103 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %b, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
104 %u = call <2 x half> @llvm.vp.select.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
108 define <2 x half> @vfmsac_vf_v2f16_ta(<2 x half> %a, half %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
109 ; CHECK-LABEL: vfmsac_vf_v2f16_ta:
111 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
112 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
113 ; CHECK-NEXT: vmv1r.v v8, v9
115 %elt.head = insertelement <2 x half> poison, half %b, i32 0
116 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
117 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
118 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
119 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
120 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %a, <2 x half> %vb, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
121 %u = call <2 x half> @llvm.vp.select.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
125 define <2 x half> @vfmsac_vf_v2f16_commute_ta(<2 x half> %a, half %b, <2 x half> %c, <2 x i1> %m, i32 zeroext %evl) {
126 ; CHECK-LABEL: vfmsac_vf_v2f16_commute_ta:
128 ; CHECK-NEXT: vsetvli zero, a0, e16, mf4, ta, mu
129 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
130 ; CHECK-NEXT: vmv1r.v v8, v9
132 %elt.head = insertelement <2 x half> poison, half %b, i32 0
133 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
134 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
135 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
136 %negc = call <2 x half> @llvm.vp.fneg.v2f16(<2 x half> %c, <2 x i1> %allones, i32 %evl)
137 %v = call <2 x half> @llvm.vp.fma.v2f16(<2 x half> %vb, <2 x half> %a, <2 x half> %negc, <2 x i1> %allones, i32 %evl)
138 %u = call <2 x half> @llvm.vp.select.v2f16(<2 x i1> %m, <2 x half> %v, <2 x half> %c, i32 %evl)
142 declare <4 x half> @llvm.vp.fma.v4f16(<4 x half>, <4 x half>, <4 x half>, <4 x i1>, i32)
143 declare <4 x half> @llvm.vp.fneg.v4f16(<4 x half>, <4 x i1>, i32)
144 declare <4 x half> @llvm.vp.merge.v4f16(<4 x i1>, <4 x half>, <4 x half>, i32)
145 declare <4 x half> @llvm.vp.select.v4f16(<4 x i1>, <4 x half>, <4 x half>, i32)
147 define <4 x half> @vfmsac_vv_v4f16(<4 x half> %a, <4 x half> %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
148 ; CHECK-LABEL: vfmsac_vv_v4f16:
150 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
151 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
152 ; CHECK-NEXT: vmv1r.v v8, v10
154 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
155 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
156 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
157 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %b, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
158 %u = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
162 define <4 x half> @vfmsac_vv_v4f16_unmasked(<4 x half> %a, <4 x half> %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
163 ; CHECK-LABEL: vfmsac_vv_v4f16_unmasked:
165 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
166 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
167 ; CHECK-NEXT: vmv1r.v v8, v10
169 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
170 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
171 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
172 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %b, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
173 %u = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %allones, <4 x half> %v, <4 x half> %c, i32 %evl)
177 define <4 x half> @vfmsac_vf_v4f16(<4 x half> %a, half %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
178 ; CHECK-LABEL: vfmsac_vf_v4f16:
180 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
181 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
182 ; CHECK-NEXT: vmv1r.v v8, v9
184 %elt.head = insertelement <4 x half> poison, half %b, i32 0
185 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
186 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
187 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
188 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
189 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %vb, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
190 %u = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
194 define <4 x half> @vfmsac_vf_v4f16_commute(<4 x half> %a, half %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
195 ; CHECK-LABEL: vfmsac_vf_v4f16_commute:
197 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, mu
198 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
199 ; CHECK-NEXT: vmv1r.v v8, v9
201 %elt.head = insertelement <4 x half> poison, half %b, i32 0
202 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
203 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
204 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
205 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
206 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %vb, <4 x half> %a, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
207 %u = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
211 define <4 x half> @vfmsac_vf_v4f16_unmasked(<4 x half> %a, half %b, <4 x half> %c, i32 zeroext %evl) {
212 ; CHECK-LABEL: vfmsac_vf_v4f16_unmasked:
214 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, tu, ma
215 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
216 ; CHECK-NEXT: vmv1r.v v8, v9
218 %elt.head = insertelement <4 x half> poison, half %b, i32 0
219 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
220 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
221 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
222 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
223 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %vb, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
224 %u = call <4 x half> @llvm.vp.merge.v4f16(<4 x i1> %allones, <4 x half> %v, <4 x half> %c, i32 %evl)
228 define <4 x half> @vfmsac_vv_v4f16_ta(<4 x half> %a, <4 x half> %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
229 ; CHECK-LABEL: vfmsac_vv_v4f16_ta:
231 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
232 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
233 ; CHECK-NEXT: vmv1r.v v8, v10
235 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
236 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
237 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
238 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %b, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
239 %u = call <4 x half> @llvm.vp.select.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
243 define <4 x half> @vfmsac_vf_v4f16_ta(<4 x half> %a, half %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
244 ; CHECK-LABEL: vfmsac_vf_v4f16_ta:
246 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
247 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
248 ; CHECK-NEXT: vmv1r.v v8, v9
250 %elt.head = insertelement <4 x half> poison, half %b, i32 0
251 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
252 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
253 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
254 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
255 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %a, <4 x half> %vb, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
256 %u = call <4 x half> @llvm.vp.select.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
260 define <4 x half> @vfmsac_vf_v4f16_commute_ta(<4 x half> %a, half %b, <4 x half> %c, <4 x i1> %m, i32 zeroext %evl) {
261 ; CHECK-LABEL: vfmsac_vf_v4f16_commute_ta:
263 ; CHECK-NEXT: vsetvli zero, a0, e16, mf2, ta, mu
264 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
265 ; CHECK-NEXT: vmv1r.v v8, v9
267 %elt.head = insertelement <4 x half> poison, half %b, i32 0
268 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
269 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
270 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
271 %negc = call <4 x half> @llvm.vp.fneg.v4f16(<4 x half> %c, <4 x i1> %allones, i32 %evl)
272 %v = call <4 x half> @llvm.vp.fma.v4f16(<4 x half> %vb, <4 x half> %a, <4 x half> %negc, <4 x i1> %allones, i32 %evl)
273 %u = call <4 x half> @llvm.vp.select.v4f16(<4 x i1> %m, <4 x half> %v, <4 x half> %c, i32 %evl)
277 declare <8 x half> @llvm.vp.fma.v8f16(<8 x half>, <8 x half>, <8 x half>, <8 x i1>, i32)
278 declare <8 x half> @llvm.vp.fneg.v8f16(<8 x half>, <8 x i1>, i32)
279 declare <8 x half> @llvm.vp.merge.v8f16(<8 x i1>, <8 x half>, <8 x half>, i32)
280 declare <8 x half> @llvm.vp.select.v8f16(<8 x i1>, <8 x half>, <8 x half>, i32)
282 define <8 x half> @vfmsac_vv_v8f16(<8 x half> %a, <8 x half> %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
283 ; CHECK-LABEL: vfmsac_vv_v8f16:
285 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, mu
286 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
287 ; CHECK-NEXT: vmv1r.v v8, v10
289 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
290 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
291 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
292 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %b, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
293 %u = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
297 define <8 x half> @vfmsac_vv_v8f16_unmasked(<8 x half> %a, <8 x half> %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
298 ; CHECK-LABEL: vfmsac_vv_v8f16_unmasked:
300 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
301 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
302 ; CHECK-NEXT: vmv1r.v v8, v10
304 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
305 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
306 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
307 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %b, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
308 %u = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %allones, <8 x half> %v, <8 x half> %c, i32 %evl)
312 define <8 x half> @vfmsac_vf_v8f16(<8 x half> %a, half %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
313 ; CHECK-LABEL: vfmsac_vf_v8f16:
315 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, mu
316 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
317 ; CHECK-NEXT: vmv1r.v v8, v9
319 %elt.head = insertelement <8 x half> poison, half %b, i32 0
320 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
321 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
322 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
323 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
324 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %vb, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
325 %u = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
329 define <8 x half> @vfmsac_vf_v8f16_commute(<8 x half> %a, half %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
330 ; CHECK-LABEL: vfmsac_vf_v8f16_commute:
332 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, mu
333 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
334 ; CHECK-NEXT: vmv1r.v v8, v9
336 %elt.head = insertelement <8 x half> poison, half %b, i32 0
337 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
338 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
339 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
340 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
341 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %vb, <8 x half> %a, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
342 %u = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
346 define <8 x half> @vfmsac_vf_v8f16_unmasked(<8 x half> %a, half %b, <8 x half> %c, i32 zeroext %evl) {
347 ; CHECK-LABEL: vfmsac_vf_v8f16_unmasked:
349 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, tu, ma
350 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
351 ; CHECK-NEXT: vmv1r.v v8, v9
353 %elt.head = insertelement <8 x half> poison, half %b, i32 0
354 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
355 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
356 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
357 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
358 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %vb, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
359 %u = call <8 x half> @llvm.vp.merge.v8f16(<8 x i1> %allones, <8 x half> %v, <8 x half> %c, i32 %evl)
363 define <8 x half> @vfmsac_vv_v8f16_ta(<8 x half> %a, <8 x half> %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
364 ; CHECK-LABEL: vfmsac_vv_v8f16_ta:
366 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
367 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
368 ; CHECK-NEXT: vmv.v.v v8, v10
370 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
371 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
372 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
373 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %b, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
374 %u = call <8 x half> @llvm.vp.select.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
378 define <8 x half> @vfmsac_vf_v8f16_ta(<8 x half> %a, half %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
379 ; CHECK-LABEL: vfmsac_vf_v8f16_ta:
381 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
382 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
383 ; CHECK-NEXT: vmv.v.v v8, v9
385 %elt.head = insertelement <8 x half> poison, half %b, i32 0
386 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
387 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
388 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
389 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
390 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %a, <8 x half> %vb, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
391 %u = call <8 x half> @llvm.vp.select.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
395 define <8 x half> @vfmsac_vf_v8f16_commute_ta(<8 x half> %a, half %b, <8 x half> %c, <8 x i1> %m, i32 zeroext %evl) {
396 ; CHECK-LABEL: vfmsac_vf_v8f16_commute_ta:
398 ; CHECK-NEXT: vsetvli zero, a0, e16, m1, ta, mu
399 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
400 ; CHECK-NEXT: vmv.v.v v8, v9
402 %elt.head = insertelement <8 x half> poison, half %b, i32 0
403 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
404 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
405 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
406 %negc = call <8 x half> @llvm.vp.fneg.v8f16(<8 x half> %c, <8 x i1> %allones, i32 %evl)
407 %v = call <8 x half> @llvm.vp.fma.v8f16(<8 x half> %vb, <8 x half> %a, <8 x half> %negc, <8 x i1> %allones, i32 %evl)
408 %u = call <8 x half> @llvm.vp.select.v8f16(<8 x i1> %m, <8 x half> %v, <8 x half> %c, i32 %evl)
412 declare <16 x half> @llvm.vp.fma.v16f16(<16 x half>, <16 x half>, <16 x half>, <16 x i1>, i32)
413 declare <16 x half> @llvm.vp.fneg.v16f16(<16 x half>, <16 x i1>, i32)
414 declare <16 x half> @llvm.vp.merge.v16f16(<16 x i1>, <16 x half>, <16 x half>, i32)
415 declare <16 x half> @llvm.vp.select.v16f16(<16 x i1>, <16 x half>, <16 x half>, i32)
417 define <16 x half> @vfmsac_vv_v16f16(<16 x half> %a, <16 x half> %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
418 ; CHECK-LABEL: vfmsac_vv_v16f16:
420 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, mu
421 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
422 ; CHECK-NEXT: vmv2r.v v8, v12
424 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
425 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
426 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
427 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %b, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
428 %u = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
432 define <16 x half> @vfmsac_vv_v16f16_unmasked(<16 x half> %a, <16 x half> %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
433 ; CHECK-LABEL: vfmsac_vv_v16f16_unmasked:
435 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
436 ; CHECK-NEXT: vfmsac.vv v12, v8, v10
437 ; CHECK-NEXT: vmv2r.v v8, v12
439 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
440 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
441 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
442 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %b, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
443 %u = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %allones, <16 x half> %v, <16 x half> %c, i32 %evl)
447 define <16 x half> @vfmsac_vf_v16f16(<16 x half> %a, half %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
448 ; CHECK-LABEL: vfmsac_vf_v16f16:
450 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, mu
451 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
452 ; CHECK-NEXT: vmv2r.v v8, v10
454 %elt.head = insertelement <16 x half> poison, half %b, i32 0
455 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
456 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
457 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
458 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
459 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %vb, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
460 %u = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
464 define <16 x half> @vfmsac_vf_v16f16_commute(<16 x half> %a, half %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
465 ; CHECK-LABEL: vfmsac_vf_v16f16_commute:
467 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, mu
468 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
469 ; CHECK-NEXT: vmv2r.v v8, v10
471 %elt.head = insertelement <16 x half> poison, half %b, i32 0
472 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
473 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
474 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
475 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
476 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %vb, <16 x half> %a, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
477 %u = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
481 define <16 x half> @vfmsac_vf_v16f16_unmasked(<16 x half> %a, half %b, <16 x half> %c, i32 zeroext %evl) {
482 ; CHECK-LABEL: vfmsac_vf_v16f16_unmasked:
484 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, tu, ma
485 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8
486 ; CHECK-NEXT: vmv2r.v v8, v10
488 %elt.head = insertelement <16 x half> poison, half %b, i32 0
489 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
490 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
491 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
492 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
493 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %vb, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
494 %u = call <16 x half> @llvm.vp.merge.v16f16(<16 x i1> %allones, <16 x half> %v, <16 x half> %c, i32 %evl)
498 define <16 x half> @vfmsac_vv_v16f16_ta(<16 x half> %a, <16 x half> %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
499 ; CHECK-LABEL: vfmsac_vv_v16f16_ta:
501 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
502 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
503 ; CHECK-NEXT: vmv.v.v v8, v12
505 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
506 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
507 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
508 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %b, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
509 %u = call <16 x half> @llvm.vp.select.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
513 define <16 x half> @vfmsac_vf_v16f16_ta(<16 x half> %a, half %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
514 ; CHECK-LABEL: vfmsac_vf_v16f16_ta:
516 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
517 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
518 ; CHECK-NEXT: vmv.v.v v8, v10
520 %elt.head = insertelement <16 x half> poison, half %b, i32 0
521 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
522 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
523 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
524 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
525 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %a, <16 x half> %vb, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
526 %u = call <16 x half> @llvm.vp.select.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
530 define <16 x half> @vfmsac_vf_v16f16_commute_ta(<16 x half> %a, half %b, <16 x half> %c, <16 x i1> %m, i32 zeroext %evl) {
531 ; CHECK-LABEL: vfmsac_vf_v16f16_commute_ta:
533 ; CHECK-NEXT: vsetvli zero, a0, e16, m2, ta, mu
534 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
535 ; CHECK-NEXT: vmv.v.v v8, v10
537 %elt.head = insertelement <16 x half> poison, half %b, i32 0
538 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
539 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
540 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
541 %negc = call <16 x half> @llvm.vp.fneg.v16f16(<16 x half> %c, <16 x i1> %allones, i32 %evl)
542 %v = call <16 x half> @llvm.vp.fma.v16f16(<16 x half> %vb, <16 x half> %a, <16 x half> %negc, <16 x i1> %allones, i32 %evl)
543 %u = call <16 x half> @llvm.vp.select.v16f16(<16 x i1> %m, <16 x half> %v, <16 x half> %c, i32 %evl)
547 declare <32 x half> @llvm.vp.fma.v32f16(<32 x half>, <32 x half>, <32 x half>, <32 x i1>, i32)
548 declare <32 x half> @llvm.vp.fneg.v32f16(<32 x half>, <32 x i1>, i32)
549 declare <32 x half> @llvm.vp.merge.v32f16(<32 x i1>, <32 x half>, <32 x half>, i32)
550 declare <32 x half> @llvm.vp.select.v32f16(<32 x i1>, <32 x half>, <32 x half>, i32)
552 define <32 x half> @vfmsac_vv_v32f16(<32 x half> %a, <32 x half> %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
553 ; CHECK-LABEL: vfmsac_vv_v32f16:
555 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, mu
556 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
557 ; CHECK-NEXT: vmv4r.v v8, v16
559 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
560 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
561 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
562 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %b, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
563 %u = call <32 x half> @llvm.vp.merge.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
567 define <32 x half> @vfmsac_vv_v32f16_unmasked(<32 x half> %a, <32 x half> %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
568 ; CHECK-LABEL: vfmsac_vv_v32f16_unmasked:
570 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, ma
571 ; CHECK-NEXT: vfmsac.vv v16, v8, v12
572 ; CHECK-NEXT: vmv4r.v v8, v16
574 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
575 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
576 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
577 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %b, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
578 %u = call <32 x half> @llvm.vp.merge.v32f16(<32 x i1> %allones, <32 x half> %v, <32 x half> %c, i32 %evl)
582 define <32 x half> @vfmsac_vf_v32f16(<32 x half> %a, half %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
583 ; CHECK-LABEL: vfmsac_vf_v32f16:
585 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, mu
586 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
587 ; CHECK-NEXT: vmv4r.v v8, v12
589 %elt.head = insertelement <32 x half> poison, half %b, i32 0
590 %vb = shufflevector <32 x half> %elt.head, <32 x half> poison, <32 x i32> zeroinitializer
591 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
592 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
593 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
594 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %vb, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
595 %u = call <32 x half> @llvm.vp.merge.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
599 define <32 x half> @vfmsac_vf_v32f16_commute(<32 x half> %a, half %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
600 ; CHECK-LABEL: vfmsac_vf_v32f16_commute:
602 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, mu
603 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
604 ; CHECK-NEXT: vmv4r.v v8, v12
606 %elt.head = insertelement <32 x half> poison, half %b, i32 0
607 %vb = shufflevector <32 x half> %elt.head, <32 x half> poison, <32 x i32> zeroinitializer
608 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
609 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
610 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
611 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %vb, <32 x half> %a, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
612 %u = call <32 x half> @llvm.vp.merge.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
616 define <32 x half> @vfmsac_vf_v32f16_unmasked(<32 x half> %a, half %b, <32 x half> %c, i32 zeroext %evl) {
617 ; CHECK-LABEL: vfmsac_vf_v32f16_unmasked:
619 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, tu, ma
620 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8
621 ; CHECK-NEXT: vmv4r.v v8, v12
623 %elt.head = insertelement <32 x half> poison, half %b, i32 0
624 %vb = shufflevector <32 x half> %elt.head, <32 x half> poison, <32 x i32> zeroinitializer
625 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
626 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
627 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
628 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %vb, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
629 %u = call <32 x half> @llvm.vp.merge.v32f16(<32 x i1> %allones, <32 x half> %v, <32 x half> %c, i32 %evl)
633 define <32 x half> @vfmsac_vv_v32f16_ta(<32 x half> %a, <32 x half> %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
634 ; CHECK-LABEL: vfmsac_vv_v32f16_ta:
636 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
637 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
638 ; CHECK-NEXT: vmv.v.v v8, v16
640 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
641 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
642 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
643 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %b, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
644 %u = call <32 x half> @llvm.vp.select.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
648 define <32 x half> @vfmsac_vf_v32f16_ta(<32 x half> %a, half %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
649 ; CHECK-LABEL: vfmsac_vf_v32f16_ta:
651 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
652 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
653 ; CHECK-NEXT: vmv.v.v v8, v12
655 %elt.head = insertelement <32 x half> poison, half %b, i32 0
656 %vb = shufflevector <32 x half> %elt.head, <32 x half> poison, <32 x i32> zeroinitializer
657 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
658 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
659 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
660 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %a, <32 x half> %vb, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
661 %u = call <32 x half> @llvm.vp.select.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
665 define <32 x half> @vfmsac_vf_v32f16_commute_ta(<32 x half> %a, half %b, <32 x half> %c, <32 x i1> %m, i32 zeroext %evl) {
666 ; CHECK-LABEL: vfmsac_vf_v32f16_commute_ta:
668 ; CHECK-NEXT: vsetvli zero, a0, e16, m4, ta, mu
669 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
670 ; CHECK-NEXT: vmv.v.v v8, v12
672 %elt.head = insertelement <32 x half> poison, half %b, i32 0
673 %vb = shufflevector <32 x half> %elt.head, <32 x half> poison, <32 x i32> zeroinitializer
674 %splat = insertelement <32 x i1> poison, i1 -1, i32 0
675 %allones = shufflevector <32 x i1> %splat, <32 x i1> poison, <32 x i32> zeroinitializer
676 %negc = call <32 x half> @llvm.vp.fneg.v32f16(<32 x half> %c, <32 x i1> %allones, i32 %evl)
677 %v = call <32 x half> @llvm.vp.fma.v32f16(<32 x half> %vb, <32 x half> %a, <32 x half> %negc, <32 x i1> %allones, i32 %evl)
678 %u = call <32 x half> @llvm.vp.select.v32f16(<32 x i1> %m, <32 x half> %v, <32 x half> %c, i32 %evl)
682 declare <2 x float> @llvm.vp.fma.v2f32(<2 x float>, <2 x float>, <2 x float>, <2 x i1>, i32)
683 declare <2 x float> @llvm.vp.fneg.v2f32(<2 x float>, <2 x i1>, i32)
684 declare <2 x float> @llvm.vp.merge.v2f32(<2 x i1>, <2 x float>, <2 x float>, i32)
685 declare <2 x float> @llvm.vp.select.v2f32(<2 x i1>, <2 x float>, <2 x float>, i32)
687 define <2 x float> @vfmsac_vv_v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
688 ; CHECK-LABEL: vfmsac_vv_v2f32:
690 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, mu
691 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
692 ; CHECK-NEXT: vmv1r.v v8, v10
694 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
695 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
696 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
697 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
698 %u = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
702 define <2 x float> @vfmsac_vv_v2f32_unmasked(<2 x float> %a, <2 x float> %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
703 ; CHECK-LABEL: vfmsac_vv_v2f32_unmasked:
705 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
706 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
707 ; CHECK-NEXT: vmv1r.v v8, v10
709 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
710 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
711 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
712 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
713 %u = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %allones, <2 x float> %v, <2 x float> %c, i32 %evl)
717 define <2 x float> @vfmsac_vf_v2f32(<2 x float> %a, float %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
718 ; CHECK-LABEL: vfmsac_vf_v2f32:
720 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, mu
721 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
722 ; CHECK-NEXT: vmv1r.v v8, v9
724 %elt.head = insertelement <2 x float> poison, float %b, i32 0
725 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
726 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
727 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
728 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
729 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %vb, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
730 %u = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
734 define <2 x float> @vfmsac_vf_v2f32_commute(<2 x float> %a, float %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
735 ; CHECK-LABEL: vfmsac_vf_v2f32_commute:
737 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, mu
738 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
739 ; CHECK-NEXT: vmv1r.v v8, v9
741 %elt.head = insertelement <2 x float> poison, float %b, i32 0
742 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
743 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
744 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
745 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
746 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %vb, <2 x float> %a, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
747 %u = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
751 define <2 x float> @vfmsac_vf_v2f32_unmasked(<2 x float> %a, float %b, <2 x float> %c, i32 zeroext %evl) {
752 ; CHECK-LABEL: vfmsac_vf_v2f32_unmasked:
754 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, tu, ma
755 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
756 ; CHECK-NEXT: vmv1r.v v8, v9
758 %elt.head = insertelement <2 x float> poison, float %b, i32 0
759 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
760 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
761 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
762 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
763 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %vb, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
764 %u = call <2 x float> @llvm.vp.merge.v2f32(<2 x i1> %allones, <2 x float> %v, <2 x float> %c, i32 %evl)
768 define <2 x float> @vfmsac_vv_v2f32_ta(<2 x float> %a, <2 x float> %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
769 ; CHECK-LABEL: vfmsac_vv_v2f32_ta:
771 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
772 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
773 ; CHECK-NEXT: vmv1r.v v8, v10
775 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
776 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
777 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
778 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %b, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
779 %u = call <2 x float> @llvm.vp.select.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
783 define <2 x float> @vfmsac_vf_v2f32_ta(<2 x float> %a, float %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
784 ; CHECK-LABEL: vfmsac_vf_v2f32_ta:
786 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
787 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
788 ; CHECK-NEXT: vmv1r.v v8, v9
790 %elt.head = insertelement <2 x float> poison, float %b, i32 0
791 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
792 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
793 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
794 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
795 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %a, <2 x float> %vb, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
796 %u = call <2 x float> @llvm.vp.select.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
800 define <2 x float> @vfmsac_vf_v2f32_commute_ta(<2 x float> %a, float %b, <2 x float> %c, <2 x i1> %m, i32 zeroext %evl) {
801 ; CHECK-LABEL: vfmsac_vf_v2f32_commute_ta:
803 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, mu
804 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
805 ; CHECK-NEXT: vmv1r.v v8, v9
807 %elt.head = insertelement <2 x float> poison, float %b, i32 0
808 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
809 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
810 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
811 %negc = call <2 x float> @llvm.vp.fneg.v2f32(<2 x float> %c, <2 x i1> %allones, i32 %evl)
812 %v = call <2 x float> @llvm.vp.fma.v2f32(<2 x float> %vb, <2 x float> %a, <2 x float> %negc, <2 x i1> %allones, i32 %evl)
813 %u = call <2 x float> @llvm.vp.select.v2f32(<2 x i1> %m, <2 x float> %v, <2 x float> %c, i32 %evl)
817 declare <4 x float> @llvm.vp.fma.v4f32(<4 x float>, <4 x float>, <4 x float>, <4 x i1>, i32)
818 declare <4 x float> @llvm.vp.fneg.v4f32(<4 x float>, <4 x i1>, i32)
819 declare <4 x float> @llvm.vp.merge.v4f32(<4 x i1>, <4 x float>, <4 x float>, i32)
820 declare <4 x float> @llvm.vp.select.v4f32(<4 x i1>, <4 x float>, <4 x float>, i32)
822 define <4 x float> @vfmsac_vv_v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
823 ; CHECK-LABEL: vfmsac_vv_v4f32:
825 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
826 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
827 ; CHECK-NEXT: vmv1r.v v8, v10
829 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
830 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
831 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
832 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
833 %u = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
837 define <4 x float> @vfmsac_vv_v4f32_unmasked(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
838 ; CHECK-LABEL: vfmsac_vv_v4f32_unmasked:
840 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
841 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
842 ; CHECK-NEXT: vmv1r.v v8, v10
844 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
845 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
846 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
847 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
848 %u = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %allones, <4 x float> %v, <4 x float> %c, i32 %evl)
852 define <4 x float> @vfmsac_vf_v4f32(<4 x float> %a, float %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
853 ; CHECK-LABEL: vfmsac_vf_v4f32:
855 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
856 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
857 ; CHECK-NEXT: vmv1r.v v8, v9
859 %elt.head = insertelement <4 x float> poison, float %b, i32 0
860 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
861 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
862 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
863 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
864 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %vb, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
865 %u = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
869 define <4 x float> @vfmsac_vf_v4f32_commute(<4 x float> %a, float %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
870 ; CHECK-LABEL: vfmsac_vf_v4f32_commute:
872 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, mu
873 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
874 ; CHECK-NEXT: vmv1r.v v8, v9
876 %elt.head = insertelement <4 x float> poison, float %b, i32 0
877 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
878 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
879 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
880 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
881 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %vb, <4 x float> %a, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
882 %u = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
886 define <4 x float> @vfmsac_vf_v4f32_unmasked(<4 x float> %a, float %b, <4 x float> %c, i32 zeroext %evl) {
887 ; CHECK-LABEL: vfmsac_vf_v4f32_unmasked:
889 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, tu, ma
890 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
891 ; CHECK-NEXT: vmv1r.v v8, v9
893 %elt.head = insertelement <4 x float> poison, float %b, i32 0
894 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
895 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
896 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
897 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
898 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %vb, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
899 %u = call <4 x float> @llvm.vp.merge.v4f32(<4 x i1> %allones, <4 x float> %v, <4 x float> %c, i32 %evl)
903 define <4 x float> @vfmsac_vv_v4f32_ta(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
904 ; CHECK-LABEL: vfmsac_vv_v4f32_ta:
906 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu
907 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
908 ; CHECK-NEXT: vmv.v.v v8, v10
910 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
911 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
912 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
913 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %b, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
914 %u = call <4 x float> @llvm.vp.select.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
918 define <4 x float> @vfmsac_vf_v4f32_ta(<4 x float> %a, float %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
919 ; CHECK-LABEL: vfmsac_vf_v4f32_ta:
921 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu
922 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
923 ; CHECK-NEXT: vmv.v.v v8, v9
925 %elt.head = insertelement <4 x float> poison, float %b, i32 0
926 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
927 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
928 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
929 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
930 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %a, <4 x float> %vb, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
931 %u = call <4 x float> @llvm.vp.select.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
935 define <4 x float> @vfmsac_vf_v4f32_commute_ta(<4 x float> %a, float %b, <4 x float> %c, <4 x i1> %m, i32 zeroext %evl) {
936 ; CHECK-LABEL: vfmsac_vf_v4f32_commute_ta:
938 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, mu
939 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
940 ; CHECK-NEXT: vmv.v.v v8, v9
942 %elt.head = insertelement <4 x float> poison, float %b, i32 0
943 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
944 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
945 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
946 %negc = call <4 x float> @llvm.vp.fneg.v4f32(<4 x float> %c, <4 x i1> %allones, i32 %evl)
947 %v = call <4 x float> @llvm.vp.fma.v4f32(<4 x float> %vb, <4 x float> %a, <4 x float> %negc, <4 x i1> %allones, i32 %evl)
948 %u = call <4 x float> @llvm.vp.select.v4f32(<4 x i1> %m, <4 x float> %v, <4 x float> %c, i32 %evl)
952 declare <8 x float> @llvm.vp.fma.v8f32(<8 x float>, <8 x float>, <8 x float>, <8 x i1>, i32)
953 declare <8 x float> @llvm.vp.fneg.v8f32(<8 x float>, <8 x i1>, i32)
954 declare <8 x float> @llvm.vp.merge.v8f32(<8 x i1>, <8 x float>, <8 x float>, i32)
955 declare <8 x float> @llvm.vp.select.v8f32(<8 x i1>, <8 x float>, <8 x float>, i32)
957 define <8 x float> @vfmsac_vv_v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
958 ; CHECK-LABEL: vfmsac_vv_v8f32:
960 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, mu
961 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
962 ; CHECK-NEXT: vmv2r.v v8, v12
964 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
965 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
966 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
967 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
968 %u = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
972 define <8 x float> @vfmsac_vv_v8f32_unmasked(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
973 ; CHECK-LABEL: vfmsac_vv_v8f32_unmasked:
975 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
976 ; CHECK-NEXT: vfmsac.vv v12, v8, v10
977 ; CHECK-NEXT: vmv2r.v v8, v12
979 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
980 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
981 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
982 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
983 %u = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %allones, <8 x float> %v, <8 x float> %c, i32 %evl)
987 define <8 x float> @vfmsac_vf_v8f32(<8 x float> %a, float %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
988 ; CHECK-LABEL: vfmsac_vf_v8f32:
990 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, mu
991 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
992 ; CHECK-NEXT: vmv2r.v v8, v10
994 %elt.head = insertelement <8 x float> poison, float %b, i32 0
995 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
996 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
997 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
998 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
999 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %vb, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1000 %u = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
1004 define <8 x float> @vfmsac_vf_v8f32_commute(<8 x float> %a, float %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
1005 ; CHECK-LABEL: vfmsac_vf_v8f32_commute:
1007 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, mu
1008 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1009 ; CHECK-NEXT: vmv2r.v v8, v10
1011 %elt.head = insertelement <8 x float> poison, float %b, i32 0
1012 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1013 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1014 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1015 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
1016 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %vb, <8 x float> %a, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1017 %u = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
1021 define <8 x float> @vfmsac_vf_v8f32_unmasked(<8 x float> %a, float %b, <8 x float> %c, i32 zeroext %evl) {
1022 ; CHECK-LABEL: vfmsac_vf_v8f32_unmasked:
1024 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, tu, ma
1025 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8
1026 ; CHECK-NEXT: vmv2r.v v8, v10
1028 %elt.head = insertelement <8 x float> poison, float %b, i32 0
1029 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1030 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1031 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1032 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
1033 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %vb, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1034 %u = call <8 x float> @llvm.vp.merge.v8f32(<8 x i1> %allones, <8 x float> %v, <8 x float> %c, i32 %evl)
1038 define <8 x float> @vfmsac_vv_v8f32_ta(<8 x float> %a, <8 x float> %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
1039 ; CHECK-LABEL: vfmsac_vv_v8f32_ta:
1041 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu
1042 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
1043 ; CHECK-NEXT: vmv.v.v v8, v12
1045 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1046 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1047 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
1048 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %b, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1049 %u = call <8 x float> @llvm.vp.select.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
1053 define <8 x float> @vfmsac_vf_v8f32_ta(<8 x float> %a, float %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vfmsac_vf_v8f32_ta:
1056 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu
1057 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1058 ; CHECK-NEXT: vmv.v.v v8, v10
1060 %elt.head = insertelement <8 x float> poison, float %b, i32 0
1061 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1062 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1063 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1064 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
1065 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %a, <8 x float> %vb, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1066 %u = call <8 x float> @llvm.vp.select.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
1070 define <8 x float> @vfmsac_vf_v8f32_commute_ta(<8 x float> %a, float %b, <8 x float> %c, <8 x i1> %m, i32 zeroext %evl) {
1071 ; CHECK-LABEL: vfmsac_vf_v8f32_commute_ta:
1073 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, mu
1074 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1075 ; CHECK-NEXT: vmv.v.v v8, v10
1077 %elt.head = insertelement <8 x float> poison, float %b, i32 0
1078 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
1079 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1080 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1081 %negc = call <8 x float> @llvm.vp.fneg.v8f32(<8 x float> %c, <8 x i1> %allones, i32 %evl)
1082 %v = call <8 x float> @llvm.vp.fma.v8f32(<8 x float> %vb, <8 x float> %a, <8 x float> %negc, <8 x i1> %allones, i32 %evl)
1083 %u = call <8 x float> @llvm.vp.select.v8f32(<8 x i1> %m, <8 x float> %v, <8 x float> %c, i32 %evl)
1087 declare <16 x float> @llvm.vp.fma.v16f32(<16 x float>, <16 x float>, <16 x float>, <16 x i1>, i32)
1088 declare <16 x float> @llvm.vp.fneg.v16f32(<16 x float>, <16 x i1>, i32)
1089 declare <16 x float> @llvm.vp.merge.v16f32(<16 x i1>, <16 x float>, <16 x float>, i32)
1090 declare <16 x float> @llvm.vp.select.v16f32(<16 x i1>, <16 x float>, <16 x float>, i32)
1092 define <16 x float> @vfmsac_vv_v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1093 ; CHECK-LABEL: vfmsac_vv_v16f32:
1095 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, mu
1096 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
1097 ; CHECK-NEXT: vmv4r.v v8, v16
1099 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1100 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1101 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1102 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1103 %u = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1107 define <16 x float> @vfmsac_vv_v16f32_unmasked(<16 x float> %a, <16 x float> %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1108 ; CHECK-LABEL: vfmsac_vv_v16f32_unmasked:
1110 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1111 ; CHECK-NEXT: vfmsac.vv v16, v8, v12
1112 ; CHECK-NEXT: vmv4r.v v8, v16
1114 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1115 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1116 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1117 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1118 %u = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %allones, <16 x float> %v, <16 x float> %c, i32 %evl)
1122 define <16 x float> @vfmsac_vf_v16f32(<16 x float> %a, float %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1123 ; CHECK-LABEL: vfmsac_vf_v16f32:
1125 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, mu
1126 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1127 ; CHECK-NEXT: vmv4r.v v8, v12
1129 %elt.head = insertelement <16 x float> poison, float %b, i32 0
1130 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1131 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1132 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1133 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1134 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %vb, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1135 %u = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1139 define <16 x float> @vfmsac_vf_v16f32_commute(<16 x float> %a, float %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1140 ; CHECK-LABEL: vfmsac_vf_v16f32_commute:
1142 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, mu
1143 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1144 ; CHECK-NEXT: vmv4r.v v8, v12
1146 %elt.head = insertelement <16 x float> poison, float %b, i32 0
1147 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1148 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1149 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1150 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1151 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %vb, <16 x float> %a, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1152 %u = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1156 define <16 x float> @vfmsac_vf_v16f32_unmasked(<16 x float> %a, float %b, <16 x float> %c, i32 zeroext %evl) {
1157 ; CHECK-LABEL: vfmsac_vf_v16f32_unmasked:
1159 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, tu, ma
1160 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8
1161 ; CHECK-NEXT: vmv4r.v v8, v12
1163 %elt.head = insertelement <16 x float> poison, float %b, i32 0
1164 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1165 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1166 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1167 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1168 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %vb, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1169 %u = call <16 x float> @llvm.vp.merge.v16f32(<16 x i1> %allones, <16 x float> %v, <16 x float> %c, i32 %evl)
1173 define <16 x float> @vfmsac_vv_v16f32_ta(<16 x float> %a, <16 x float> %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1174 ; CHECK-LABEL: vfmsac_vv_v16f32_ta:
1176 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu
1177 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
1178 ; CHECK-NEXT: vmv.v.v v8, v16
1180 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1181 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1182 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1183 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %b, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1184 %u = call <16 x float> @llvm.vp.select.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1188 define <16 x float> @vfmsac_vf_v16f32_ta(<16 x float> %a, float %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1189 ; CHECK-LABEL: vfmsac_vf_v16f32_ta:
1191 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu
1192 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1193 ; CHECK-NEXT: vmv.v.v v8, v12
1195 %elt.head = insertelement <16 x float> poison, float %b, i32 0
1196 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1197 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1198 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1199 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1200 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %a, <16 x float> %vb, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1201 %u = call <16 x float> @llvm.vp.select.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1205 define <16 x float> @vfmsac_vf_v16f32_commute_ta(<16 x float> %a, float %b, <16 x float> %c, <16 x i1> %m, i32 zeroext %evl) {
1206 ; CHECK-LABEL: vfmsac_vf_v16f32_commute_ta:
1208 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, mu
1209 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1210 ; CHECK-NEXT: vmv.v.v v8, v12
1212 %elt.head = insertelement <16 x float> poison, float %b, i32 0
1213 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
1214 %splat = insertelement <16 x i1> poison, i1 -1, i32 0
1215 %allones = shufflevector <16 x i1> %splat, <16 x i1> poison, <16 x i32> zeroinitializer
1216 %negc = call <16 x float> @llvm.vp.fneg.v16f32(<16 x float> %c, <16 x i1> %allones, i32 %evl)
1217 %v = call <16 x float> @llvm.vp.fma.v16f32(<16 x float> %vb, <16 x float> %a, <16 x float> %negc, <16 x i1> %allones, i32 %evl)
1218 %u = call <16 x float> @llvm.vp.select.v16f32(<16 x i1> %m, <16 x float> %v, <16 x float> %c, i32 %evl)
1222 declare <2 x double> @llvm.vp.fma.v2f64(<2 x double>, <2 x double>, <2 x double>, <2 x i1>, i32)
1223 declare <2 x double> @llvm.vp.fneg.v2f64(<2 x double>, <2 x i1>, i32)
1224 declare <2 x double> @llvm.vp.merge.v2f64(<2 x i1>, <2 x double>, <2 x double>, i32)
1225 declare <2 x double> @llvm.vp.select.v2f64(<2 x i1>, <2 x double>, <2 x double>, i32)
1227 define <2 x double> @vfmsac_vv_v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1228 ; CHECK-LABEL: vfmsac_vv_v2f64:
1230 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, mu
1231 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
1232 ; CHECK-NEXT: vmv1r.v v8, v10
1234 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1235 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1236 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1237 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1238 %u = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1242 define <2 x double> @vfmsac_vv_v2f64_unmasked(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1243 ; CHECK-LABEL: vfmsac_vv_v2f64_unmasked:
1245 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1246 ; CHECK-NEXT: vfmsac.vv v10, v8, v9
1247 ; CHECK-NEXT: vmv1r.v v8, v10
1249 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1250 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1251 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1252 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1253 %u = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %allones, <2 x double> %v, <2 x double> %c, i32 %evl)
1257 define <2 x double> @vfmsac_vf_v2f64(<2 x double> %a, double %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1258 ; CHECK-LABEL: vfmsac_vf_v2f64:
1260 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, mu
1261 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
1262 ; CHECK-NEXT: vmv1r.v v8, v9
1264 %elt.head = insertelement <2 x double> poison, double %b, i32 0
1265 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1266 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1267 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1268 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1269 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %vb, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1270 %u = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1274 define <2 x double> @vfmsac_vf_v2f64_commute(<2 x double> %a, double %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1275 ; CHECK-LABEL: vfmsac_vf_v2f64_commute:
1277 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, mu
1278 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
1279 ; CHECK-NEXT: vmv1r.v v8, v9
1281 %elt.head = insertelement <2 x double> poison, double %b, i32 0
1282 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1283 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1284 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1285 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1286 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %vb, <2 x double> %a, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1287 %u = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1291 define <2 x double> @vfmsac_vf_v2f64_unmasked(<2 x double> %a, double %b, <2 x double> %c, i32 zeroext %evl) {
1292 ; CHECK-LABEL: vfmsac_vf_v2f64_unmasked:
1294 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, tu, ma
1295 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8
1296 ; CHECK-NEXT: vmv1r.v v8, v9
1298 %elt.head = insertelement <2 x double> poison, double %b, i32 0
1299 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1300 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1301 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1302 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1303 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %vb, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1304 %u = call <2 x double> @llvm.vp.merge.v2f64(<2 x i1> %allones, <2 x double> %v, <2 x double> %c, i32 %evl)
1308 define <2 x double> @vfmsac_vv_v2f64_ta(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1309 ; CHECK-LABEL: vfmsac_vv_v2f64_ta:
1311 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
1312 ; CHECK-NEXT: vfmsac.vv v10, v8, v9, v0.t
1313 ; CHECK-NEXT: vmv.v.v v8, v10
1315 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1316 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1317 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1318 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %b, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1319 %u = call <2 x double> @llvm.vp.select.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1323 define <2 x double> @vfmsac_vf_v2f64_ta(<2 x double> %a, double %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1324 ; CHECK-LABEL: vfmsac_vf_v2f64_ta:
1326 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
1327 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
1328 ; CHECK-NEXT: vmv.v.v v8, v9
1330 %elt.head = insertelement <2 x double> poison, double %b, i32 0
1331 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1332 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1333 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1334 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1335 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %a, <2 x double> %vb, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1336 %u = call <2 x double> @llvm.vp.select.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1340 define <2 x double> @vfmsac_vf_v2f64_commute_ta(<2 x double> %a, double %b, <2 x double> %c, <2 x i1> %m, i32 zeroext %evl) {
1341 ; CHECK-LABEL: vfmsac_vf_v2f64_commute_ta:
1343 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, mu
1344 ; CHECK-NEXT: vfmsac.vf v9, fa0, v8, v0.t
1345 ; CHECK-NEXT: vmv.v.v v8, v9
1347 %elt.head = insertelement <2 x double> poison, double %b, i32 0
1348 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
1349 %splat = insertelement <2 x i1> poison, i1 -1, i32 0
1350 %allones = shufflevector <2 x i1> %splat, <2 x i1> poison, <2 x i32> zeroinitializer
1351 %negc = call <2 x double> @llvm.vp.fneg.v2f64(<2 x double> %c, <2 x i1> %allones, i32 %evl)
1352 %v = call <2 x double> @llvm.vp.fma.v2f64(<2 x double> %vb, <2 x double> %a, <2 x double> %negc, <2 x i1> %allones, i32 %evl)
1353 %u = call <2 x double> @llvm.vp.select.v2f64(<2 x i1> %m, <2 x double> %v, <2 x double> %c, i32 %evl)
1357 declare <4 x double> @llvm.vp.fma.v4f64(<4 x double>, <4 x double>, <4 x double>, <4 x i1>, i32)
1358 declare <4 x double> @llvm.vp.fneg.v4f64(<4 x double>, <4 x i1>, i32)
1359 declare <4 x double> @llvm.vp.merge.v4f64(<4 x i1>, <4 x double>, <4 x double>, i32)
1360 declare <4 x double> @llvm.vp.select.v4f64(<4 x i1>, <4 x double>, <4 x double>, i32)
1362 define <4 x double> @vfmsac_vv_v4f64(<4 x double> %a, <4 x double> %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1363 ; CHECK-LABEL: vfmsac_vv_v4f64:
1365 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, mu
1366 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
1367 ; CHECK-NEXT: vmv2r.v v8, v12
1369 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1370 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1371 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1372 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %b, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1373 %u = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1377 define <4 x double> @vfmsac_vv_v4f64_unmasked(<4 x double> %a, <4 x double> %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1378 ; CHECK-LABEL: vfmsac_vv_v4f64_unmasked:
1380 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1381 ; CHECK-NEXT: vfmsac.vv v12, v8, v10
1382 ; CHECK-NEXT: vmv2r.v v8, v12
1384 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1385 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1386 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1387 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %b, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1388 %u = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %allones, <4 x double> %v, <4 x double> %c, i32 %evl)
1392 define <4 x double> @vfmsac_vf_v4f64(<4 x double> %a, double %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1393 ; CHECK-LABEL: vfmsac_vf_v4f64:
1395 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, mu
1396 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1397 ; CHECK-NEXT: vmv2r.v v8, v10
1399 %elt.head = insertelement <4 x double> poison, double %b, i32 0
1400 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1401 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1402 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1403 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1404 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %vb, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1405 %u = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1409 define <4 x double> @vfmsac_vf_v4f64_commute(<4 x double> %a, double %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1410 ; CHECK-LABEL: vfmsac_vf_v4f64_commute:
1412 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, mu
1413 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1414 ; CHECK-NEXT: vmv2r.v v8, v10
1416 %elt.head = insertelement <4 x double> poison, double %b, i32 0
1417 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1418 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1419 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1420 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1421 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %vb, <4 x double> %a, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1422 %u = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1426 define <4 x double> @vfmsac_vf_v4f64_unmasked(<4 x double> %a, double %b, <4 x double> %c, i32 zeroext %evl) {
1427 ; CHECK-LABEL: vfmsac_vf_v4f64_unmasked:
1429 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, tu, ma
1430 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8
1431 ; CHECK-NEXT: vmv2r.v v8, v10
1433 %elt.head = insertelement <4 x double> poison, double %b, i32 0
1434 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1435 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1436 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1437 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1438 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %vb, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1439 %u = call <4 x double> @llvm.vp.merge.v4f64(<4 x i1> %allones, <4 x double> %v, <4 x double> %c, i32 %evl)
1443 define <4 x double> @vfmsac_vv_v4f64_ta(<4 x double> %a, <4 x double> %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1444 ; CHECK-LABEL: vfmsac_vv_v4f64_ta:
1446 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu
1447 ; CHECK-NEXT: vfmsac.vv v12, v8, v10, v0.t
1448 ; CHECK-NEXT: vmv.v.v v8, v12
1450 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1451 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1452 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1453 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %b, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1454 %u = call <4 x double> @llvm.vp.select.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1458 define <4 x double> @vfmsac_vf_v4f64_ta(<4 x double> %a, double %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1459 ; CHECK-LABEL: vfmsac_vf_v4f64_ta:
1461 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu
1462 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1463 ; CHECK-NEXT: vmv.v.v v8, v10
1465 %elt.head = insertelement <4 x double> poison, double %b, i32 0
1466 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1467 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1468 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1469 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1470 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %a, <4 x double> %vb, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1471 %u = call <4 x double> @llvm.vp.select.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1475 define <4 x double> @vfmsac_vf_v4f64_commute_ta(<4 x double> %a, double %b, <4 x double> %c, <4 x i1> %m, i32 zeroext %evl) {
1476 ; CHECK-LABEL: vfmsac_vf_v4f64_commute_ta:
1478 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, mu
1479 ; CHECK-NEXT: vfmsac.vf v10, fa0, v8, v0.t
1480 ; CHECK-NEXT: vmv.v.v v8, v10
1482 %elt.head = insertelement <4 x double> poison, double %b, i32 0
1483 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
1484 %splat = insertelement <4 x i1> poison, i1 -1, i32 0
1485 %allones = shufflevector <4 x i1> %splat, <4 x i1> poison, <4 x i32> zeroinitializer
1486 %negc = call <4 x double> @llvm.vp.fneg.v4f64(<4 x double> %c, <4 x i1> %allones, i32 %evl)
1487 %v = call <4 x double> @llvm.vp.fma.v4f64(<4 x double> %vb, <4 x double> %a, <4 x double> %negc, <4 x i1> %allones, i32 %evl)
1488 %u = call <4 x double> @llvm.vp.select.v4f64(<4 x i1> %m, <4 x double> %v, <4 x double> %c, i32 %evl)
1492 declare <8 x double> @llvm.vp.fma.v8f64(<8 x double>, <8 x double>, <8 x double>, <8 x i1>, i32)
1493 declare <8 x double> @llvm.vp.fneg.v8f64(<8 x double>, <8 x i1>, i32)
1494 declare <8 x double> @llvm.vp.merge.v8f64(<8 x i1>, <8 x double>, <8 x double>, i32)
1495 declare <8 x double> @llvm.vp.select.v8f64(<8 x i1>, <8 x double>, <8 x double>, i32)
1497 define <8 x double> @vfmsac_vv_v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1498 ; CHECK-LABEL: vfmsac_vv_v8f64:
1500 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, mu
1501 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
1502 ; CHECK-NEXT: vmv4r.v v8, v16
1504 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1505 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1506 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1507 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1508 %u = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)
1512 define <8 x double> @vfmsac_vv_v8f64_unmasked(<8 x double> %a, <8 x double> %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1513 ; CHECK-LABEL: vfmsac_vv_v8f64_unmasked:
1515 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1516 ; CHECK-NEXT: vfmsac.vv v16, v8, v12
1517 ; CHECK-NEXT: vmv4r.v v8, v16
1519 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1520 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1521 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1522 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1523 %u = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %allones, <8 x double> %v, <8 x double> %c, i32 %evl)
1527 define <8 x double> @vfmsac_vf_v8f64(<8 x double> %a, double %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1528 ; CHECK-LABEL: vfmsac_vf_v8f64:
1530 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, mu
1531 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1532 ; CHECK-NEXT: vmv4r.v v8, v12
1534 %elt.head = insertelement <8 x double> poison, double %b, i32 0
1535 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1536 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1537 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1538 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1539 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %vb, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1540 %u = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)
1544 define <8 x double> @vfmsac_vf_v8f64_commute(<8 x double> %a, double %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1545 ; CHECK-LABEL: vfmsac_vf_v8f64_commute:
1547 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, mu
1548 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1549 ; CHECK-NEXT: vmv4r.v v8, v12
1551 %elt.head = insertelement <8 x double> poison, double %b, i32 0
1552 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1553 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1554 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1555 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1556 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %vb, <8 x double> %a, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1557 %u = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)
1561 define <8 x double> @vfmsac_vf_v8f64_unmasked(<8 x double> %a, double %b, <8 x double> %c, i32 zeroext %evl) {
1562 ; CHECK-LABEL: vfmsac_vf_v8f64_unmasked:
1564 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, tu, ma
1565 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8
1566 ; CHECK-NEXT: vmv4r.v v8, v12
1568 %elt.head = insertelement <8 x double> poison, double %b, i32 0
1569 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1570 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1571 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1572 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1573 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %vb, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1574 %u = call <8 x double> @llvm.vp.merge.v8f64(<8 x i1> %allones, <8 x double> %v, <8 x double> %c, i32 %evl)
1578 define <8 x double> @vfmsac_vv_v8f64_ta(<8 x double> %a, <8 x double> %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1579 ; CHECK-LABEL: vfmsac_vv_v8f64_ta:
1581 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu
1582 ; CHECK-NEXT: vfmsac.vv v16, v8, v12, v0.t
1583 ; CHECK-NEXT: vmv.v.v v8, v16
1585 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1586 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1587 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1588 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %b, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1589 %u = call <8 x double> @llvm.vp.select.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)
1593 define <8 x double> @vfmsac_vf_v8f64_ta(<8 x double> %a, double %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1594 ; CHECK-LABEL: vfmsac_vf_v8f64_ta:
1596 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu
1597 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1598 ; CHECK-NEXT: vmv.v.v v8, v12
1600 %elt.head = insertelement <8 x double> poison, double %b, i32 0
1601 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1602 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1603 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1604 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1605 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %a, <8 x double> %vb, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1606 %u = call <8 x double> @llvm.vp.select.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)
1610 define <8 x double> @vfmsac_vf_v8f64_commute_ta(<8 x double> %a, double %b, <8 x double> %c, <8 x i1> %m, i32 zeroext %evl) {
1611 ; CHECK-LABEL: vfmsac_vf_v8f64_commute_ta:
1613 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, mu
1614 ; CHECK-NEXT: vfmsac.vf v12, fa0, v8, v0.t
1615 ; CHECK-NEXT: vmv.v.v v8, v12
1617 %elt.head = insertelement <8 x double> poison, double %b, i32 0
1618 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
1619 %splat = insertelement <8 x i1> poison, i1 -1, i32 0
1620 %allones = shufflevector <8 x i1> %splat, <8 x i1> poison, <8 x i32> zeroinitializer
1621 %negc = call <8 x double> @llvm.vp.fneg.v8f64(<8 x double> %c, <8 x i1> %allones, i32 %evl)
1622 %v = call <8 x double> @llvm.vp.fma.v8f64(<8 x double> %vb, <8 x double> %a, <8 x double> %negc, <8 x i1> %allones, i32 %evl)
1623 %u = call <8 x double> @llvm.vp.select.v8f64(<8 x i1> %m, <8 x double> %v, <8 x double> %c, i32 %evl)