1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfh,+v -target-abi=ilp32d \
3 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
4 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfh,+v -target-abi=lp64d \
5 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFH
6 ; RUN: llc -mtriple=riscv32 -mattr=+d,+zfh,+zvfhmin,+v -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfh,+zvfhmin,+v -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
11 declare <2 x half> @llvm.vp.fadd.v2f16(<2 x half>, <2 x half>, <2 x i1>, i32)
13 define <2 x half> @vfadd_vv_v2f16(<2 x half> %va, <2 x half> %b, <2 x i1> %m, i32 zeroext %evl) {
14 ; ZVFH-LABEL: vfadd_vv_v2f16:
16 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
17 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
20 ; ZVFHMIN-LABEL: vfadd_vv_v2f16:
22 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
23 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
24 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
25 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
26 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10, v0.t
27 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
28 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
30 %v = call <2 x half> @llvm.vp.fadd.v2f16(<2 x half> %va, <2 x half> %b, <2 x i1> %m, i32 %evl)
34 define <2 x half> @vfadd_vv_v2f16_unmasked(<2 x half> %va, <2 x half> %b, i32 zeroext %evl) {
35 ; ZVFH-LABEL: vfadd_vv_v2f16_unmasked:
37 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
38 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
41 ; ZVFHMIN-LABEL: vfadd_vv_v2f16_unmasked:
43 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
44 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
45 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
46 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
47 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10
48 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
49 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
51 %v = call <2 x half> @llvm.vp.fadd.v2f16(<2 x half> %va, <2 x half> %b, <2 x i1> splat (i1 true), i32 %evl)
55 define <2 x half> @vfadd_vf_v2f16(<2 x half> %va, half %b, <2 x i1> %m, i32 zeroext %evl) {
56 ; ZVFH-LABEL: vfadd_vf_v2f16:
58 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
59 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
62 ; ZVFHMIN-LABEL: vfadd_vf_v2f16:
64 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
65 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
66 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
67 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
68 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
69 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
70 ; ZVFHMIN-NEXT: vfadd.vv v9, v10, v8, v0.t
71 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
72 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
74 %elt.head = insertelement <2 x half> poison, half %b, i32 0
75 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
76 %v = call <2 x half> @llvm.vp.fadd.v2f16(<2 x half> %va, <2 x half> %vb, <2 x i1> %m, i32 %evl)
80 define <2 x half> @vfadd_vf_v2f16_unmasked(<2 x half> %va, half %b, i32 zeroext %evl) {
81 ; ZVFH-LABEL: vfadd_vf_v2f16_unmasked:
83 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
84 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
87 ; ZVFHMIN-LABEL: vfadd_vf_v2f16_unmasked:
89 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
90 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
91 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
92 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
93 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
94 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
95 ; ZVFHMIN-NEXT: vfadd.vv v9, v10, v8
96 ; ZVFHMIN-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
97 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
99 %elt.head = insertelement <2 x half> poison, half %b, i32 0
100 %vb = shufflevector <2 x half> %elt.head, <2 x half> poison, <2 x i32> zeroinitializer
101 %v = call <2 x half> @llvm.vp.fadd.v2f16(<2 x half> %va, <2 x half> %vb, <2 x i1> splat (i1 true), i32 %evl)
105 declare <3 x half> @llvm.vp.fadd.v3f16(<3 x half>, <3 x half>, <3 x i1>, i32)
107 define <3 x half> @vfadd_vv_v3f16(<3 x half> %va, <3 x half> %b, <3 x i1> %m, i32 zeroext %evl) {
108 ; ZVFH-LABEL: vfadd_vv_v3f16:
110 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
111 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
114 ; ZVFHMIN-LABEL: vfadd_vv_v3f16:
116 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
117 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
118 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
119 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
120 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10, v0.t
121 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
122 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
124 %v = call <3 x half> @llvm.vp.fadd.v3f16(<3 x half> %va, <3 x half> %b, <3 x i1> %m, i32 %evl)
128 declare <4 x half> @llvm.vp.fadd.v4f16(<4 x half>, <4 x half>, <4 x i1>, i32)
130 define <4 x half> @vfadd_vv_v4f16(<4 x half> %va, <4 x half> %b, <4 x i1> %m, i32 zeroext %evl) {
131 ; ZVFH-LABEL: vfadd_vv_v4f16:
133 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
134 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
137 ; ZVFHMIN-LABEL: vfadd_vv_v4f16:
139 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
140 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
141 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
142 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
143 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10, v0.t
144 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
145 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
147 %v = call <4 x half> @llvm.vp.fadd.v4f16(<4 x half> %va, <4 x half> %b, <4 x i1> %m, i32 %evl)
151 define <4 x half> @vfadd_vv_v4f16_unmasked(<4 x half> %va, <4 x half> %b, i32 zeroext %evl) {
152 ; ZVFH-LABEL: vfadd_vv_v4f16_unmasked:
154 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
155 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
158 ; ZVFHMIN-LABEL: vfadd_vv_v4f16_unmasked:
160 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
161 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
162 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
163 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
164 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10
165 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
166 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
168 %v = call <4 x half> @llvm.vp.fadd.v4f16(<4 x half> %va, <4 x half> %b, <4 x i1> splat (i1 true), i32 %evl)
172 define <4 x half> @vfadd_vf_v4f16(<4 x half> %va, half %b, <4 x i1> %m, i32 zeroext %evl) {
173 ; ZVFH-LABEL: vfadd_vf_v4f16:
175 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
176 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
179 ; ZVFHMIN-LABEL: vfadd_vf_v4f16:
181 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
182 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
183 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
184 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
185 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
186 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
187 ; ZVFHMIN-NEXT: vfadd.vv v9, v10, v8, v0.t
188 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
189 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
191 %elt.head = insertelement <4 x half> poison, half %b, i32 0
192 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
193 %v = call <4 x half> @llvm.vp.fadd.v4f16(<4 x half> %va, <4 x half> %vb, <4 x i1> %m, i32 %evl)
197 define <4 x half> @vfadd_vf_v4f16_unmasked(<4 x half> %va, half %b, i32 zeroext %evl) {
198 ; ZVFH-LABEL: vfadd_vf_v4f16_unmasked:
200 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
201 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
204 ; ZVFHMIN-LABEL: vfadd_vf_v4f16_unmasked:
206 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
207 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
208 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
209 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
210 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v9
211 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
212 ; ZVFHMIN-NEXT: vfadd.vv v9, v10, v8
213 ; ZVFHMIN-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
214 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
216 %elt.head = insertelement <4 x half> poison, half %b, i32 0
217 %vb = shufflevector <4 x half> %elt.head, <4 x half> poison, <4 x i32> zeroinitializer
218 %v = call <4 x half> @llvm.vp.fadd.v4f16(<4 x half> %va, <4 x half> %vb, <4 x i1> splat (i1 true), i32 %evl)
222 declare <8 x half> @llvm.vp.fadd.v8f16(<8 x half>, <8 x half>, <8 x i1>, i32)
224 define <8 x half> @vfadd_vv_v8f16(<8 x half> %va, <8 x half> %b, <8 x i1> %m, i32 zeroext %evl) {
225 ; ZVFH-LABEL: vfadd_vv_v8f16:
227 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
228 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
231 ; ZVFHMIN-LABEL: vfadd_vv_v8f16:
233 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
234 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
235 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
236 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
237 ; ZVFHMIN-NEXT: vfadd.vv v10, v12, v10, v0.t
238 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
239 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
241 %v = call <8 x half> @llvm.vp.fadd.v8f16(<8 x half> %va, <8 x half> %b, <8 x i1> %m, i32 %evl)
245 define <8 x half> @vfadd_vv_v8f16_unmasked(<8 x half> %va, <8 x half> %b, i32 zeroext %evl) {
246 ; ZVFH-LABEL: vfadd_vv_v8f16_unmasked:
248 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
249 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
252 ; ZVFHMIN-LABEL: vfadd_vv_v8f16_unmasked:
254 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
255 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
256 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
257 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
258 ; ZVFHMIN-NEXT: vfadd.vv v10, v12, v10
259 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
260 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
262 %v = call <8 x half> @llvm.vp.fadd.v8f16(<8 x half> %va, <8 x half> %b, <8 x i1> splat (i1 true), i32 %evl)
266 define <8 x half> @vfadd_vf_v8f16(<8 x half> %va, half %b, <8 x i1> %m, i32 zeroext %evl) {
267 ; ZVFH-LABEL: vfadd_vf_v8f16:
269 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
270 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
273 ; ZVFHMIN-LABEL: vfadd_vf_v8f16:
275 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
276 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
277 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
278 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
279 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
280 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
281 ; ZVFHMIN-NEXT: vfadd.vv v10, v10, v12, v0.t
282 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
283 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
285 %elt.head = insertelement <8 x half> poison, half %b, i32 0
286 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
287 %v = call <8 x half> @llvm.vp.fadd.v8f16(<8 x half> %va, <8 x half> %vb, <8 x i1> %m, i32 %evl)
291 define <8 x half> @vfadd_vf_v8f16_unmasked(<8 x half> %va, half %b, i32 zeroext %evl) {
292 ; ZVFH-LABEL: vfadd_vf_v8f16_unmasked:
294 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
295 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
298 ; ZVFHMIN-LABEL: vfadd_vf_v8f16_unmasked:
300 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
301 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
302 ; ZVFHMIN-NEXT: vmv.v.x v9, a1
303 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
304 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
305 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
306 ; ZVFHMIN-NEXT: vfadd.vv v10, v10, v12
307 ; ZVFHMIN-NEXT: vsetivli zero, 8, e16, m1, ta, ma
308 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
310 %elt.head = insertelement <8 x half> poison, half %b, i32 0
311 %vb = shufflevector <8 x half> %elt.head, <8 x half> poison, <8 x i32> zeroinitializer
312 %v = call <8 x half> @llvm.vp.fadd.v8f16(<8 x half> %va, <8 x half> %vb, <8 x i1> splat (i1 true), i32 %evl)
316 declare <16 x half> @llvm.vp.fadd.v16f16(<16 x half>, <16 x half>, <16 x i1>, i32)
318 define <16 x half> @vfadd_vv_v16f16(<16 x half> %va, <16 x half> %b, <16 x i1> %m, i32 zeroext %evl) {
319 ; ZVFH-LABEL: vfadd_vv_v16f16:
321 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
322 ; ZVFH-NEXT: vfadd.vv v8, v8, v10, v0.t
325 ; ZVFHMIN-LABEL: vfadd_vv_v16f16:
327 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
328 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
329 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
330 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
331 ; ZVFHMIN-NEXT: vfadd.vv v12, v16, v12, v0.t
332 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
333 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
335 %v = call <16 x half> @llvm.vp.fadd.v16f16(<16 x half> %va, <16 x half> %b, <16 x i1> %m, i32 %evl)
339 define <16 x half> @vfadd_vv_v16f16_unmasked(<16 x half> %va, <16 x half> %b, i32 zeroext %evl) {
340 ; ZVFH-LABEL: vfadd_vv_v16f16_unmasked:
342 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
343 ; ZVFH-NEXT: vfadd.vv v8, v8, v10
346 ; ZVFHMIN-LABEL: vfadd_vv_v16f16_unmasked:
348 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
349 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
350 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
351 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
352 ; ZVFHMIN-NEXT: vfadd.vv v12, v16, v12
353 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
354 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
356 %v = call <16 x half> @llvm.vp.fadd.v16f16(<16 x half> %va, <16 x half> %b, <16 x i1> splat (i1 true), i32 %evl)
360 define <16 x half> @vfadd_vf_v16f16(<16 x half> %va, half %b, <16 x i1> %m, i32 zeroext %evl) {
361 ; ZVFH-LABEL: vfadd_vf_v16f16:
363 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
364 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
367 ; ZVFHMIN-LABEL: vfadd_vf_v16f16:
369 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
370 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
371 ; ZVFHMIN-NEXT: vmv.v.x v10, a1
372 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
373 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
374 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
375 ; ZVFHMIN-NEXT: vfadd.vv v12, v12, v16, v0.t
376 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
377 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
379 %elt.head = insertelement <16 x half> poison, half %b, i32 0
380 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
381 %v = call <16 x half> @llvm.vp.fadd.v16f16(<16 x half> %va, <16 x half> %vb, <16 x i1> %m, i32 %evl)
385 define <16 x half> @vfadd_vf_v16f16_unmasked(<16 x half> %va, half %b, i32 zeroext %evl) {
386 ; ZVFH-LABEL: vfadd_vf_v16f16_unmasked:
388 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
389 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
392 ; ZVFHMIN-LABEL: vfadd_vf_v16f16_unmasked:
394 ; ZVFHMIN-NEXT: fmv.x.h a1, fa0
395 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
396 ; ZVFHMIN-NEXT: vmv.v.x v10, a1
397 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
398 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
399 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
400 ; ZVFHMIN-NEXT: vfadd.vv v12, v12, v16
401 ; ZVFHMIN-NEXT: vsetivli zero, 16, e16, m2, ta, ma
402 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
404 %elt.head = insertelement <16 x half> poison, half %b, i32 0
405 %vb = shufflevector <16 x half> %elt.head, <16 x half> poison, <16 x i32> zeroinitializer
406 %v = call <16 x half> @llvm.vp.fadd.v16f16(<16 x half> %va, <16 x half> %vb, <16 x i1> splat (i1 true), i32 %evl)
410 declare <2 x float> @llvm.vp.fadd.v2f32(<2 x float>, <2 x float>, <2 x i1>, i32)
412 define <2 x float> @vfadd_vv_v2f32(<2 x float> %va, <2 x float> %b, <2 x i1> %m, i32 zeroext %evl) {
413 ; CHECK-LABEL: vfadd_vv_v2f32:
415 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
416 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
418 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %va, <2 x float> %b, <2 x i1> %m, i32 %evl)
422 define <2 x float> @vfadd_vv_v2f32_unmasked(<2 x float> %va, <2 x float> %b, i32 zeroext %evl) {
423 ; CHECK-LABEL: vfadd_vv_v2f32_unmasked:
425 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
426 ; CHECK-NEXT: vfadd.vv v8, v8, v9
428 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %va, <2 x float> %b, <2 x i1> splat (i1 true), i32 %evl)
432 define <2 x float> @vfadd_vf_v2f32(<2 x float> %va, float %b, <2 x i1> %m, i32 zeroext %evl) {
433 ; CHECK-LABEL: vfadd_vf_v2f32:
435 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
436 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
438 %elt.head = insertelement <2 x float> poison, float %b, i32 0
439 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
440 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %va, <2 x float> %vb, <2 x i1> %m, i32 %evl)
444 define <2 x float> @vfadd_vf_v2f32_commute(<2 x float> %va, float %b, <2 x i1> %m, i32 zeroext %evl) {
445 ; CHECK-LABEL: vfadd_vf_v2f32_commute:
447 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
448 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
450 %elt.head = insertelement <2 x float> poison, float %b, i32 0
451 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
452 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %vb, <2 x float> %va, <2 x i1> %m, i32 %evl)
456 define <2 x float> @vfadd_vf_v2f32_unmasked(<2 x float> %va, float %b, i32 zeroext %evl) {
457 ; CHECK-LABEL: vfadd_vf_v2f32_unmasked:
459 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
460 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
462 %elt.head = insertelement <2 x float> poison, float %b, i32 0
463 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
464 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %va, <2 x float> %vb, <2 x i1> splat (i1 true), i32 %evl)
468 define <2 x float> @vfadd_vf_v2f32_unmasked_commute(<2 x float> %va, float %b, i32 zeroext %evl) {
469 ; CHECK-LABEL: vfadd_vf_v2f32_unmasked_commute:
471 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
472 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
474 %elt.head = insertelement <2 x float> poison, float %b, i32 0
475 %vb = shufflevector <2 x float> %elt.head, <2 x float> poison, <2 x i32> zeroinitializer
476 %v = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> %vb, <2 x float> %va, <2 x i1> splat (i1 true), i32 %evl)
480 declare <4 x float> @llvm.vp.fadd.v4f32(<4 x float>, <4 x float>, <4 x i1>, i32)
482 define <4 x float> @vfadd_vv_v4f32(<4 x float> %va, <4 x float> %b, <4 x i1> %m, i32 zeroext %evl) {
483 ; CHECK-LABEL: vfadd_vv_v4f32:
485 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
486 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
488 %v = call <4 x float> @llvm.vp.fadd.v4f32(<4 x float> %va, <4 x float> %b, <4 x i1> %m, i32 %evl)
492 define <4 x float> @vfadd_vv_v4f32_unmasked(<4 x float> %va, <4 x float> %b, i32 zeroext %evl) {
493 ; CHECK-LABEL: vfadd_vv_v4f32_unmasked:
495 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
496 ; CHECK-NEXT: vfadd.vv v8, v8, v9
498 %v = call <4 x float> @llvm.vp.fadd.v4f32(<4 x float> %va, <4 x float> %b, <4 x i1> splat (i1 true), i32 %evl)
502 define <4 x float> @vfadd_vf_v4f32(<4 x float> %va, float %b, <4 x i1> %m, i32 zeroext %evl) {
503 ; CHECK-LABEL: vfadd_vf_v4f32:
505 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
506 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
508 %elt.head = insertelement <4 x float> poison, float %b, i32 0
509 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
510 %v = call <4 x float> @llvm.vp.fadd.v4f32(<4 x float> %va, <4 x float> %vb, <4 x i1> %m, i32 %evl)
514 define <4 x float> @vfadd_vf_v4f32_unmasked(<4 x float> %va, float %b, i32 zeroext %evl) {
515 ; CHECK-LABEL: vfadd_vf_v4f32_unmasked:
517 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
518 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
520 %elt.head = insertelement <4 x float> poison, float %b, i32 0
521 %vb = shufflevector <4 x float> %elt.head, <4 x float> poison, <4 x i32> zeroinitializer
522 %v = call <4 x float> @llvm.vp.fadd.v4f32(<4 x float> %va, <4 x float> %vb, <4 x i1> splat (i1 true), i32 %evl)
526 declare <8 x float> @llvm.vp.fadd.v8f32(<8 x float>, <8 x float>, <8 x i1>, i32)
528 define <8 x float> @vfadd_vv_v8f32(<8 x float> %va, <8 x float> %b, <8 x i1> %m, i32 zeroext %evl) {
529 ; CHECK-LABEL: vfadd_vv_v8f32:
531 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
532 ; CHECK-NEXT: vfadd.vv v8, v8, v10, v0.t
534 %v = call <8 x float> @llvm.vp.fadd.v8f32(<8 x float> %va, <8 x float> %b, <8 x i1> %m, i32 %evl)
538 define <8 x float> @vfadd_vv_v8f32_unmasked(<8 x float> %va, <8 x float> %b, i32 zeroext %evl) {
539 ; CHECK-LABEL: vfadd_vv_v8f32_unmasked:
541 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
542 ; CHECK-NEXT: vfadd.vv v8, v8, v10
544 %v = call <8 x float> @llvm.vp.fadd.v8f32(<8 x float> %va, <8 x float> %b, <8 x i1> splat (i1 true), i32 %evl)
548 define <8 x float> @vfadd_vf_v8f32(<8 x float> %va, float %b, <8 x i1> %m, i32 zeroext %evl) {
549 ; CHECK-LABEL: vfadd_vf_v8f32:
551 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
552 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
554 %elt.head = insertelement <8 x float> poison, float %b, i32 0
555 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
556 %v = call <8 x float> @llvm.vp.fadd.v8f32(<8 x float> %va, <8 x float> %vb, <8 x i1> %m, i32 %evl)
560 define <8 x float> @vfadd_vf_v8f32_unmasked(<8 x float> %va, float %b, i32 zeroext %evl) {
561 ; CHECK-LABEL: vfadd_vf_v8f32_unmasked:
563 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
564 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
566 %elt.head = insertelement <8 x float> poison, float %b, i32 0
567 %vb = shufflevector <8 x float> %elt.head, <8 x float> poison, <8 x i32> zeroinitializer
568 %v = call <8 x float> @llvm.vp.fadd.v8f32(<8 x float> %va, <8 x float> %vb, <8 x i1> splat (i1 true), i32 %evl)
572 declare <16 x float> @llvm.vp.fadd.v16f32(<16 x float>, <16 x float>, <16 x i1>, i32)
574 define <16 x float> @vfadd_vv_v16f32(<16 x float> %va, <16 x float> %b, <16 x i1> %m, i32 zeroext %evl) {
575 ; CHECK-LABEL: vfadd_vv_v16f32:
577 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
578 ; CHECK-NEXT: vfadd.vv v8, v8, v12, v0.t
580 %v = call <16 x float> @llvm.vp.fadd.v16f32(<16 x float> %va, <16 x float> %b, <16 x i1> %m, i32 %evl)
584 define <16 x float> @vfadd_vv_v16f32_unmasked(<16 x float> %va, <16 x float> %b, i32 zeroext %evl) {
585 ; CHECK-LABEL: vfadd_vv_v16f32_unmasked:
587 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
588 ; CHECK-NEXT: vfadd.vv v8, v8, v12
590 %v = call <16 x float> @llvm.vp.fadd.v16f32(<16 x float> %va, <16 x float> %b, <16 x i1> splat (i1 true), i32 %evl)
594 define <16 x float> @vfadd_vf_v16f32(<16 x float> %va, float %b, <16 x i1> %m, i32 zeroext %evl) {
595 ; CHECK-LABEL: vfadd_vf_v16f32:
597 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
598 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
600 %elt.head = insertelement <16 x float> poison, float %b, i32 0
601 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
602 %v = call <16 x float> @llvm.vp.fadd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x i1> %m, i32 %evl)
606 define <16 x float> @vfadd_vf_v16f32_unmasked(<16 x float> %va, float %b, i32 zeroext %evl) {
607 ; CHECK-LABEL: vfadd_vf_v16f32_unmasked:
609 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
610 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
612 %elt.head = insertelement <16 x float> poison, float %b, i32 0
613 %vb = shufflevector <16 x float> %elt.head, <16 x float> poison, <16 x i32> zeroinitializer
614 %v = call <16 x float> @llvm.vp.fadd.v16f32(<16 x float> %va, <16 x float> %vb, <16 x i1> splat (i1 true), i32 %evl)
618 declare <2 x double> @llvm.vp.fadd.v2f64(<2 x double>, <2 x double>, <2 x i1>, i32)
620 define <2 x double> @vfadd_vv_v2f64(<2 x double> %va, <2 x double> %b, <2 x i1> %m, i32 zeroext %evl) {
621 ; CHECK-LABEL: vfadd_vv_v2f64:
623 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
624 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
626 %v = call <2 x double> @llvm.vp.fadd.v2f64(<2 x double> %va, <2 x double> %b, <2 x i1> %m, i32 %evl)
630 define <2 x double> @vfadd_vv_v2f64_unmasked(<2 x double> %va, <2 x double> %b, i32 zeroext %evl) {
631 ; CHECK-LABEL: vfadd_vv_v2f64_unmasked:
633 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
634 ; CHECK-NEXT: vfadd.vv v8, v8, v9
636 %v = call <2 x double> @llvm.vp.fadd.v2f64(<2 x double> %va, <2 x double> %b, <2 x i1> splat (i1 true), i32 %evl)
640 define <2 x double> @vfadd_vf_v2f64(<2 x double> %va, double %b, <2 x i1> %m, i32 zeroext %evl) {
641 ; CHECK-LABEL: vfadd_vf_v2f64:
643 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
644 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
646 %elt.head = insertelement <2 x double> poison, double %b, i32 0
647 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
648 %v = call <2 x double> @llvm.vp.fadd.v2f64(<2 x double> %va, <2 x double> %vb, <2 x i1> %m, i32 %evl)
652 define <2 x double> @vfadd_vf_v2f64_unmasked(<2 x double> %va, double %b, i32 zeroext %evl) {
653 ; CHECK-LABEL: vfadd_vf_v2f64_unmasked:
655 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
656 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
658 %elt.head = insertelement <2 x double> poison, double %b, i32 0
659 %vb = shufflevector <2 x double> %elt.head, <2 x double> poison, <2 x i32> zeroinitializer
660 %v = call <2 x double> @llvm.vp.fadd.v2f64(<2 x double> %va, <2 x double> %vb, <2 x i1> splat (i1 true), i32 %evl)
664 declare <4 x double> @llvm.vp.fadd.v4f64(<4 x double>, <4 x double>, <4 x i1>, i32)
666 define <4 x double> @vfadd_vv_v4f64(<4 x double> %va, <4 x double> %b, <4 x i1> %m, i32 zeroext %evl) {
667 ; CHECK-LABEL: vfadd_vv_v4f64:
669 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
670 ; CHECK-NEXT: vfadd.vv v8, v8, v10, v0.t
672 %v = call <4 x double> @llvm.vp.fadd.v4f64(<4 x double> %va, <4 x double> %b, <4 x i1> %m, i32 %evl)
676 define <4 x double> @vfadd_vv_v4f64_unmasked(<4 x double> %va, <4 x double> %b, i32 zeroext %evl) {
677 ; CHECK-LABEL: vfadd_vv_v4f64_unmasked:
679 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
680 ; CHECK-NEXT: vfadd.vv v8, v8, v10
682 %v = call <4 x double> @llvm.vp.fadd.v4f64(<4 x double> %va, <4 x double> %b, <4 x i1> splat (i1 true), i32 %evl)
686 define <4 x double> @vfadd_vf_v4f64(<4 x double> %va, double %b, <4 x i1> %m, i32 zeroext %evl) {
687 ; CHECK-LABEL: vfadd_vf_v4f64:
689 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
690 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
692 %elt.head = insertelement <4 x double> poison, double %b, i32 0
693 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
694 %v = call <4 x double> @llvm.vp.fadd.v4f64(<4 x double> %va, <4 x double> %vb, <4 x i1> %m, i32 %evl)
698 define <4 x double> @vfadd_vf_v4f64_unmasked(<4 x double> %va, double %b, i32 zeroext %evl) {
699 ; CHECK-LABEL: vfadd_vf_v4f64_unmasked:
701 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
702 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
704 %elt.head = insertelement <4 x double> poison, double %b, i32 0
705 %vb = shufflevector <4 x double> %elt.head, <4 x double> poison, <4 x i32> zeroinitializer
706 %v = call <4 x double> @llvm.vp.fadd.v4f64(<4 x double> %va, <4 x double> %vb, <4 x i1> splat (i1 true), i32 %evl)
710 declare <8 x double> @llvm.vp.fadd.v8f64(<8 x double>, <8 x double>, <8 x i1>, i32)
712 define <8 x double> @vfadd_vv_v8f64(<8 x double> %va, <8 x double> %b, <8 x i1> %m, i32 zeroext %evl) {
713 ; CHECK-LABEL: vfadd_vv_v8f64:
715 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
716 ; CHECK-NEXT: vfadd.vv v8, v8, v12, v0.t
718 %v = call <8 x double> @llvm.vp.fadd.v8f64(<8 x double> %va, <8 x double> %b, <8 x i1> %m, i32 %evl)
722 define <8 x double> @vfadd_vv_v8f64_unmasked(<8 x double> %va, <8 x double> %b, i32 zeroext %evl) {
723 ; CHECK-LABEL: vfadd_vv_v8f64_unmasked:
725 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
726 ; CHECK-NEXT: vfadd.vv v8, v8, v12
728 %v = call <8 x double> @llvm.vp.fadd.v8f64(<8 x double> %va, <8 x double> %b, <8 x i1> splat (i1 true), i32 %evl)
732 define <8 x double> @vfadd_vf_v8f64(<8 x double> %va, double %b, <8 x i1> %m, i32 zeroext %evl) {
733 ; CHECK-LABEL: vfadd_vf_v8f64:
735 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
736 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
738 %elt.head = insertelement <8 x double> poison, double %b, i32 0
739 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
740 %v = call <8 x double> @llvm.vp.fadd.v8f64(<8 x double> %va, <8 x double> %vb, <8 x i1> %m, i32 %evl)
744 define <8 x double> @vfadd_vf_v8f64_unmasked(<8 x double> %va, double %b, i32 zeroext %evl) {
745 ; CHECK-LABEL: vfadd_vf_v8f64_unmasked:
747 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
748 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
750 %elt.head = insertelement <8 x double> poison, double %b, i32 0
751 %vb = shufflevector <8 x double> %elt.head, <8 x double> poison, <8 x i32> zeroinitializer
752 %v = call <8 x double> @llvm.vp.fadd.v8f64(<8 x double> %va, <8 x double> %vb, <8 x i1> splat (i1 true), i32 %evl)
756 declare <16 x double> @llvm.vp.fadd.v16f64(<16 x double>, <16 x double>, <16 x i1>, i32)
758 define <16 x double> @vfadd_vv_v16f64(<16 x double> %va, <16 x double> %b, <16 x i1> %m, i32 zeroext %evl) {
759 ; CHECK-LABEL: vfadd_vv_v16f64:
761 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
762 ; CHECK-NEXT: vfadd.vv v8, v8, v16, v0.t
764 %v = call <16 x double> @llvm.vp.fadd.v16f64(<16 x double> %va, <16 x double> %b, <16 x i1> %m, i32 %evl)
768 define <16 x double> @vfadd_vv_v16f64_unmasked(<16 x double> %va, <16 x double> %b, i32 zeroext %evl) {
769 ; CHECK-LABEL: vfadd_vv_v16f64_unmasked:
771 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
772 ; CHECK-NEXT: vfadd.vv v8, v8, v16
774 %v = call <16 x double> @llvm.vp.fadd.v16f64(<16 x double> %va, <16 x double> %b, <16 x i1> splat (i1 true), i32 %evl)
778 define <16 x double> @vfadd_vf_v16f64(<16 x double> %va, double %b, <16 x i1> %m, i32 zeroext %evl) {
779 ; CHECK-LABEL: vfadd_vf_v16f64:
781 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
782 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
784 %elt.head = insertelement <16 x double> poison, double %b, i32 0
785 %vb = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
786 %v = call <16 x double> @llvm.vp.fadd.v16f64(<16 x double> %va, <16 x double> %vb, <16 x i1> %m, i32 %evl)
790 define <16 x double> @vfadd_vf_v16f64_unmasked(<16 x double> %va, double %b, i32 zeroext %evl) {
791 ; CHECK-LABEL: vfadd_vf_v16f64_unmasked:
793 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
794 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
796 %elt.head = insertelement <16 x double> poison, double %b, i32 0
797 %vb = shufflevector <16 x double> %elt.head, <16 x double> poison, <16 x i32> zeroinitializer
798 %v = call <16 x double> @llvm.vp.fadd.v16f64(<16 x double> %va, <16 x double> %vb, <16 x i1> splat (i1 true), i32 %evl)