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,+zfhmin,+zvfhmin,+v -target-abi=ilp32d \
7 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
8 ; RUN: llc -mtriple=riscv64 -mattr=+d,+zfhmin,+zvfhmin,+v -target-abi=lp64d \
9 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,ZVFHMIN
11 declare <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half>, <vscale x 1 x half>, <vscale x 1 x i1>, i32)
13 define <vscale x 1 x half> @vfadd_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
14 ; ZVFH-LABEL: vfadd_vv_nxv1f16:
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_nxv1f16:
22 ; ZVFHMIN-NEXT: vsetvli a1, zero, 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: vsetvli a0, zero, e16, mf4, ta, ma
28 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
30 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %b, <vscale x 1 x i1> %m, i32 %evl)
31 ret <vscale x 1 x half> %v
34 define <vscale x 1 x half> @vfadd_vv_nxv1f16_unmasked(<vscale x 1 x half> %va, <vscale x 1 x half> %b, i32 zeroext %evl) {
35 ; ZVFH-LABEL: vfadd_vv_nxv1f16_unmasked:
37 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
38 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
41 ; ZVFHMIN-LABEL: vfadd_vv_nxv1f16_unmasked:
43 ; ZVFHMIN-NEXT: vsetvli a1, zero, 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: vsetvli a0, zero, e16, mf4, ta, ma
49 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
51 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
52 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
53 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %b, <vscale x 1 x i1> %m, i32 %evl)
54 ret <vscale x 1 x half> %v
57 define <vscale x 1 x half> @vfadd_vf_nxv1f16(<vscale x 1 x half> %va, half %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
58 ; ZVFH-LABEL: vfadd_vf_nxv1f16:
60 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
61 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
64 ; ZVFHMIN-LABEL: vfadd_vf_nxv1f16:
66 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
67 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
68 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
69 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
70 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
71 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
72 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
73 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
74 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v8, v0.t
75 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
76 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
78 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
79 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
80 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
81 ret <vscale x 1 x half> %v
84 define <vscale x 1 x half> @vfadd_vf_nxv1f16_commute(<vscale x 1 x half> %va, half %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
85 ; ZVFH-LABEL: vfadd_vf_nxv1f16_commute:
87 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
88 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
91 ; ZVFHMIN-LABEL: vfadd_vf_nxv1f16_commute:
93 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
94 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
95 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
96 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
97 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
98 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
99 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
100 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
101 ; ZVFHMIN-NEXT: vfadd.vv v9, v8, v9, v0.t
102 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
103 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
105 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
106 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
107 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %vb, <vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
108 ret <vscale x 1 x half> %v
111 define <vscale x 1 x half> @vfadd_vf_nxv1f16_unmasked(<vscale x 1 x half> %va, half %b, i32 zeroext %evl) {
112 ; ZVFH-LABEL: vfadd_vf_nxv1f16_unmasked:
114 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
115 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
118 ; ZVFHMIN-LABEL: vfadd_vf_nxv1f16_unmasked:
120 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
121 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
122 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
123 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
124 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
125 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
126 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
127 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
128 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v8
129 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
130 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
132 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
133 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
134 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
135 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
136 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
137 ret <vscale x 1 x half> %v
140 define <vscale x 1 x half> @vfadd_vf_nxv1f16_unmasked_commute(<vscale x 1 x half> %va, half %b, i32 zeroext %evl) {
141 ; ZVFH-LABEL: vfadd_vf_nxv1f16_unmasked_commute:
143 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
144 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
147 ; ZVFHMIN-LABEL: vfadd_vf_nxv1f16_unmasked_commute:
149 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
150 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, mf2, ta, ma
151 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
152 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
153 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
154 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
155 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
156 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
157 ; ZVFHMIN-NEXT: vfadd.vv v9, v8, v9
158 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
159 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
161 %elt.head = insertelement <vscale x 1 x half> poison, half %b, i32 0
162 %vb = shufflevector <vscale x 1 x half> %elt.head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
163 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
164 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
165 %v = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> %vb, <vscale x 1 x half> %va, <vscale x 1 x i1> %m, i32 %evl)
166 ret <vscale x 1 x half> %v
169 declare <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>, <vscale x 2 x i1>, i32)
171 define <vscale x 2 x half> @vfadd_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
172 ; ZVFH-LABEL: vfadd_vv_nxv2f16:
174 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
175 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
178 ; ZVFHMIN-LABEL: vfadd_vv_nxv2f16:
180 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
181 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
182 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
183 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
184 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10, v0.t
185 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
186 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
188 %v = call <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %b, <vscale x 2 x i1> %m, i32 %evl)
189 ret <vscale x 2 x half> %v
192 define <vscale x 2 x half> @vfadd_vv_nxv2f16_unmasked(<vscale x 2 x half> %va, <vscale x 2 x half> %b, i32 zeroext %evl) {
193 ; ZVFH-LABEL: vfadd_vv_nxv2f16_unmasked:
195 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
196 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
199 ; ZVFHMIN-LABEL: vfadd_vv_nxv2f16_unmasked:
201 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
202 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
203 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
204 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
205 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v10
206 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
207 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
209 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
210 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
211 %v = call <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %b, <vscale x 2 x i1> %m, i32 %evl)
212 ret <vscale x 2 x half> %v
215 define <vscale x 2 x half> @vfadd_vf_nxv2f16(<vscale x 2 x half> %va, half %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
216 ; ZVFH-LABEL: vfadd_vf_nxv2f16:
218 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
219 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
222 ; ZVFHMIN-LABEL: vfadd_vf_nxv2f16:
224 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
225 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
226 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
227 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
228 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
229 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
230 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
231 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
232 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v8, v0.t
233 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
234 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
236 %elt.head = insertelement <vscale x 2 x half> poison, half %b, i32 0
237 %vb = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
238 %v = call <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
239 ret <vscale x 2 x half> %v
242 define <vscale x 2 x half> @vfadd_vf_nxv2f16_unmasked(<vscale x 2 x half> %va, half %b, i32 zeroext %evl) {
243 ; ZVFH-LABEL: vfadd_vf_nxv2f16_unmasked:
245 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
246 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
249 ; ZVFHMIN-LABEL: vfadd_vf_nxv2f16_unmasked:
251 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
252 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m1, ta, ma
253 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
254 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
255 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
256 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
257 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
258 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
259 ; ZVFHMIN-NEXT: vfadd.vv v9, v9, v8
260 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
261 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
263 %elt.head = insertelement <vscale x 2 x half> poison, half %b, i32 0
264 %vb = shufflevector <vscale x 2 x half> %elt.head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
265 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
266 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
267 %v = call <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
268 ret <vscale x 2 x half> %v
271 declare <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>, <vscale x 4 x i1>, i32)
273 define <vscale x 4 x half> @vfadd_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
274 ; ZVFH-LABEL: vfadd_vv_nxv4f16:
276 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
277 ; ZVFH-NEXT: vfadd.vv v8, v8, v9, v0.t
280 ; ZVFHMIN-LABEL: vfadd_vv_nxv4f16:
282 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
283 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
284 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
285 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
286 ; ZVFHMIN-NEXT: vfadd.vv v10, v12, v10, v0.t
287 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
288 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
290 %v = call <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %b, <vscale x 4 x i1> %m, i32 %evl)
291 ret <vscale x 4 x half> %v
294 define <vscale x 4 x half> @vfadd_vv_nxv4f16_unmasked(<vscale x 4 x half> %va, <vscale x 4 x half> %b, i32 zeroext %evl) {
295 ; ZVFH-LABEL: vfadd_vv_nxv4f16_unmasked:
297 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
298 ; ZVFH-NEXT: vfadd.vv v8, v8, v9
301 ; ZVFHMIN-LABEL: vfadd_vv_nxv4f16_unmasked:
303 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
304 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
305 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
306 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
307 ; ZVFHMIN-NEXT: vfadd.vv v10, v12, v10
308 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
309 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
311 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
312 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
313 %v = call <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %b, <vscale x 4 x i1> %m, i32 %evl)
314 ret <vscale x 4 x half> %v
317 define <vscale x 4 x half> @vfadd_vf_nxv4f16(<vscale x 4 x half> %va, half %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
318 ; ZVFH-LABEL: vfadd_vf_nxv4f16:
320 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
321 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
324 ; ZVFHMIN-LABEL: vfadd_vf_nxv4f16:
326 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
327 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
328 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
329 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
330 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v10
331 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
332 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
333 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
334 ; ZVFHMIN-NEXT: vfadd.vv v10, v10, v12, v0.t
335 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
336 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
338 %elt.head = insertelement <vscale x 4 x half> poison, half %b, i32 0
339 %vb = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
340 %v = call <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
341 ret <vscale x 4 x half> %v
344 define <vscale x 4 x half> @vfadd_vf_nxv4f16_unmasked(<vscale x 4 x half> %va, half %b, i32 zeroext %evl) {
345 ; ZVFH-LABEL: vfadd_vf_nxv4f16_unmasked:
347 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
348 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
351 ; ZVFHMIN-LABEL: vfadd_vf_nxv4f16_unmasked:
353 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
354 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m2, ta, ma
355 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
356 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
357 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v10
358 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
359 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
360 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
361 ; ZVFHMIN-NEXT: vfadd.vv v10, v10, v12
362 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
363 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
365 %elt.head = insertelement <vscale x 4 x half> poison, half %b, i32 0
366 %vb = shufflevector <vscale x 4 x half> %elt.head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
367 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
368 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
369 %v = call <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
370 ret <vscale x 4 x half> %v
373 declare <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x i1>, i32)
375 define <vscale x 8 x half> @vfadd_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
376 ; ZVFH-LABEL: vfadd_vv_nxv8f16:
378 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
379 ; ZVFH-NEXT: vfadd.vv v8, v8, v10, v0.t
382 ; ZVFHMIN-LABEL: vfadd_vv_nxv8f16:
384 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
385 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
386 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
387 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
388 ; ZVFHMIN-NEXT: vfadd.vv v12, v16, v12, v0.t
389 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
390 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
392 %v = call <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %b, <vscale x 8 x i1> %m, i32 %evl)
393 ret <vscale x 8 x half> %v
396 define <vscale x 8 x half> @vfadd_vv_nxv8f16_unmasked(<vscale x 8 x half> %va, <vscale x 8 x half> %b, i32 zeroext %evl) {
397 ; ZVFH-LABEL: vfadd_vv_nxv8f16_unmasked:
399 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
400 ; ZVFH-NEXT: vfadd.vv v8, v8, v10
403 ; ZVFHMIN-LABEL: vfadd_vv_nxv8f16_unmasked:
405 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
406 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
407 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
408 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
409 ; ZVFHMIN-NEXT: vfadd.vv v12, v16, v12
410 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
411 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
413 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
414 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
415 %v = call <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %b, <vscale x 8 x i1> %m, i32 %evl)
416 ret <vscale x 8 x half> %v
419 define <vscale x 8 x half> @vfadd_vf_nxv8f16(<vscale x 8 x half> %va, half %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
420 ; ZVFH-LABEL: vfadd_vf_nxv8f16:
422 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
423 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
426 ; ZVFHMIN-LABEL: vfadd_vf_nxv8f16:
428 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
429 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
430 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
431 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
432 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v12
433 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
434 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
435 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
436 ; ZVFHMIN-NEXT: vfadd.vv v12, v12, v16, v0.t
437 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
438 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
440 %elt.head = insertelement <vscale x 8 x half> poison, half %b, i32 0
441 %vb = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
442 %v = call <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
443 ret <vscale x 8 x half> %v
446 define <vscale x 8 x half> @vfadd_vf_nxv8f16_unmasked(<vscale x 8 x half> %va, half %b, i32 zeroext %evl) {
447 ; ZVFH-LABEL: vfadd_vf_nxv8f16_unmasked:
449 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
450 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
453 ; ZVFHMIN-LABEL: vfadd_vf_nxv8f16_unmasked:
455 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
456 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m4, ta, ma
457 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
458 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
459 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v12
460 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
461 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
462 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
463 ; ZVFHMIN-NEXT: vfadd.vv v12, v12, v16
464 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
465 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
467 %elt.head = insertelement <vscale x 8 x half> poison, half %b, i32 0
468 %vb = shufflevector <vscale x 8 x half> %elt.head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
469 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
470 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
471 %v = call <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
472 ret <vscale x 8 x half> %v
475 declare <vscale x 16 x half> @llvm.vp.fadd.nxv16f16(<vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x i1>, i32)
477 define <vscale x 16 x half> @vfadd_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
478 ; ZVFH-LABEL: vfadd_vv_nxv16f16:
480 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
481 ; ZVFH-NEXT: vfadd.vv v8, v8, v12, v0.t
484 ; ZVFHMIN-LABEL: vfadd_vv_nxv16f16:
486 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
487 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
488 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
489 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
490 ; ZVFHMIN-NEXT: vfadd.vv v16, v24, v16, v0.t
491 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
492 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
494 %v = call <vscale x 16 x half> @llvm.vp.fadd.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %b, <vscale x 16 x i1> %m, i32 %evl)
495 ret <vscale x 16 x half> %v
498 define <vscale x 16 x half> @vfadd_vv_nxv16f16_unmasked(<vscale x 16 x half> %va, <vscale x 16 x half> %b, i32 zeroext %evl) {
499 ; ZVFH-LABEL: vfadd_vv_nxv16f16_unmasked:
501 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
502 ; ZVFH-NEXT: vfadd.vv v8, v8, v12
505 ; ZVFHMIN-LABEL: vfadd_vv_nxv16f16_unmasked:
507 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
508 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
509 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
510 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
511 ; ZVFHMIN-NEXT: vfadd.vv v16, v24, v16
512 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
513 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
515 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
516 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
517 %v = call <vscale x 16 x half> @llvm.vp.fadd.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %b, <vscale x 16 x i1> %m, i32 %evl)
518 ret <vscale x 16 x half> %v
521 define <vscale x 16 x half> @vfadd_vf_nxv16f16(<vscale x 16 x half> %va, half %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
522 ; ZVFH-LABEL: vfadd_vf_nxv16f16:
524 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
525 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
528 ; ZVFHMIN-LABEL: vfadd_vf_nxv16f16:
530 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
531 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
532 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
533 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
534 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
535 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
536 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
537 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
538 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24, v0.t
539 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
540 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
542 %elt.head = insertelement <vscale x 16 x half> poison, half %b, i32 0
543 %vb = shufflevector <vscale x 16 x half> %elt.head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
544 %v = call <vscale x 16 x half> @llvm.vp.fadd.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 %evl)
545 ret <vscale x 16 x half> %v
548 define <vscale x 16 x half> @vfadd_vf_nxv16f16_unmasked(<vscale x 16 x half> %va, half %b, i32 zeroext %evl) {
549 ; ZVFH-LABEL: vfadd_vf_nxv16f16_unmasked:
551 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
552 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
555 ; ZVFHMIN-LABEL: vfadd_vf_nxv16f16_unmasked:
557 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
558 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
559 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
560 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
561 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
562 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
563 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
564 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
565 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24
566 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
567 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
569 %elt.head = insertelement <vscale x 16 x half> poison, half %b, i32 0
570 %vb = shufflevector <vscale x 16 x half> %elt.head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
571 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
572 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
573 %v = call <vscale x 16 x half> @llvm.vp.fadd.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 %evl)
574 ret <vscale x 16 x half> %v
577 declare <vscale x 32 x half> @llvm.vp.fadd.nxv32f16(<vscale x 32 x half>, <vscale x 32 x half>, <vscale x 32 x i1>, i32)
579 define <vscale x 32 x half> @vfadd_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
580 ; ZVFH-LABEL: vfadd_vv_nxv32f16:
582 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
583 ; ZVFH-NEXT: vfadd.vv v8, v8, v16, v0.t
586 ; ZVFHMIN-LABEL: vfadd_vv_nxv32f16:
588 ; ZVFHMIN-NEXT: addi sp, sp, -16
589 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
590 ; ZVFHMIN-NEXT: csrr a1, vlenb
591 ; ZVFHMIN-NEXT: slli a1, a1, 3
592 ; ZVFHMIN-NEXT: sub sp, sp, a1
593 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
594 ; ZVFHMIN-NEXT: vmv1r.v v1, v0
595 ; ZVFHMIN-NEXT: csrr a2, vlenb
596 ; ZVFHMIN-NEXT: slli a1, a2, 1
597 ; ZVFHMIN-NEXT: sub a3, a0, a1
598 ; ZVFHMIN-NEXT: sltu a4, a0, a3
599 ; ZVFHMIN-NEXT: addi a4, a4, -1
600 ; ZVFHMIN-NEXT: and a3, a4, a3
601 ; ZVFHMIN-NEXT: srli a2, a2, 2
602 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
603 ; ZVFHMIN-NEXT: vslidedown.vx v0, v0, a2
604 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
605 ; ZVFHMIN-NEXT: addi a2, sp, 16
606 ; ZVFHMIN-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
607 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
608 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
609 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
610 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24, v0.t
611 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
612 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
613 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB22_2
614 ; ZVFHMIN-NEXT: # %bb.1:
615 ; ZVFHMIN-NEXT: mv a0, a1
616 ; ZVFHMIN-NEXT: .LBB22_2:
617 ; ZVFHMIN-NEXT: addi a1, sp, 16
618 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
619 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
620 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
621 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
622 ; ZVFHMIN-NEXT: vmv1r.v v0, v1
623 ; ZVFHMIN-NEXT: vfadd.vv v16, v24, v16, v0.t
624 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
625 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
626 ; ZVFHMIN-NEXT: csrr a0, vlenb
627 ; ZVFHMIN-NEXT: slli a0, a0, 3
628 ; ZVFHMIN-NEXT: add sp, sp, a0
629 ; ZVFHMIN-NEXT: addi sp, sp, 16
631 %v = call <vscale x 32 x half> @llvm.vp.fadd.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %b, <vscale x 32 x i1> %m, i32 %evl)
632 ret <vscale x 32 x half> %v
635 define <vscale x 32 x half> @vfadd_vv_nxv32f16_unmasked(<vscale x 32 x half> %va, <vscale x 32 x half> %b, i32 zeroext %evl) {
636 ; ZVFH-LABEL: vfadd_vv_nxv32f16_unmasked:
638 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
639 ; ZVFH-NEXT: vfadd.vv v8, v8, v16
642 ; ZVFHMIN-LABEL: vfadd_vv_nxv32f16_unmasked:
644 ; ZVFHMIN-NEXT: addi sp, sp, -16
645 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
646 ; ZVFHMIN-NEXT: csrr a1, vlenb
647 ; ZVFHMIN-NEXT: slli a1, a1, 3
648 ; ZVFHMIN-NEXT: sub sp, sp, a1
649 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
650 ; ZVFHMIN-NEXT: vsetvli a1, zero, e8, m4, ta, ma
651 ; ZVFHMIN-NEXT: vmset.m v24
652 ; ZVFHMIN-NEXT: csrr a2, vlenb
653 ; ZVFHMIN-NEXT: slli a1, a2, 1
654 ; ZVFHMIN-NEXT: sub a3, a0, a1
655 ; ZVFHMIN-NEXT: sltu a4, a0, a3
656 ; ZVFHMIN-NEXT: addi a4, a4, -1
657 ; ZVFHMIN-NEXT: and a3, a4, a3
658 ; ZVFHMIN-NEXT: srli a2, a2, 2
659 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
660 ; ZVFHMIN-NEXT: vslidedown.vx v0, v24, a2
661 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
662 ; ZVFHMIN-NEXT: addi a2, sp, 16
663 ; ZVFHMIN-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
664 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
665 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
666 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
667 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24, v0.t
668 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
669 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
670 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB23_2
671 ; ZVFHMIN-NEXT: # %bb.1:
672 ; ZVFHMIN-NEXT: mv a0, a1
673 ; ZVFHMIN-NEXT: .LBB23_2:
674 ; ZVFHMIN-NEXT: addi a1, sp, 16
675 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
676 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
677 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
678 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
679 ; ZVFHMIN-NEXT: vfadd.vv v16, v24, v16
680 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
681 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
682 ; ZVFHMIN-NEXT: csrr a0, vlenb
683 ; ZVFHMIN-NEXT: slli a0, a0, 3
684 ; ZVFHMIN-NEXT: add sp, sp, a0
685 ; ZVFHMIN-NEXT: addi sp, sp, 16
687 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
688 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
689 %v = call <vscale x 32 x half> @llvm.vp.fadd.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %b, <vscale x 32 x i1> %m, i32 %evl)
690 ret <vscale x 32 x half> %v
693 define <vscale x 32 x half> @vfadd_vf_nxv32f16(<vscale x 32 x half> %va, half %b, <vscale x 32 x i1> %m, i32 zeroext %evl) {
694 ; ZVFH-LABEL: vfadd_vf_nxv32f16:
696 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
697 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0, v0.t
700 ; ZVFHMIN-LABEL: vfadd_vf_nxv32f16:
702 ; ZVFHMIN-NEXT: vmv1r.v v1, v0
703 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
704 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
705 ; ZVFHMIN-NEXT: vfmv.v.f v24, fa5
706 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
707 ; ZVFHMIN-NEXT: vfncvt.f.f.w v4, v24
708 ; ZVFHMIN-NEXT: csrr a2, vlenb
709 ; ZVFHMIN-NEXT: slli a1, a2, 1
710 ; ZVFHMIN-NEXT: sub a3, a0, a1
711 ; ZVFHMIN-NEXT: sltu a4, a0, a3
712 ; ZVFHMIN-NEXT: addi a4, a4, -1
713 ; ZVFHMIN-NEXT: and a3, a4, a3
714 ; ZVFHMIN-NEXT: srli a2, a2, 2
715 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
716 ; ZVFHMIN-NEXT: vslidedown.vx v0, v0, a2
717 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
718 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
719 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v4
720 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
721 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24, v0.t
722 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
723 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
724 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB24_2
725 ; ZVFHMIN-NEXT: # %bb.1:
726 ; ZVFHMIN-NEXT: mv a0, a1
727 ; ZVFHMIN-NEXT: .LBB24_2:
728 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
729 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
730 ; ZVFHMIN-NEXT: vmv1r.v v0, v1
731 ; ZVFHMIN-NEXT: vfadd.vv v16, v16, v24, v0.t
732 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
733 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
735 %elt.head = insertelement <vscale x 32 x half> poison, half %b, i32 0
736 %vb = shufflevector <vscale x 32 x half> %elt.head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
737 %v = call <vscale x 32 x half> @llvm.vp.fadd.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 %evl)
738 ret <vscale x 32 x half> %v
741 define <vscale x 32 x half> @vfadd_vf_nxv32f16_unmasked(<vscale x 32 x half> %va, half %b, i32 zeroext %evl) {
742 ; ZVFH-LABEL: vfadd_vf_nxv32f16_unmasked:
744 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
745 ; ZVFH-NEXT: vfadd.vf v8, v8, fa0
748 ; ZVFHMIN-LABEL: vfadd_vf_nxv32f16_unmasked:
750 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
751 ; ZVFHMIN-NEXT: vsetvli a1, zero, e32, m8, ta, ma
752 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
753 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
754 ; ZVFHMIN-NEXT: vfncvt.f.f.w v4, v16
755 ; ZVFHMIN-NEXT: vsetvli a1, zero, e8, m4, ta, ma
756 ; ZVFHMIN-NEXT: vmset.m v16
757 ; ZVFHMIN-NEXT: csrr a2, vlenb
758 ; ZVFHMIN-NEXT: slli a1, a2, 1
759 ; ZVFHMIN-NEXT: sub a3, a0, a1
760 ; ZVFHMIN-NEXT: sltu a4, a0, a3
761 ; ZVFHMIN-NEXT: addi a4, a4, -1
762 ; ZVFHMIN-NEXT: and a3, a4, a3
763 ; ZVFHMIN-NEXT: srli a2, a2, 2
764 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
765 ; ZVFHMIN-NEXT: vslidedown.vx v0, v16, a2
766 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
767 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
768 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v4
769 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
770 ; ZVFHMIN-NEXT: vfadd.vv v24, v24, v16, v0.t
771 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
772 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v24
773 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB25_2
774 ; ZVFHMIN-NEXT: # %bb.1:
775 ; ZVFHMIN-NEXT: mv a0, a1
776 ; ZVFHMIN-NEXT: .LBB25_2:
777 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
778 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
779 ; ZVFHMIN-NEXT: vfadd.vv v16, v24, v16
780 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
781 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
783 %elt.head = insertelement <vscale x 32 x half> poison, half %b, i32 0
784 %vb = shufflevector <vscale x 32 x half> %elt.head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
785 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
786 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
787 %v = call <vscale x 32 x half> @llvm.vp.fadd.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 %evl)
788 ret <vscale x 32 x half> %v
791 declare <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x i1>, i32)
793 define <vscale x 1 x float> @vfadd_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
794 ; CHECK-LABEL: vfadd_vv_nxv1f32:
796 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
797 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
799 %v = call <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %b, <vscale x 1 x i1> %m, i32 %evl)
800 ret <vscale x 1 x float> %v
803 define <vscale x 1 x float> @vfadd_vv_nxv1f32_unmasked(<vscale x 1 x float> %va, <vscale x 1 x float> %b, i32 zeroext %evl) {
804 ; CHECK-LABEL: vfadd_vv_nxv1f32_unmasked:
806 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
807 ; CHECK-NEXT: vfadd.vv v8, v8, v9
809 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
810 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
811 %v = call <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %b, <vscale x 1 x i1> %m, i32 %evl)
812 ret <vscale x 1 x float> %v
815 define <vscale x 1 x float> @vfadd_vf_nxv1f32(<vscale x 1 x float> %va, float %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
816 ; CHECK-LABEL: vfadd_vf_nxv1f32:
818 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
819 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
821 %elt.head = insertelement <vscale x 1 x float> poison, float %b, i32 0
822 %vb = shufflevector <vscale x 1 x float> %elt.head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
823 %v = call <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 %evl)
824 ret <vscale x 1 x float> %v
827 define <vscale x 1 x float> @vfadd_vf_nxv1f32_unmasked(<vscale x 1 x float> %va, float %b, i32 zeroext %evl) {
828 ; CHECK-LABEL: vfadd_vf_nxv1f32_unmasked:
830 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
831 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
833 %elt.head = insertelement <vscale x 1 x float> poison, float %b, i32 0
834 %vb = shufflevector <vscale x 1 x float> %elt.head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
835 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
836 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
837 %v = call <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 %evl)
838 ret <vscale x 1 x float> %v
841 declare <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x i1>, i32)
843 define <vscale x 2 x float> @vfadd_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
844 ; CHECK-LABEL: vfadd_vv_nxv2f32:
846 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
847 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
849 %v = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %b, <vscale x 2 x i1> %m, i32 %evl)
850 ret <vscale x 2 x float> %v
853 define <vscale x 2 x float> @vfadd_vv_nxv2f32_unmasked(<vscale x 2 x float> %va, <vscale x 2 x float> %b, i32 zeroext %evl) {
854 ; CHECK-LABEL: vfadd_vv_nxv2f32_unmasked:
856 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
857 ; CHECK-NEXT: vfadd.vv v8, v8, v9
859 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
860 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
861 %v = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %b, <vscale x 2 x i1> %m, i32 %evl)
862 ret <vscale x 2 x float> %v
865 define <vscale x 2 x float> @vfadd_vf_nxv2f32(<vscale x 2 x float> %va, float %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
866 ; CHECK-LABEL: vfadd_vf_nxv2f32:
868 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
869 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
871 %elt.head = insertelement <vscale x 2 x float> poison, float %b, i32 0
872 %vb = shufflevector <vscale x 2 x float> %elt.head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
873 %v = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 %evl)
874 ret <vscale x 2 x float> %v
877 define <vscale x 2 x float> @vfadd_vf_nxv2f32_unmasked(<vscale x 2 x float> %va, float %b, i32 zeroext %evl) {
878 ; CHECK-LABEL: vfadd_vf_nxv2f32_unmasked:
880 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
881 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
883 %elt.head = insertelement <vscale x 2 x float> poison, float %b, i32 0
884 %vb = shufflevector <vscale x 2 x float> %elt.head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
885 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
886 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
887 %v = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 %evl)
888 ret <vscale x 2 x float> %v
891 declare <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x i1>, i32)
893 define <vscale x 4 x float> @vfadd_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
894 ; CHECK-LABEL: vfadd_vv_nxv4f32:
896 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
897 ; CHECK-NEXT: vfadd.vv v8, v8, v10, v0.t
899 %v = call <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %b, <vscale x 4 x i1> %m, i32 %evl)
900 ret <vscale x 4 x float> %v
903 define <vscale x 4 x float> @vfadd_vv_nxv4f32_unmasked(<vscale x 4 x float> %va, <vscale x 4 x float> %b, i32 zeroext %evl) {
904 ; CHECK-LABEL: vfadd_vv_nxv4f32_unmasked:
906 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
907 ; CHECK-NEXT: vfadd.vv v8, v8, v10
909 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
910 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
911 %v = call <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %b, <vscale x 4 x i1> %m, i32 %evl)
912 ret <vscale x 4 x float> %v
915 define <vscale x 4 x float> @vfadd_vf_nxv4f32(<vscale x 4 x float> %va, float %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
916 ; CHECK-LABEL: vfadd_vf_nxv4f32:
918 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
919 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
921 %elt.head = insertelement <vscale x 4 x float> poison, float %b, i32 0
922 %vb = shufflevector <vscale x 4 x float> %elt.head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
923 %v = call <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 %evl)
924 ret <vscale x 4 x float> %v
927 define <vscale x 4 x float> @vfadd_vf_nxv4f32_unmasked(<vscale x 4 x float> %va, float %b, i32 zeroext %evl) {
928 ; CHECK-LABEL: vfadd_vf_nxv4f32_unmasked:
930 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
931 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
933 %elt.head = insertelement <vscale x 4 x float> poison, float %b, i32 0
934 %vb = shufflevector <vscale x 4 x float> %elt.head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
935 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
936 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
937 %v = call <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 %evl)
938 ret <vscale x 4 x float> %v
941 declare <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x i1>, i32)
943 define <vscale x 8 x float> @vfadd_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
944 ; CHECK-LABEL: vfadd_vv_nxv8f32:
946 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
947 ; CHECK-NEXT: vfadd.vv v8, v8, v12, v0.t
949 %v = call <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %b, <vscale x 8 x i1> %m, i32 %evl)
950 ret <vscale x 8 x float> %v
953 define <vscale x 8 x float> @vfadd_vv_nxv8f32_unmasked(<vscale x 8 x float> %va, <vscale x 8 x float> %b, i32 zeroext %evl) {
954 ; CHECK-LABEL: vfadd_vv_nxv8f32_unmasked:
956 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
957 ; CHECK-NEXT: vfadd.vv v8, v8, v12
959 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
960 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
961 %v = call <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %b, <vscale x 8 x i1> %m, i32 %evl)
962 ret <vscale x 8 x float> %v
965 define <vscale x 8 x float> @vfadd_vf_nxv8f32(<vscale x 8 x float> %va, float %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
966 ; CHECK-LABEL: vfadd_vf_nxv8f32:
968 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
969 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
971 %elt.head = insertelement <vscale x 8 x float> poison, float %b, i32 0
972 %vb = shufflevector <vscale x 8 x float> %elt.head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
973 %v = call <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 %evl)
974 ret <vscale x 8 x float> %v
977 define <vscale x 8 x float> @vfadd_vf_nxv8f32_unmasked(<vscale x 8 x float> %va, float %b, i32 zeroext %evl) {
978 ; CHECK-LABEL: vfadd_vf_nxv8f32_unmasked:
980 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
981 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
983 %elt.head = insertelement <vscale x 8 x float> poison, float %b, i32 0
984 %vb = shufflevector <vscale x 8 x float> %elt.head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
985 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
986 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
987 %v = call <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 %evl)
988 ret <vscale x 8 x float> %v
991 declare <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x i1>, i32)
993 define <vscale x 16 x float> @vfadd_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
994 ; CHECK-LABEL: vfadd_vv_nxv16f32:
996 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
997 ; CHECK-NEXT: vfadd.vv v8, v8, v16, v0.t
999 %v = call <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %b, <vscale x 16 x i1> %m, i32 %evl)
1000 ret <vscale x 16 x float> %v
1003 define <vscale x 16 x float> @vfadd_vv_nxv16f32_unmasked(<vscale x 16 x float> %va, <vscale x 16 x float> %b, i32 zeroext %evl) {
1004 ; CHECK-LABEL: vfadd_vv_nxv16f32_unmasked:
1006 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1007 ; CHECK-NEXT: vfadd.vv v8, v8, v16
1009 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1010 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1011 %v = call <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %b, <vscale x 16 x i1> %m, i32 %evl)
1012 ret <vscale x 16 x float> %v
1015 define <vscale x 16 x float> @vfadd_vf_nxv16f32(<vscale x 16 x float> %va, float %b, <vscale x 16 x i1> %m, i32 zeroext %evl) {
1016 ; CHECK-LABEL: vfadd_vf_nxv16f32:
1018 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1019 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
1021 %elt.head = insertelement <vscale x 16 x float> poison, float %b, i32 0
1022 %vb = shufflevector <vscale x 16 x float> %elt.head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
1023 %v = call <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 %evl)
1024 ret <vscale x 16 x float> %v
1027 define <vscale x 16 x float> @vfadd_vf_nxv16f32_unmasked(<vscale x 16 x float> %va, float %b, i32 zeroext %evl) {
1028 ; CHECK-LABEL: vfadd_vf_nxv16f32_unmasked:
1030 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
1031 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
1033 %elt.head = insertelement <vscale x 16 x float> poison, float %b, i32 0
1034 %vb = shufflevector <vscale x 16 x float> %elt.head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
1035 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
1036 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
1037 %v = call <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 %evl)
1038 ret <vscale x 16 x float> %v
1041 declare <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x i1>, i32)
1043 define <vscale x 1 x double> @vfadd_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1044 ; CHECK-LABEL: vfadd_vv_nxv1f64:
1046 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1047 ; CHECK-NEXT: vfadd.vv v8, v8, v9, v0.t
1049 %v = call <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %b, <vscale x 1 x i1> %m, i32 %evl)
1050 ret <vscale x 1 x double> %v
1053 define <vscale x 1 x double> @vfadd_vv_nxv1f64_unmasked(<vscale x 1 x double> %va, <vscale x 1 x double> %b, i32 zeroext %evl) {
1054 ; CHECK-LABEL: vfadd_vv_nxv1f64_unmasked:
1056 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1057 ; CHECK-NEXT: vfadd.vv v8, v8, v9
1059 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1060 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1061 %v = call <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %b, <vscale x 1 x i1> %m, i32 %evl)
1062 ret <vscale x 1 x double> %v
1065 define <vscale x 1 x double> @vfadd_vf_nxv1f64(<vscale x 1 x double> %va, double %b, <vscale x 1 x i1> %m, i32 zeroext %evl) {
1066 ; CHECK-LABEL: vfadd_vf_nxv1f64:
1068 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1069 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
1071 %elt.head = insertelement <vscale x 1 x double> poison, double %b, i32 0
1072 %vb = shufflevector <vscale x 1 x double> %elt.head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
1073 %v = call <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 %evl)
1074 ret <vscale x 1 x double> %v
1077 define <vscale x 1 x double> @vfadd_vf_nxv1f64_unmasked(<vscale x 1 x double> %va, double %b, i32 zeroext %evl) {
1078 ; CHECK-LABEL: vfadd_vf_nxv1f64_unmasked:
1080 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
1081 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
1083 %elt.head = insertelement <vscale x 1 x double> poison, double %b, i32 0
1084 %vb = shufflevector <vscale x 1 x double> %elt.head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
1085 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
1086 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
1087 %v = call <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 %evl)
1088 ret <vscale x 1 x double> %v
1091 declare <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x i1>, i32)
1093 define <vscale x 2 x double> @vfadd_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1094 ; CHECK-LABEL: vfadd_vv_nxv2f64:
1096 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1097 ; CHECK-NEXT: vfadd.vv v8, v8, v10, v0.t
1099 %v = call <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %b, <vscale x 2 x i1> %m, i32 %evl)
1100 ret <vscale x 2 x double> %v
1103 define <vscale x 2 x double> @vfadd_vv_nxv2f64_unmasked(<vscale x 2 x double> %va, <vscale x 2 x double> %b, i32 zeroext %evl) {
1104 ; CHECK-LABEL: vfadd_vv_nxv2f64_unmasked:
1106 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1107 ; CHECK-NEXT: vfadd.vv v8, v8, v10
1109 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1110 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1111 %v = call <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %b, <vscale x 2 x i1> %m, i32 %evl)
1112 ret <vscale x 2 x double> %v
1115 define <vscale x 2 x double> @vfadd_vf_nxv2f64(<vscale x 2 x double> %va, double %b, <vscale x 2 x i1> %m, i32 zeroext %evl) {
1116 ; CHECK-LABEL: vfadd_vf_nxv2f64:
1118 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1119 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
1121 %elt.head = insertelement <vscale x 2 x double> poison, double %b, i32 0
1122 %vb = shufflevector <vscale x 2 x double> %elt.head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
1123 %v = call <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 %evl)
1124 ret <vscale x 2 x double> %v
1127 define <vscale x 2 x double> @vfadd_vf_nxv2f64_unmasked(<vscale x 2 x double> %va, double %b, i32 zeroext %evl) {
1128 ; CHECK-LABEL: vfadd_vf_nxv2f64_unmasked:
1130 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
1131 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
1133 %elt.head = insertelement <vscale x 2 x double> poison, double %b, i32 0
1134 %vb = shufflevector <vscale x 2 x double> %elt.head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
1135 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
1136 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
1137 %v = call <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 %evl)
1138 ret <vscale x 2 x double> %v
1141 declare <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double>, <vscale x 4 x double>, <vscale x 4 x i1>, i32)
1143 define <vscale x 4 x double> @vfadd_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1144 ; CHECK-LABEL: vfadd_vv_nxv4f64:
1146 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1147 ; CHECK-NEXT: vfadd.vv v8, v8, v12, v0.t
1149 %v = call <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %b, <vscale x 4 x i1> %m, i32 %evl)
1150 ret <vscale x 4 x double> %v
1153 define <vscale x 4 x double> @vfadd_vv_nxv4f64_unmasked(<vscale x 4 x double> %va, <vscale x 4 x double> %b, i32 zeroext %evl) {
1154 ; CHECK-LABEL: vfadd_vv_nxv4f64_unmasked:
1156 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1157 ; CHECK-NEXT: vfadd.vv v8, v8, v12
1159 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1160 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1161 %v = call <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %b, <vscale x 4 x i1> %m, i32 %evl)
1162 ret <vscale x 4 x double> %v
1165 define <vscale x 4 x double> @vfadd_vf_nxv4f64(<vscale x 4 x double> %va, double %b, <vscale x 4 x i1> %m, i32 zeroext %evl) {
1166 ; CHECK-LABEL: vfadd_vf_nxv4f64:
1168 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1169 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
1171 %elt.head = insertelement <vscale x 4 x double> poison, double %b, i32 0
1172 %vb = shufflevector <vscale x 4 x double> %elt.head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
1173 %v = call <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 %evl)
1174 ret <vscale x 4 x double> %v
1177 define <vscale x 4 x double> @vfadd_vf_nxv4f64_unmasked(<vscale x 4 x double> %va, double %b, i32 zeroext %evl) {
1178 ; CHECK-LABEL: vfadd_vf_nxv4f64_unmasked:
1180 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
1181 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
1183 %elt.head = insertelement <vscale x 4 x double> poison, double %b, i32 0
1184 %vb = shufflevector <vscale x 4 x double> %elt.head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
1185 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
1186 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
1187 %v = call <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 %evl)
1188 ret <vscale x 4 x double> %v
1191 declare <vscale x 7 x double> @llvm.vp.fadd.nxv7f64(<vscale x 7 x double>, <vscale x 7 x double>, <vscale x 7 x i1>, i32)
1193 define <vscale x 7 x double> @vfadd_vv_nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x double> %b, <vscale x 7 x i1> %m, i32 zeroext %evl) {
1194 ; CHECK-LABEL: vfadd_vv_nxv7f64:
1196 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1197 ; CHECK-NEXT: vfadd.vv v8, v8, v16, v0.t
1199 %v = call <vscale x 7 x double> @llvm.vp.fadd.nxv7f64(<vscale x 7 x double> %va, <vscale x 7 x double> %b, <vscale x 7 x i1> %m, i32 %evl)
1200 ret <vscale x 7 x double> %v
1203 declare <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double>, <vscale x 8 x double>, <vscale x 8 x i1>, i32)
1205 define <vscale x 8 x double> @vfadd_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1206 ; CHECK-LABEL: vfadd_vv_nxv8f64:
1208 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1209 ; CHECK-NEXT: vfadd.vv v8, v8, v16, v0.t
1211 %v = call <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %b, <vscale x 8 x i1> %m, i32 %evl)
1212 ret <vscale x 8 x double> %v
1215 define <vscale x 8 x double> @vfadd_vv_nxv8f64_unmasked(<vscale x 8 x double> %va, <vscale x 8 x double> %b, i32 zeroext %evl) {
1216 ; CHECK-LABEL: vfadd_vv_nxv8f64_unmasked:
1218 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1219 ; CHECK-NEXT: vfadd.vv v8, v8, v16
1221 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1222 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1223 %v = call <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %b, <vscale x 8 x i1> %m, i32 %evl)
1224 ret <vscale x 8 x double> %v
1227 define <vscale x 8 x double> @vfadd_vf_nxv8f64(<vscale x 8 x double> %va, double %b, <vscale x 8 x i1> %m, i32 zeroext %evl) {
1228 ; CHECK-LABEL: vfadd_vf_nxv8f64:
1230 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1231 ; CHECK-NEXT: vfadd.vf v8, v8, fa0, v0.t
1233 %elt.head = insertelement <vscale x 8 x double> poison, double %b, i32 0
1234 %vb = shufflevector <vscale x 8 x double> %elt.head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
1235 %v = call <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 %evl)
1236 ret <vscale x 8 x double> %v
1239 define <vscale x 8 x double> @vfadd_vf_nxv8f64_unmasked(<vscale x 8 x double> %va, double %b, i32 zeroext %evl) {
1240 ; CHECK-LABEL: vfadd_vf_nxv8f64_unmasked:
1242 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
1243 ; CHECK-NEXT: vfadd.vf v8, v8, fa0
1245 %elt.head = insertelement <vscale x 8 x double> poison, double %b, i32 0
1246 %vb = shufflevector <vscale x 8 x double> %elt.head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
1247 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
1248 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
1249 %v = call <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 %evl)
1250 ret <vscale x 8 x double> %v