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.experimental.constrained.fsub.nxv1f16(<vscale x 1 x half>, <vscale x 1 x half>, metadata, metadata)
12 define <vscale x 1 x half> @vfsub_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb) strictfp {
13 ; ZVFH-LABEL: vfsub_vv_nxv1f16:
14 ; ZVFH: # %bb.0: # %entry
15 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
16 ; ZVFH-NEXT: vfsub.vv v8, v8, v9
19 ; ZVFHMIN-LABEL: vfsub_vv_nxv1f16:
20 ; ZVFHMIN: # %bb.0: # %entry
21 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
22 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
23 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
24 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
25 ; ZVFHMIN-NEXT: vfsub.vv v9, v9, v10
26 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
27 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
30 %vc = call <vscale x 1 x half> @llvm.experimental.constrained.fsub.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
31 ret <vscale x 1 x half> %vc
34 define <vscale x 1 x half> @vfsub_vf_nxv1f16(<vscale x 1 x half> %va, half %b) strictfp {
35 ; ZVFH-LABEL: vfsub_vf_nxv1f16:
37 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
38 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
41 ; ZVFHMIN-LABEL: vfsub_vf_nxv1f16:
43 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
44 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
45 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
46 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
47 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v9
48 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
49 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v8, v10
50 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
51 ; ZVFHMIN-NEXT: vfsub.vv v9, v9, v8
52 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
53 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
55 %head = insertelement <vscale x 1 x half> poison, half %b, i32 0
56 %splat = shufflevector <vscale x 1 x half> %head, <vscale x 1 x half> poison, <vscale x 1 x i32> zeroinitializer
57 %vc = call <vscale x 1 x half> @llvm.experimental.constrained.fsub.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
58 ret <vscale x 1 x half> %vc
61 declare <vscale x 2 x half> @llvm.experimental.constrained.fsub.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>, metadata, metadata)
62 define <vscale x 2 x half> @vfsub_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb) strictfp {
63 ; ZVFH-LABEL: vfsub_vv_nxv2f16:
64 ; ZVFH: # %bb.0: # %entry
65 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
66 ; ZVFH-NEXT: vfsub.vv v8, v8, v9
69 ; ZVFHMIN-LABEL: vfsub_vv_nxv2f16:
70 ; ZVFHMIN: # %bb.0: # %entry
71 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
72 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
73 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
74 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
75 ; ZVFHMIN-NEXT: vfsub.vv v9, v9, v10
76 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
77 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
80 %vc = call <vscale x 2 x half> @llvm.experimental.constrained.fsub.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
81 ret <vscale x 2 x half> %vc
84 define <vscale x 2 x half> @vfsub_vf_nxv2f16(<vscale x 2 x half> %va, half %b) strictfp {
85 ; ZVFH-LABEL: vfsub_vf_nxv2f16:
87 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
88 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
91 ; ZVFHMIN-LABEL: vfsub_vf_nxv2f16:
93 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
94 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m1, ta, ma
95 ; ZVFHMIN-NEXT: vfmv.v.f v9, fa5
96 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, 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, zero, e32, m1, ta, ma
101 ; ZVFHMIN-NEXT: vfsub.vv v9, v9, v8
102 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
103 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
105 %head = insertelement <vscale x 2 x half> poison, half %b, i32 0
106 %splat = shufflevector <vscale x 2 x half> %head, <vscale x 2 x half> poison, <vscale x 2 x i32> zeroinitializer
107 %vc = call <vscale x 2 x half> @llvm.experimental.constrained.fsub.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
108 ret <vscale x 2 x half> %vc
111 declare <vscale x 4 x half> @llvm.experimental.constrained.fsub.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>, metadata, metadata)
112 define <vscale x 4 x half> @vfsub_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb) strictfp {
113 ; ZVFH-LABEL: vfsub_vv_nxv4f16:
114 ; ZVFH: # %bb.0: # %entry
115 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
116 ; ZVFH-NEXT: vfsub.vv v8, v8, v9
119 ; ZVFHMIN-LABEL: vfsub_vv_nxv4f16:
120 ; ZVFHMIN: # %bb.0: # %entry
121 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
122 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
123 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
124 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
125 ; ZVFHMIN-NEXT: vfsub.vv v10, v12, v10
126 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
127 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
130 %vc = call <vscale x 4 x half> @llvm.experimental.constrained.fsub.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
131 ret <vscale x 4 x half> %vc
134 define <vscale x 4 x half> @vfsub_vf_nxv4f16(<vscale x 4 x half> %va, half %b) strictfp {
135 ; ZVFH-LABEL: vfsub_vf_nxv4f16:
137 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
138 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
141 ; ZVFHMIN-LABEL: vfsub_vf_nxv4f16:
143 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
144 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m2, ta, ma
145 ; ZVFHMIN-NEXT: vfmv.v.f v10, fa5
146 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
147 ; ZVFHMIN-NEXT: vfncvt.f.f.w v9, v10
148 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v8
149 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v9
150 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
151 ; ZVFHMIN-NEXT: vfsub.vv v10, v10, v12
152 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
153 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
155 %head = insertelement <vscale x 4 x half> poison, half %b, i32 0
156 %splat = shufflevector <vscale x 4 x half> %head, <vscale x 4 x half> poison, <vscale x 4 x i32> zeroinitializer
157 %vc = call <vscale x 4 x half> @llvm.experimental.constrained.fsub.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
158 ret <vscale x 4 x half> %vc
161 declare <vscale x 8 x half> @llvm.experimental.constrained.fsub.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, metadata, metadata)
162 define <vscale x 8 x half> @vfsub_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb) strictfp {
163 ; ZVFH-LABEL: vfsub_vv_nxv8f16:
164 ; ZVFH: # %bb.0: # %entry
165 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
166 ; ZVFH-NEXT: vfsub.vv v8, v8, v10
169 ; ZVFHMIN-LABEL: vfsub_vv_nxv8f16:
170 ; ZVFHMIN: # %bb.0: # %entry
171 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
172 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
173 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
174 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
175 ; ZVFHMIN-NEXT: vfsub.vv v12, v16, v12
176 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
177 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
180 %vc = call <vscale x 8 x half> @llvm.experimental.constrained.fsub.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
181 ret <vscale x 8 x half> %vc
184 define <vscale x 8 x half> @vfsub_vf_nxv8f16(<vscale x 8 x half> %va, half %b) strictfp {
185 ; ZVFH-LABEL: vfsub_vf_nxv8f16:
187 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
188 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
191 ; ZVFHMIN-LABEL: vfsub_vf_nxv8f16:
193 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
194 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m4, ta, ma
195 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
196 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
197 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v12
198 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
199 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
200 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
201 ; ZVFHMIN-NEXT: vfsub.vv v12, v12, v16
202 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
203 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
205 %head = insertelement <vscale x 8 x half> poison, half %b, i32 0
206 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
207 %vc = call <vscale x 8 x half> @llvm.experimental.constrained.fsub.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
208 ret <vscale x 8 x half> %vc
211 define <vscale x 8 x half> @vfsub_fv_nxv8f16(<vscale x 8 x half> %va, half %b) strictfp {
212 ; ZVFH-LABEL: vfsub_fv_nxv8f16:
214 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
215 ; ZVFH-NEXT: vfrsub.vf v8, v8, fa0
218 ; ZVFHMIN-LABEL: vfsub_fv_nxv8f16:
220 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
221 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m4, ta, ma
222 ; ZVFHMIN-NEXT: vfmv.v.f v12, fa5
223 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
224 ; ZVFHMIN-NEXT: vfncvt.f.f.w v10, v12
225 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
226 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v10
227 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
228 ; ZVFHMIN-NEXT: vfsub.vv v12, v16, v12
229 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
230 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
232 %head = insertelement <vscale x 8 x half> poison, half %b, i32 0
233 %splat = shufflevector <vscale x 8 x half> %head, <vscale x 8 x half> poison, <vscale x 8 x i32> zeroinitializer
234 %vc = call <vscale x 8 x half> @llvm.experimental.constrained.fsub.nxv8f16(<vscale x 8 x half> %splat, <vscale x 8 x half> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
235 ret <vscale x 8 x half> %vc
238 declare <vscale x 16 x half> @llvm.experimental.constrained.fsub.nxv16f16(<vscale x 16 x half>, <vscale x 16 x half>, metadata, metadata)
239 define <vscale x 16 x half> @vfsub_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb) strictfp {
240 ; ZVFH-LABEL: vfsub_vv_nxv16f16:
241 ; ZVFH: # %bb.0: # %entry
242 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
243 ; ZVFH-NEXT: vfsub.vv v8, v8, v12
246 ; ZVFHMIN-LABEL: vfsub_vv_nxv16f16:
247 ; ZVFHMIN: # %bb.0: # %entry
248 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
249 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
250 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
251 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
252 ; ZVFHMIN-NEXT: vfsub.vv v16, v24, v16
253 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
254 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
257 %vc = call <vscale x 16 x half> @llvm.experimental.constrained.fsub.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
258 ret <vscale x 16 x half> %vc
261 define <vscale x 16 x half> @vfsub_vf_nxv16f16(<vscale x 16 x half> %va, half %b) strictfp {
262 ; ZVFH-LABEL: vfsub_vf_nxv16f16:
264 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
265 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
268 ; ZVFHMIN-LABEL: vfsub_vf_nxv16f16:
270 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
271 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
272 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
273 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
274 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
275 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
276 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
277 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
278 ; ZVFHMIN-NEXT: vfsub.vv v16, v16, v24
279 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
280 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
282 %head = insertelement <vscale x 16 x half> poison, half %b, i32 0
283 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
284 %vc = call <vscale x 16 x half> @llvm.experimental.constrained.fsub.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
285 ret <vscale x 16 x half> %vc
288 declare <vscale x 32 x half> @llvm.experimental.constrained.fsub.nxv32f16(<vscale x 32 x half>, <vscale x 32 x half>, metadata, metadata)
289 define <vscale x 32 x half> @vfsub_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb) strictfp {
290 ; ZVFH-LABEL: vfsub_vv_nxv32f16:
291 ; ZVFH: # %bb.0: # %entry
292 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
293 ; ZVFH-NEXT: vfsub.vv v8, v8, v16
296 ; ZVFHMIN-LABEL: vfsub_vv_nxv32f16:
297 ; ZVFHMIN: # %bb.0: # %entry
298 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
299 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
300 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
301 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
302 ; ZVFHMIN-NEXT: vfsub.vv v24, v0, v24
303 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
304 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
305 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
306 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
307 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
308 ; ZVFHMIN-NEXT: vfsub.vv v16, v16, v24
309 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
310 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
313 %vc = call <vscale x 32 x half> @llvm.experimental.constrained.fsub.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
314 ret <vscale x 32 x half> %vc
317 define <vscale x 32 x half> @vfsub_vf_nxv32f16(<vscale x 32 x half> %va, half %b) strictfp {
318 ; ZVFH-LABEL: vfsub_vf_nxv32f16:
320 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
321 ; ZVFH-NEXT: vfsub.vf v8, v8, fa0
324 ; ZVFHMIN-LABEL: vfsub_vf_nxv32f16:
326 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
327 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
328 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
329 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
330 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
331 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
332 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v24
333 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
334 ; ZVFHMIN-NEXT: vfsub.vv v16, v16, v0
335 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
336 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
337 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
338 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
339 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
340 ; ZVFHMIN-NEXT: vfsub.vv v16, v24, v16
341 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
342 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
344 %head = insertelement <vscale x 32 x half> poison, half %b, i32 0
345 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
346 %vc = call <vscale x 32 x half> @llvm.experimental.constrained.fsub.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
347 ret <vscale x 32 x half> %vc
350 declare <vscale x 1 x float> @llvm.experimental.constrained.fsub.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>, metadata, metadata)
351 define <vscale x 1 x float> @vfsub_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb) strictfp {
352 ; CHECK-LABEL: vfsub_vv_nxv1f32:
353 ; CHECK: # %bb.0: # %entry
354 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
355 ; CHECK-NEXT: vfsub.vv v8, v8, v9
358 %vc = call <vscale x 1 x float> @llvm.experimental.constrained.fsub.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
359 ret <vscale x 1 x float> %vc
362 define <vscale x 1 x float> @vfsub_vf_nxv1f32(<vscale x 1 x float> %va, float %b) strictfp {
363 ; CHECK-LABEL: vfsub_vf_nxv1f32:
365 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
366 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
368 %head = insertelement <vscale x 1 x float> poison, float %b, i32 0
369 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
370 %vc = call <vscale x 1 x float> @llvm.experimental.constrained.fsub.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
371 ret <vscale x 1 x float> %vc
374 declare <vscale x 2 x float> @llvm.experimental.constrained.fsub.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, metadata, metadata)
375 define <vscale x 2 x float> @vfsub_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb) strictfp {
376 ; CHECK-LABEL: vfsub_vv_nxv2f32:
377 ; CHECK: # %bb.0: # %entry
378 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
379 ; CHECK-NEXT: vfsub.vv v8, v8, v9
382 %vc = call <vscale x 2 x float> @llvm.experimental.constrained.fsub.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
383 ret <vscale x 2 x float> %vc
386 define <vscale x 2 x float> @vfsub_vf_nxv2f32(<vscale x 2 x float> %va, float %b) strictfp {
387 ; CHECK-LABEL: vfsub_vf_nxv2f32:
389 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
390 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
392 %head = insertelement <vscale x 2 x float> poison, float %b, i32 0
393 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
394 %vc = call <vscale x 2 x float> @llvm.experimental.constrained.fsub.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
395 ret <vscale x 2 x float> %vc
398 declare <vscale x 4 x float> @llvm.experimental.constrained.fsub.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, metadata, metadata)
399 define <vscale x 4 x float> @vfsub_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb) strictfp {
400 ; CHECK-LABEL: vfsub_vv_nxv4f32:
401 ; CHECK: # %bb.0: # %entry
402 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
403 ; CHECK-NEXT: vfsub.vv v8, v8, v10
406 %vc = call <vscale x 4 x float> @llvm.experimental.constrained.fsub.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
407 ret <vscale x 4 x float> %vc
410 define <vscale x 4 x float> @vfsub_vf_nxv4f32(<vscale x 4 x float> %va, float %b) strictfp {
411 ; CHECK-LABEL: vfsub_vf_nxv4f32:
413 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
414 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
416 %head = insertelement <vscale x 4 x float> poison, float %b, i32 0
417 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
418 %vc = call <vscale x 4 x float> @llvm.experimental.constrained.fsub.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
419 ret <vscale x 4 x float> %vc
422 declare <vscale x 8 x float> @llvm.experimental.constrained.fsub.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>, metadata, metadata)
423 define <vscale x 8 x float> @vfsub_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb) strictfp {
424 ; CHECK-LABEL: vfsub_vv_nxv8f32:
425 ; CHECK: # %bb.0: # %entry
426 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
427 ; CHECK-NEXT: vfsub.vv v8, v8, v12
430 %vc = call <vscale x 8 x float> @llvm.experimental.constrained.fsub.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
431 ret <vscale x 8 x float> %vc
434 define <vscale x 8 x float> @vfsub_vf_nxv8f32(<vscale x 8 x float> %va, float %b) strictfp {
435 ; CHECK-LABEL: vfsub_vf_nxv8f32:
437 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
438 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
440 %head = insertelement <vscale x 8 x float> poison, float %b, i32 0
441 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
442 %vc = call <vscale x 8 x float> @llvm.experimental.constrained.fsub.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
443 ret <vscale x 8 x float> %vc
446 define <vscale x 8 x float> @vfsub_fv_nxv8f32(<vscale x 8 x float> %va, float %b) strictfp {
447 ; CHECK-LABEL: vfsub_fv_nxv8f32:
449 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
450 ; CHECK-NEXT: vfrsub.vf v8, v8, fa0
452 %head = insertelement <vscale x 8 x float> poison, float %b, i32 0
453 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
454 %vc = call <vscale x 8 x float> @llvm.experimental.constrained.fsub.nxv8f32(<vscale x 8 x float> %splat, <vscale x 8 x float> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
455 ret <vscale x 8 x float> %vc
458 declare <vscale x 16 x float> @llvm.experimental.constrained.fsub.nxv16f32(<vscale x 16 x float>, <vscale x 16 x float>, metadata, metadata)
459 define <vscale x 16 x float> @vfsub_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb) strictfp {
460 ; CHECK-LABEL: vfsub_vv_nxv16f32:
461 ; CHECK: # %bb.0: # %entry
462 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
463 ; CHECK-NEXT: vfsub.vv v8, v8, v16
466 %vc = call <vscale x 16 x float> @llvm.experimental.constrained.fsub.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
467 ret <vscale x 16 x float> %vc
470 define <vscale x 16 x float> @vfsub_vf_nxv16f32(<vscale x 16 x float> %va, float %b) strictfp {
471 ; CHECK-LABEL: vfsub_vf_nxv16f32:
473 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
474 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
476 %head = insertelement <vscale x 16 x float> poison, float %b, i32 0
477 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
478 %vc = call <vscale x 16 x float> @llvm.experimental.constrained.fsub.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
479 ret <vscale x 16 x float> %vc
482 declare <vscale x 1 x double> @llvm.experimental.constrained.fsub.nxv1f64(<vscale x 1 x double>, <vscale x 1 x double>, metadata, metadata)
483 define <vscale x 1 x double> @vfsub_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb) strictfp {
484 ; CHECK-LABEL: vfsub_vv_nxv1f64:
485 ; CHECK: # %bb.0: # %entry
486 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
487 ; CHECK-NEXT: vfsub.vv v8, v8, v9
490 %vc = call <vscale x 1 x double> @llvm.experimental.constrained.fsub.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
491 ret <vscale x 1 x double> %vc
494 define <vscale x 1 x double> @vfsub_vf_nxv1f64(<vscale x 1 x double> %va, double %b) strictfp {
495 ; CHECK-LABEL: vfsub_vf_nxv1f64:
497 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
498 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
500 %head = insertelement <vscale x 1 x double> poison, double %b, i32 0
501 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
502 %vc = call <vscale x 1 x double> @llvm.experimental.constrained.fsub.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
503 ret <vscale x 1 x double> %vc
506 declare <vscale x 2 x double> @llvm.experimental.constrained.fsub.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, metadata, metadata)
507 define <vscale x 2 x double> @vfsub_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb) strictfp {
508 ; CHECK-LABEL: vfsub_vv_nxv2f64:
509 ; CHECK: # %bb.0: # %entry
510 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
511 ; CHECK-NEXT: vfsub.vv v8, v8, v10
514 %vc = call <vscale x 2 x double> @llvm.experimental.constrained.fsub.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
515 ret <vscale x 2 x double> %vc
518 define <vscale x 2 x double> @vfsub_vf_nxv2f64(<vscale x 2 x double> %va, double %b) strictfp {
519 ; CHECK-LABEL: vfsub_vf_nxv2f64:
521 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
522 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
524 %head = insertelement <vscale x 2 x double> poison, double %b, i32 0
525 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
526 %vc = call <vscale x 2 x double> @llvm.experimental.constrained.fsub.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
527 ret <vscale x 2 x double> %vc
530 declare <vscale x 4 x double> @llvm.experimental.constrained.fsub.nxv4f64(<vscale x 4 x double>, <vscale x 4 x double>, metadata, metadata)
531 define <vscale x 4 x double> @vfsub_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb) strictfp {
532 ; CHECK-LABEL: vfsub_vv_nxv4f64:
533 ; CHECK: # %bb.0: # %entry
534 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
535 ; CHECK-NEXT: vfsub.vv v8, v8, v12
538 %vc = call <vscale x 4 x double> @llvm.experimental.constrained.fsub.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
539 ret <vscale x 4 x double> %vc
542 define <vscale x 4 x double> @vfsub_vf_nxv4f64(<vscale x 4 x double> %va, double %b) strictfp {
543 ; CHECK-LABEL: vfsub_vf_nxv4f64:
545 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
546 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
548 %head = insertelement <vscale x 4 x double> poison, double %b, i32 0
549 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
550 %vc = call <vscale x 4 x double> @llvm.experimental.constrained.fsub.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
551 ret <vscale x 4 x double> %vc
554 declare <vscale x 8 x double> @llvm.experimental.constrained.fsub.nxv8f64(<vscale x 8 x double>, <vscale x 8 x double>, metadata, metadata)
555 define <vscale x 8 x double> @vfsub_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb) strictfp {
556 ; CHECK-LABEL: vfsub_vv_nxv8f64:
557 ; CHECK: # %bb.0: # %entry
558 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
559 ; CHECK-NEXT: vfsub.vv v8, v8, v16
562 %vc = call <vscale x 8 x double> @llvm.experimental.constrained.fsub.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, metadata !"round.dynamic", metadata !"fpexcept.ignore")
563 ret <vscale x 8 x double> %vc
566 define <vscale x 8 x double> @vfsub_vf_nxv8f64(<vscale x 8 x double> %va, double %b) strictfp {
567 ; CHECK-LABEL: vfsub_vf_nxv8f64:
569 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
570 ; CHECK-NEXT: vfsub.vf v8, v8, fa0
572 %head = insertelement <vscale x 8 x double> poison, double %b, i32 0
573 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
574 %vc = call <vscale x 8 x double> @llvm.experimental.constrained.fsub.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %splat, metadata !"round.dynamic", metadata !"fpexcept.ignore")
575 ret <vscale x 8 x double> %vc
578 define <vscale x 8 x double> @vfsub_fv_nxv8f64(<vscale x 8 x double> %va, double %b) strictfp {
579 ; CHECK-LABEL: vfsub_fv_nxv8f64:
581 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
582 ; CHECK-NEXT: vfrsub.vf v8, v8, fa0
584 %head = insertelement <vscale x 8 x double> poison, double %b, i32 0
585 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
586 %vc = call <vscale x 8 x double> @llvm.experimental.constrained.fsub.nxv8f64(<vscale x 8 x double> %splat, <vscale x 8 x double> %va, metadata !"round.dynamic", metadata !"fpexcept.ignore")
587 ret <vscale x 8 x double> %vc