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.minnum.nxv1f16(<vscale x 1 x half>, <vscale x 1 x half>, <vscale x 1 x i1>, i32)
13 define <vscale x 1 x half> @vfmin_vv_nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
14 ; ZVFH-LABEL: vfmin_vv_nxv1f16:
16 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
17 ; ZVFH-NEXT: vfmin.vv v8, v8, v9, v0.t
20 ; ZVFHMIN-LABEL: vfmin_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: vfmin.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.minnum.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
31 ret <vscale x 1 x half> %v
34 define <vscale x 1 x half> @vfmin_vv_nxv1f16_unmasked(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, i32 zeroext %evl) {
35 ; ZVFH-LABEL: vfmin_vv_nxv1f16_unmasked:
37 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf4, ta, ma
38 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
41 ; ZVFHMIN-LABEL: vfmin_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: vfmin.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.minnum.nxv1f16(<vscale x 1 x half> %va, <vscale x 1 x half> %vb, <vscale x 1 x i1> %m, i32 %evl)
54 ret <vscale x 1 x half> %v
57 declare <vscale x 2 x half> @llvm.vp.minnum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>, <vscale x 2 x i1>, i32)
59 define <vscale x 2 x half> @vfmin_vv_nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
60 ; ZVFH-LABEL: vfmin_vv_nxv2f16:
62 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
63 ; ZVFH-NEXT: vfmin.vv v8, v8, v9, v0.t
66 ; ZVFHMIN-LABEL: vfmin_vv_nxv2f16:
68 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
69 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
70 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
71 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
72 ; ZVFHMIN-NEXT: vfmin.vv v9, v9, v10, v0.t
73 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
74 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
76 %v = call <vscale x 2 x half> @llvm.vp.minnum.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
77 ret <vscale x 2 x half> %v
80 define <vscale x 2 x half> @vfmin_vv_nxv2f16_unmasked(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, i32 zeroext %evl) {
81 ; ZVFH-LABEL: vfmin_vv_nxv2f16_unmasked:
83 ; ZVFH-NEXT: vsetvli zero, a0, e16, mf2, ta, ma
84 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
87 ; ZVFHMIN-LABEL: vfmin_vv_nxv2f16_unmasked:
89 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, mf2, ta, ma
90 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
91 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
92 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m1, ta, ma
93 ; ZVFHMIN-NEXT: vfmin.vv v9, v9, v10
94 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
95 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
97 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
98 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
99 %v = call <vscale x 2 x half> @llvm.vp.minnum.nxv2f16(<vscale x 2 x half> %va, <vscale x 2 x half> %vb, <vscale x 2 x i1> %m, i32 %evl)
100 ret <vscale x 2 x half> %v
103 declare <vscale x 4 x half> @llvm.vp.minnum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>, <vscale x 4 x i1>, i32)
105 define <vscale x 4 x half> @vfmin_vv_nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
106 ; ZVFH-LABEL: vfmin_vv_nxv4f16:
108 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
109 ; ZVFH-NEXT: vfmin.vv v8, v8, v9, v0.t
112 ; ZVFHMIN-LABEL: vfmin_vv_nxv4f16:
114 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
115 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
116 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
117 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
118 ; ZVFHMIN-NEXT: vfmin.vv v10, v12, v10, v0.t
119 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
120 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
122 %v = call <vscale x 4 x half> @llvm.vp.minnum.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
123 ret <vscale x 4 x half> %v
126 define <vscale x 4 x half> @vfmin_vv_nxv4f16_unmasked(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, i32 zeroext %evl) {
127 ; ZVFH-LABEL: vfmin_vv_nxv4f16_unmasked:
129 ; ZVFH-NEXT: vsetvli zero, a0, e16, m1, ta, ma
130 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
133 ; ZVFHMIN-LABEL: vfmin_vv_nxv4f16_unmasked:
135 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m1, ta, ma
136 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
137 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
138 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m2, ta, ma
139 ; ZVFHMIN-NEXT: vfmin.vv v10, v12, v10
140 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
141 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
143 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
144 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
145 %v = call <vscale x 4 x half> @llvm.vp.minnum.nxv4f16(<vscale x 4 x half> %va, <vscale x 4 x half> %vb, <vscale x 4 x i1> %m, i32 %evl)
146 ret <vscale x 4 x half> %v
149 declare <vscale x 8 x half> @llvm.vp.minnum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>, <vscale x 8 x i1>, i32)
151 define <vscale x 8 x half> @vfmin_vv_nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
152 ; ZVFH-LABEL: vfmin_vv_nxv8f16:
154 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
155 ; ZVFH-NEXT: vfmin.vv v8, v8, v10, v0.t
158 ; ZVFHMIN-LABEL: vfmin_vv_nxv8f16:
160 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
161 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
162 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
163 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
164 ; ZVFHMIN-NEXT: vfmin.vv v12, v16, v12, v0.t
165 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
166 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
168 %v = call <vscale x 8 x half> @llvm.vp.minnum.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
169 ret <vscale x 8 x half> %v
172 define <vscale x 8 x half> @vfmin_vv_nxv8f16_unmasked(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, i32 zeroext %evl) {
173 ; ZVFH-LABEL: vfmin_vv_nxv8f16_unmasked:
175 ; ZVFH-NEXT: vsetvli zero, a0, e16, m2, ta, ma
176 ; ZVFH-NEXT: vfmin.vv v8, v8, v10
179 ; ZVFHMIN-LABEL: vfmin_vv_nxv8f16_unmasked:
181 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m2, ta, ma
182 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
183 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
184 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m4, ta, ma
185 ; ZVFHMIN-NEXT: vfmin.vv v12, v16, v12
186 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
187 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
189 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
190 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
191 %v = call <vscale x 8 x half> @llvm.vp.minnum.nxv8f16(<vscale x 8 x half> %va, <vscale x 8 x half> %vb, <vscale x 8 x i1> %m, i32 %evl)
192 ret <vscale x 8 x half> %v
195 declare <vscale x 16 x half> @llvm.vp.minnum.nxv16f16(<vscale x 16 x half>, <vscale x 16 x half>, <vscale x 16 x i1>, i32)
197 define <vscale x 16 x half> @vfmin_vv_nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
198 ; ZVFH-LABEL: vfmin_vv_nxv16f16:
200 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
201 ; ZVFH-NEXT: vfmin.vv v8, v8, v12, v0.t
204 ; ZVFHMIN-LABEL: vfmin_vv_nxv16f16:
206 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
207 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
208 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
209 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
210 ; ZVFHMIN-NEXT: vfmin.vv v16, v24, v16, v0.t
211 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
212 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
214 %v = call <vscale x 16 x half> @llvm.vp.minnum.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 %evl)
215 ret <vscale x 16 x half> %v
218 define <vscale x 16 x half> @vfmin_vv_nxv16f16_unmasked(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, i32 zeroext %evl) {
219 ; ZVFH-LABEL: vfmin_vv_nxv16f16_unmasked:
221 ; ZVFH-NEXT: vsetvli zero, a0, e16, m4, ta, ma
222 ; ZVFH-NEXT: vfmin.vv v8, v8, v12
225 ; ZVFHMIN-LABEL: vfmin_vv_nxv16f16_unmasked:
227 ; ZVFHMIN-NEXT: vsetvli a1, zero, e16, m4, ta, ma
228 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
229 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
230 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
231 ; ZVFHMIN-NEXT: vfmin.vv v16, v24, v16
232 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
233 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
235 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
236 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
237 %v = call <vscale x 16 x half> @llvm.vp.minnum.nxv16f16(<vscale x 16 x half> %va, <vscale x 16 x half> %vb, <vscale x 16 x i1> %m, i32 %evl)
238 ret <vscale x 16 x half> %v
241 declare <vscale x 32 x half> @llvm.vp.minnum.nxv32f16(<vscale x 32 x half>, <vscale x 32 x half>, <vscale x 32 x i1>, i32)
243 define <vscale x 32 x half> @vfmin_vv_nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 zeroext %evl) {
244 ; ZVFH-LABEL: vfmin_vv_nxv32f16:
246 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
247 ; ZVFH-NEXT: vfmin.vv v8, v8, v16, v0.t
250 ; ZVFHMIN-LABEL: vfmin_vv_nxv32f16:
252 ; ZVFHMIN-NEXT: addi sp, sp, -16
253 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
254 ; ZVFHMIN-NEXT: csrr a1, vlenb
255 ; ZVFHMIN-NEXT: slli a1, a1, 3
256 ; ZVFHMIN-NEXT: sub sp, sp, a1
257 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
258 ; ZVFHMIN-NEXT: vmv1r.v v1, v0
259 ; ZVFHMIN-NEXT: csrr a2, vlenb
260 ; ZVFHMIN-NEXT: slli a1, a2, 1
261 ; ZVFHMIN-NEXT: sub a3, a0, a1
262 ; ZVFHMIN-NEXT: sltu a4, a0, a3
263 ; ZVFHMIN-NEXT: addi a4, a4, -1
264 ; ZVFHMIN-NEXT: and a3, a4, a3
265 ; ZVFHMIN-NEXT: srli a2, a2, 2
266 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
267 ; ZVFHMIN-NEXT: vslidedown.vx v0, v0, a2
268 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
269 ; ZVFHMIN-NEXT: addi a2, sp, 16
270 ; ZVFHMIN-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
271 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
272 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
273 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
274 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v24, v0.t
275 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
276 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
277 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB10_2
278 ; ZVFHMIN-NEXT: # %bb.1:
279 ; ZVFHMIN-NEXT: mv a0, a1
280 ; ZVFHMIN-NEXT: .LBB10_2:
281 ; ZVFHMIN-NEXT: addi a1, sp, 16
282 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
283 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
284 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
285 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
286 ; ZVFHMIN-NEXT: vmv1r.v v0, v1
287 ; ZVFHMIN-NEXT: vfmin.vv v16, v24, v16, v0.t
288 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
289 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
290 ; ZVFHMIN-NEXT: csrr a0, vlenb
291 ; ZVFHMIN-NEXT: slli a0, a0, 3
292 ; ZVFHMIN-NEXT: add sp, sp, a0
293 ; ZVFHMIN-NEXT: addi sp, sp, 16
295 %v = call <vscale x 32 x half> @llvm.vp.minnum.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 %evl)
296 ret <vscale x 32 x half> %v
299 define <vscale x 32 x half> @vfmin_vv_nxv32f16_unmasked(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, i32 zeroext %evl) {
300 ; ZVFH-LABEL: vfmin_vv_nxv32f16_unmasked:
302 ; ZVFH-NEXT: vsetvli zero, a0, e16, m8, ta, ma
303 ; ZVFH-NEXT: vfmin.vv v8, v8, v16
306 ; ZVFHMIN-LABEL: vfmin_vv_nxv32f16_unmasked:
308 ; ZVFHMIN-NEXT: addi sp, sp, -16
309 ; ZVFHMIN-NEXT: .cfi_def_cfa_offset 16
310 ; ZVFHMIN-NEXT: csrr a1, vlenb
311 ; ZVFHMIN-NEXT: slli a1, a1, 3
312 ; ZVFHMIN-NEXT: sub sp, sp, a1
313 ; ZVFHMIN-NEXT: .cfi_escape 0x0f, 0x0d, 0x72, 0x00, 0x11, 0x10, 0x22, 0x11, 0x08, 0x92, 0xa2, 0x38, 0x00, 0x1e, 0x22 # sp + 16 + 8 * vlenb
314 ; ZVFHMIN-NEXT: vsetvli a1, zero, e8, m4, ta, ma
315 ; ZVFHMIN-NEXT: vmset.m v24
316 ; ZVFHMIN-NEXT: csrr a2, vlenb
317 ; ZVFHMIN-NEXT: slli a1, a2, 1
318 ; ZVFHMIN-NEXT: sub a3, a0, a1
319 ; ZVFHMIN-NEXT: sltu a4, a0, a3
320 ; ZVFHMIN-NEXT: addi a4, a4, -1
321 ; ZVFHMIN-NEXT: and a3, a4, a3
322 ; ZVFHMIN-NEXT: srli a2, a2, 2
323 ; ZVFHMIN-NEXT: vsetvli a4, zero, e8, mf2, ta, ma
324 ; ZVFHMIN-NEXT: vslidedown.vx v0, v24, a2
325 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
326 ; ZVFHMIN-NEXT: addi a2, sp, 16
327 ; ZVFHMIN-NEXT: vs8r.v v16, (a2) # Unknown-size Folded Spill
328 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
329 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
330 ; ZVFHMIN-NEXT: vsetvli zero, a3, e32, m8, ta, ma
331 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v24, v0.t
332 ; ZVFHMIN-NEXT: vsetvli a2, zero, e16, m4, ta, ma
333 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
334 ; ZVFHMIN-NEXT: bltu a0, a1, .LBB11_2
335 ; ZVFHMIN-NEXT: # %bb.1:
336 ; ZVFHMIN-NEXT: mv a0, a1
337 ; ZVFHMIN-NEXT: .LBB11_2:
338 ; ZVFHMIN-NEXT: addi a1, sp, 16
339 ; ZVFHMIN-NEXT: vl8r.v v24, (a1) # Unknown-size Folded Reload
340 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v24
341 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
342 ; ZVFHMIN-NEXT: vsetvli zero, a0, e32, m8, ta, ma
343 ; ZVFHMIN-NEXT: vfmin.vv v16, v24, v16
344 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
345 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
346 ; ZVFHMIN-NEXT: csrr a0, vlenb
347 ; ZVFHMIN-NEXT: slli a0, a0, 3
348 ; ZVFHMIN-NEXT: add sp, sp, a0
349 ; ZVFHMIN-NEXT: addi sp, sp, 16
351 %head = insertelement <vscale x 32 x i1> poison, i1 true, i32 0
352 %m = shufflevector <vscale x 32 x i1> %head, <vscale x 32 x i1> poison, <vscale x 32 x i32> zeroinitializer
353 %v = call <vscale x 32 x half> @llvm.vp.minnum.nxv32f16(<vscale x 32 x half> %va, <vscale x 32 x half> %vb, <vscale x 32 x i1> %m, i32 %evl)
354 ret <vscale x 32 x half> %v
357 declare <vscale x 1 x float> @llvm.vp.minnum.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>, <vscale x 1 x i1>, i32)
359 define <vscale x 1 x float> @vfmin_vv_nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
360 ; CHECK-LABEL: vfmin_vv_nxv1f32:
362 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
363 ; CHECK-NEXT: vfmin.vv v8, v8, v9, v0.t
365 %v = call <vscale x 1 x float> @llvm.vp.minnum.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 %evl)
366 ret <vscale x 1 x float> %v
369 define <vscale x 1 x float> @vfmin_vv_nxv1f32_unmasked(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, i32 zeroext %evl) {
370 ; CHECK-LABEL: vfmin_vv_nxv1f32_unmasked:
372 ; CHECK-NEXT: vsetvli zero, a0, e32, mf2, ta, ma
373 ; CHECK-NEXT: vfmin.vv v8, v8, v9
375 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
376 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
377 %v = call <vscale x 1 x float> @llvm.vp.minnum.nxv1f32(<vscale x 1 x float> %va, <vscale x 1 x float> %vb, <vscale x 1 x i1> %m, i32 %evl)
378 ret <vscale x 1 x float> %v
381 declare <vscale x 2 x float> @llvm.vp.minnum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>, <vscale x 2 x i1>, i32)
383 define <vscale x 2 x float> @vfmin_vv_nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
384 ; CHECK-LABEL: vfmin_vv_nxv2f32:
386 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
387 ; CHECK-NEXT: vfmin.vv v8, v8, v9, v0.t
389 %v = call <vscale x 2 x float> @llvm.vp.minnum.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 %evl)
390 ret <vscale x 2 x float> %v
393 define <vscale x 2 x float> @vfmin_vv_nxv2f32_unmasked(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, i32 zeroext %evl) {
394 ; CHECK-LABEL: vfmin_vv_nxv2f32_unmasked:
396 ; CHECK-NEXT: vsetvli zero, a0, e32, m1, ta, ma
397 ; CHECK-NEXT: vfmin.vv v8, v8, v9
399 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
400 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
401 %v = call <vscale x 2 x float> @llvm.vp.minnum.nxv2f32(<vscale x 2 x float> %va, <vscale x 2 x float> %vb, <vscale x 2 x i1> %m, i32 %evl)
402 ret <vscale x 2 x float> %v
405 declare <vscale x 4 x float> @llvm.vp.minnum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>, <vscale x 4 x i1>, i32)
407 define <vscale x 4 x float> @vfmin_vv_nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
408 ; CHECK-LABEL: vfmin_vv_nxv4f32:
410 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
411 ; CHECK-NEXT: vfmin.vv v8, v8, v10, v0.t
413 %v = call <vscale x 4 x float> @llvm.vp.minnum.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 %evl)
414 ret <vscale x 4 x float> %v
417 define <vscale x 4 x float> @vfmin_vv_nxv4f32_unmasked(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, i32 zeroext %evl) {
418 ; CHECK-LABEL: vfmin_vv_nxv4f32_unmasked:
420 ; CHECK-NEXT: vsetvli zero, a0, e32, m2, ta, ma
421 ; CHECK-NEXT: vfmin.vv v8, v8, v10
423 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
424 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
425 %v = call <vscale x 4 x float> @llvm.vp.minnum.nxv4f32(<vscale x 4 x float> %va, <vscale x 4 x float> %vb, <vscale x 4 x i1> %m, i32 %evl)
426 ret <vscale x 4 x float> %v
429 declare <vscale x 8 x float> @llvm.vp.minnum.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>, <vscale x 8 x i1>, i32)
431 define <vscale x 8 x float> @vfmin_vv_nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
432 ; CHECK-LABEL: vfmin_vv_nxv8f32:
434 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
435 ; CHECK-NEXT: vfmin.vv v8, v8, v12, v0.t
437 %v = call <vscale x 8 x float> @llvm.vp.minnum.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 %evl)
438 ret <vscale x 8 x float> %v
441 define <vscale x 8 x float> @vfmin_vv_nxv8f32_unmasked(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, i32 zeroext %evl) {
442 ; CHECK-LABEL: vfmin_vv_nxv8f32_unmasked:
444 ; CHECK-NEXT: vsetvli zero, a0, e32, m4, ta, ma
445 ; CHECK-NEXT: vfmin.vv v8, v8, v12
447 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
448 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
449 %v = call <vscale x 8 x float> @llvm.vp.minnum.nxv8f32(<vscale x 8 x float> %va, <vscale x 8 x float> %vb, <vscale x 8 x i1> %m, i32 %evl)
450 ret <vscale x 8 x float> %v
453 declare <vscale x 16 x float> @llvm.vp.minnum.nxv16f32(<vscale x 16 x float>, <vscale x 16 x float>, <vscale x 16 x i1>, i32)
455 define <vscale x 16 x float> @vfmin_vv_nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 zeroext %evl) {
456 ; CHECK-LABEL: vfmin_vv_nxv16f32:
458 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
459 ; CHECK-NEXT: vfmin.vv v8, v8, v16, v0.t
461 %v = call <vscale x 16 x float> @llvm.vp.minnum.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 %evl)
462 ret <vscale x 16 x float> %v
465 define <vscale x 16 x float> @vfmin_vv_nxv16f32_unmasked(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, i32 zeroext %evl) {
466 ; CHECK-LABEL: vfmin_vv_nxv16f32_unmasked:
468 ; CHECK-NEXT: vsetvli zero, a0, e32, m8, ta, ma
469 ; CHECK-NEXT: vfmin.vv v8, v8, v16
471 %head = insertelement <vscale x 16 x i1> poison, i1 true, i32 0
472 %m = shufflevector <vscale x 16 x i1> %head, <vscale x 16 x i1> poison, <vscale x 16 x i32> zeroinitializer
473 %v = call <vscale x 16 x float> @llvm.vp.minnum.nxv16f32(<vscale x 16 x float> %va, <vscale x 16 x float> %vb, <vscale x 16 x i1> %m, i32 %evl)
474 ret <vscale x 16 x float> %v
477 declare <vscale x 1 x double> @llvm.vp.minnum.nxv1f64(<vscale x 1 x double>, <vscale x 1 x double>, <vscale x 1 x i1>, i32)
479 define <vscale x 1 x double> @vfmin_vv_nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 zeroext %evl) {
480 ; CHECK-LABEL: vfmin_vv_nxv1f64:
482 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
483 ; CHECK-NEXT: vfmin.vv v8, v8, v9, v0.t
485 %v = call <vscale x 1 x double> @llvm.vp.minnum.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 %evl)
486 ret <vscale x 1 x double> %v
489 define <vscale x 1 x double> @vfmin_vv_nxv1f64_unmasked(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, i32 zeroext %evl) {
490 ; CHECK-LABEL: vfmin_vv_nxv1f64_unmasked:
492 ; CHECK-NEXT: vsetvli zero, a0, e64, m1, ta, ma
493 ; CHECK-NEXT: vfmin.vv v8, v8, v9
495 %head = insertelement <vscale x 1 x i1> poison, i1 true, i32 0
496 %m = shufflevector <vscale x 1 x i1> %head, <vscale x 1 x i1> poison, <vscale x 1 x i32> zeroinitializer
497 %v = call <vscale x 1 x double> @llvm.vp.minnum.nxv1f64(<vscale x 1 x double> %va, <vscale x 1 x double> %vb, <vscale x 1 x i1> %m, i32 %evl)
498 ret <vscale x 1 x double> %v
501 declare <vscale x 2 x double> @llvm.vp.minnum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>, <vscale x 2 x i1>, i32)
503 define <vscale x 2 x double> @vfmin_vv_nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 zeroext %evl) {
504 ; CHECK-LABEL: vfmin_vv_nxv2f64:
506 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
507 ; CHECK-NEXT: vfmin.vv v8, v8, v10, v0.t
509 %v = call <vscale x 2 x double> @llvm.vp.minnum.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 %evl)
510 ret <vscale x 2 x double> %v
513 define <vscale x 2 x double> @vfmin_vv_nxv2f64_unmasked(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, i32 zeroext %evl) {
514 ; CHECK-LABEL: vfmin_vv_nxv2f64_unmasked:
516 ; CHECK-NEXT: vsetvli zero, a0, e64, m2, ta, ma
517 ; CHECK-NEXT: vfmin.vv v8, v8, v10
519 %head = insertelement <vscale x 2 x i1> poison, i1 true, i32 0
520 %m = shufflevector <vscale x 2 x i1> %head, <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer
521 %v = call <vscale x 2 x double> @llvm.vp.minnum.nxv2f64(<vscale x 2 x double> %va, <vscale x 2 x double> %vb, <vscale x 2 x i1> %m, i32 %evl)
522 ret <vscale x 2 x double> %v
525 declare <vscale x 4 x double> @llvm.vp.minnum.nxv4f64(<vscale x 4 x double>, <vscale x 4 x double>, <vscale x 4 x i1>, i32)
527 define <vscale x 4 x double> @vfmin_vv_nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 zeroext %evl) {
528 ; CHECK-LABEL: vfmin_vv_nxv4f64:
530 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
531 ; CHECK-NEXT: vfmin.vv v8, v8, v12, v0.t
533 %v = call <vscale x 4 x double> @llvm.vp.minnum.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 %evl)
534 ret <vscale x 4 x double> %v
537 define <vscale x 4 x double> @vfmin_vv_nxv4f64_unmasked(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, i32 zeroext %evl) {
538 ; CHECK-LABEL: vfmin_vv_nxv4f64_unmasked:
540 ; CHECK-NEXT: vsetvli zero, a0, e64, m4, ta, ma
541 ; CHECK-NEXT: vfmin.vv v8, v8, v12
543 %head = insertelement <vscale x 4 x i1> poison, i1 true, i32 0
544 %m = shufflevector <vscale x 4 x i1> %head, <vscale x 4 x i1> poison, <vscale x 4 x i32> zeroinitializer
545 %v = call <vscale x 4 x double> @llvm.vp.minnum.nxv4f64(<vscale x 4 x double> %va, <vscale x 4 x double> %vb, <vscale x 4 x i1> %m, i32 %evl)
546 ret <vscale x 4 x double> %v
549 declare <vscale x 8 x double> @llvm.vp.minnum.nxv8f64(<vscale x 8 x double>, <vscale x 8 x double>, <vscale x 8 x i1>, i32)
551 define <vscale x 8 x double> @vfmin_vv_nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 zeroext %evl) {
552 ; CHECK-LABEL: vfmin_vv_nxv8f64:
554 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
555 ; CHECK-NEXT: vfmin.vv v8, v8, v16, v0.t
557 %v = call <vscale x 8 x double> @llvm.vp.minnum.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 %evl)
558 ret <vscale x 8 x double> %v
561 define <vscale x 8 x double> @vfmin_vv_nxv8f64_unmasked(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, i32 zeroext %evl) {
562 ; CHECK-LABEL: vfmin_vv_nxv8f64_unmasked:
564 ; CHECK-NEXT: vsetvli zero, a0, e64, m8, ta, ma
565 ; CHECK-NEXT: vfmin.vv v8, v8, v16
567 %head = insertelement <vscale x 8 x i1> poison, i1 true, i32 0
568 %m = shufflevector <vscale x 8 x i1> %head, <vscale x 8 x i1> poison, <vscale x 8 x i32> zeroinitializer
569 %v = call <vscale x 8 x double> @llvm.vp.minnum.nxv8f64(<vscale x 8 x double> %va, <vscale x 8 x double> %vb, <vscale x 8 x i1> %m, i32 %evl)
570 ret <vscale x 8 x double> %v