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.minnum.nxv1f16(<vscale x 1 x half>, <vscale x 1 x half>)
13 define <vscale x 1 x half> @vfmin_nxv1f16_vv(<vscale x 1 x half> %a, <vscale x 1 x half> %b) {
14 ; ZVFH-LABEL: vfmin_nxv1f16_vv:
16 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
17 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
20 ; ZVFHMIN-LABEL: vfmin_nxv1f16_vv:
22 ; ZVFHMIN-NEXT: vsetvli a0, 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, zero, e32, mf2, ta, ma
26 ; ZVFHMIN-NEXT: vfmin.vv v9, v9, v10
27 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf4, ta, ma
28 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
30 %v = call <vscale x 1 x half> @llvm.minnum.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x half> %b)
31 ret <vscale x 1 x half> %v
34 define <vscale x 1 x half> @vfmin_nxv1f16_vf(<vscale x 1 x half> %a, half %b) {
35 ; ZVFH-LABEL: vfmin_nxv1f16_vf:
37 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf4, ta, ma
38 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
41 ; ZVFHMIN-LABEL: vfmin_nxv1f16_vf:
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: vfmin.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 %v = call <vscale x 1 x half> @llvm.minnum.nxv1f16(<vscale x 1 x half> %a, <vscale x 1 x half> %splat)
58 ret <vscale x 1 x half> %v
61 declare <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half>, <vscale x 2 x half>)
63 define <vscale x 2 x half> @vfmin_nxv2f16_vv(<vscale x 2 x half> %a, <vscale x 2 x half> %b) {
64 ; ZVFH-LABEL: vfmin_nxv2f16_vv:
66 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
67 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
70 ; ZVFHMIN-LABEL: vfmin_nxv2f16_vv:
72 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
73 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
74 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v9, v8
75 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m1, ta, ma
76 ; ZVFHMIN-NEXT: vfmin.vv v9, v9, v10
77 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, mf2, ta, ma
78 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v9
80 %v = call <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %b)
81 ret <vscale x 2 x half> %v
84 define <vscale x 2 x half> @vfmin_nxv2f16_vf(<vscale x 2 x half> %a, half %b) {
85 ; ZVFH-LABEL: vfmin_nxv2f16_vf:
87 ; ZVFH-NEXT: vsetvli a0, zero, e16, mf2, ta, ma
88 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
91 ; ZVFHMIN-LABEL: vfmin_nxv2f16_vf:
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: vfmin.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 %v = call <vscale x 2 x half> @llvm.minnum.nxv2f16(<vscale x 2 x half> %a, <vscale x 2 x half> %splat)
108 ret <vscale x 2 x half> %v
111 declare <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half>, <vscale x 4 x half>)
113 define <vscale x 4 x half> @vfmin_nxv4f16_vv(<vscale x 4 x half> %a, <vscale x 4 x half> %b) {
114 ; ZVFH-LABEL: vfmin_nxv4f16_vv:
116 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
117 ; ZVFH-NEXT: vfmin.vv v8, v8, v9
120 ; ZVFHMIN-LABEL: vfmin_nxv4f16_vv:
122 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m1, ta, ma
123 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v10, v9
124 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v8
125 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m2, ta, ma
126 ; ZVFHMIN-NEXT: vfmin.vv v10, v12, v10
127 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m1, ta, ma
128 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v10
130 %v = call <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %b)
131 ret <vscale x 4 x half> %v
134 define <vscale x 4 x half> @vfmin_nxv4f16_vf(<vscale x 4 x half> %a, half %b) {
135 ; ZVFH-LABEL: vfmin_nxv4f16_vf:
137 ; ZVFH-NEXT: vsetvli a0, zero, e16, m1, ta, ma
138 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
141 ; ZVFHMIN-LABEL: vfmin_nxv4f16_vf:
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: vfmin.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 %v = call <vscale x 4 x half> @llvm.minnum.nxv4f16(<vscale x 4 x half> %a, <vscale x 4 x half> %splat)
158 ret <vscale x 4 x half> %v
161 declare <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half>, <vscale x 8 x half>)
163 define <vscale x 8 x half> @vfmin_nxv8f16_vv(<vscale x 8 x half> %a, <vscale x 8 x half> %b) {
164 ; ZVFH-LABEL: vfmin_nxv8f16_vv:
166 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
167 ; ZVFH-NEXT: vfmin.vv v8, v8, v10
170 ; ZVFHMIN-LABEL: vfmin_nxv8f16_vv:
172 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m2, ta, ma
173 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v12, v10
174 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
175 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m4, ta, ma
176 ; ZVFHMIN-NEXT: vfmin.vv v12, v16, v12
177 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m2, ta, ma
178 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v12
180 %v = call <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %b)
181 ret <vscale x 8 x half> %v
184 define <vscale x 8 x half> @vfmin_nxv8f16_vf(<vscale x 8 x half> %a, half %b) {
185 ; ZVFH-LABEL: vfmin_nxv8f16_vf:
187 ; ZVFH-NEXT: vsetvli a0, zero, e16, m2, ta, ma
188 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
191 ; ZVFHMIN-LABEL: vfmin_nxv8f16_vf:
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: vfmin.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 %v = call <vscale x 8 x half> @llvm.minnum.nxv8f16(<vscale x 8 x half> %a, <vscale x 8 x half> %splat)
208 ret <vscale x 8 x half> %v
211 declare <vscale x 16 x half> @llvm.minnum.nxv16f16(<vscale x 16 x half>, <vscale x 16 x half>)
213 define <vscale x 16 x half> @vfmin_nxv16f16_vv(<vscale x 16 x half> %a, <vscale x 16 x half> %b) {
214 ; ZVFH-LABEL: vfmin_nxv16f16_vv:
216 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
217 ; ZVFH-NEXT: vfmin.vv v8, v8, v12
220 ; ZVFHMIN-LABEL: vfmin_nxv16f16_vv:
222 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
223 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
224 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v8
225 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
226 ; ZVFHMIN-NEXT: vfmin.vv v16, v24, v16
227 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
228 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
230 %v = call <vscale x 16 x half> @llvm.minnum.nxv16f16(<vscale x 16 x half> %a, <vscale x 16 x half> %b)
231 ret <vscale x 16 x half> %v
234 define <vscale x 16 x half> @vfmin_nxv16f16_vf(<vscale x 16 x half> %a, half %b) {
235 ; ZVFH-LABEL: vfmin_nxv16f16_vf:
237 ; ZVFH-NEXT: vsetvli a0, zero, e16, m4, ta, ma
238 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
241 ; ZVFHMIN-LABEL: vfmin_nxv16f16_vf:
243 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
244 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
245 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
246 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
247 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
248 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
249 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v12
250 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
251 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v24
252 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
253 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
255 %head = insertelement <vscale x 16 x half> poison, half %b, i32 0
256 %splat = shufflevector <vscale x 16 x half> %head, <vscale x 16 x half> poison, <vscale x 16 x i32> zeroinitializer
257 %v = call <vscale x 16 x half> @llvm.minnum.nxv16f16(<vscale x 16 x half> %a, <vscale x 16 x half> %splat)
258 ret <vscale x 16 x half> %v
261 declare <vscale x 32 x half> @llvm.minnum.nxv32f16(<vscale x 32 x half>, <vscale x 32 x half>)
263 define <vscale x 32 x half> @vfmin_nxv32f16_vv(<vscale x 32 x half> %a, <vscale x 32 x half> %b) {
264 ; ZVFH-LABEL: vfmin_nxv32f16_vv:
266 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
267 ; ZVFH-NEXT: vfmin.vv v8, v8, v16
270 ; ZVFHMIN-LABEL: vfmin_nxv32f16_vv:
272 ; ZVFHMIN-NEXT: vsetvli a0, zero, e16, m4, ta, ma
273 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v16
274 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v8
275 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
276 ; ZVFHMIN-NEXT: vfmin.vv v24, v0, v24
277 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
278 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v24
279 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v24, v20
280 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
281 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
282 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v24
283 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
284 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
286 %v = call <vscale x 32 x half> @llvm.minnum.nxv32f16(<vscale x 32 x half> %a, <vscale x 32 x half> %b)
287 ret <vscale x 32 x half> %v
290 define <vscale x 32 x half> @vfmin_nxv32f16_vf(<vscale x 32 x half> %a, half %b) {
291 ; ZVFH-LABEL: vfmin_nxv32f16_vf:
293 ; ZVFH-NEXT: vsetvli a0, zero, e16, m8, ta, ma
294 ; ZVFH-NEXT: vfmin.vf v8, v8, fa0
297 ; ZVFHMIN-LABEL: vfmin_nxv32f16_vf:
299 ; ZVFHMIN-NEXT: fcvt.s.h fa5, fa0
300 ; ZVFHMIN-NEXT: vsetvli a0, zero, e32, m8, ta, ma
301 ; ZVFHMIN-NEXT: vfmv.v.f v16, fa5
302 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
303 ; ZVFHMIN-NEXT: vfncvt.f.f.w v24, v16
304 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v8
305 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v0, v24
306 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
307 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v0
308 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
309 ; ZVFHMIN-NEXT: vfncvt.f.f.w v8, v16
310 ; ZVFHMIN-NEXT: vfwcvt.f.f.v v16, v12
311 ; ZVFHMIN-NEXT: vsetvli zero, zero, e32, m8, ta, ma
312 ; ZVFHMIN-NEXT: vfmin.vv v16, v16, v0
313 ; ZVFHMIN-NEXT: vsetvli zero, zero, e16, m4, ta, ma
314 ; ZVFHMIN-NEXT: vfncvt.f.f.w v12, v16
316 %head = insertelement <vscale x 32 x half> poison, half %b, i32 0
317 %splat = shufflevector <vscale x 32 x half> %head, <vscale x 32 x half> poison, <vscale x 32 x i32> zeroinitializer
318 %v = call <vscale x 32 x half> @llvm.minnum.nxv32f16(<vscale x 32 x half> %a, <vscale x 32 x half> %splat)
319 ret <vscale x 32 x half> %v
322 declare <vscale x 1 x float> @llvm.minnum.nxv1f32(<vscale x 1 x float>, <vscale x 1 x float>)
324 define <vscale x 1 x float> @vfmin_nxv1f32_vv(<vscale x 1 x float> %a, <vscale x 1 x float> %b) {
325 ; CHECK-LABEL: vfmin_nxv1f32_vv:
327 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
328 ; CHECK-NEXT: vfmin.vv v8, v8, v9
330 %v = call <vscale x 1 x float> @llvm.minnum.nxv1f32(<vscale x 1 x float> %a, <vscale x 1 x float> %b)
331 ret <vscale x 1 x float> %v
334 define <vscale x 1 x float> @vfmin_nxv1f32_vf(<vscale x 1 x float> %a, float %b) {
335 ; CHECK-LABEL: vfmin_nxv1f32_vf:
337 ; CHECK-NEXT: vsetvli a0, zero, e32, mf2, ta, ma
338 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
340 %head = insertelement <vscale x 1 x float> poison, float %b, i32 0
341 %splat = shufflevector <vscale x 1 x float> %head, <vscale x 1 x float> poison, <vscale x 1 x i32> zeroinitializer
342 %v = call <vscale x 1 x float> @llvm.minnum.nxv1f32(<vscale x 1 x float> %a, <vscale x 1 x float> %splat)
343 ret <vscale x 1 x float> %v
346 declare <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float>, <vscale x 2 x float>)
348 define <vscale x 2 x float> @vfmin_nxv2f32_vv(<vscale x 2 x float> %a, <vscale x 2 x float> %b) {
349 ; CHECK-LABEL: vfmin_nxv2f32_vv:
351 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
352 ; CHECK-NEXT: vfmin.vv v8, v8, v9
354 %v = call <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %b)
355 ret <vscale x 2 x float> %v
358 define <vscale x 2 x float> @vfmin_nxv2f32_vf(<vscale x 2 x float> %a, float %b) {
359 ; CHECK-LABEL: vfmin_nxv2f32_vf:
361 ; CHECK-NEXT: vsetvli a0, zero, e32, m1, ta, ma
362 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
364 %head = insertelement <vscale x 2 x float> poison, float %b, i32 0
365 %splat = shufflevector <vscale x 2 x float> %head, <vscale x 2 x float> poison, <vscale x 2 x i32> zeroinitializer
366 %v = call <vscale x 2 x float> @llvm.minnum.nxv2f32(<vscale x 2 x float> %a, <vscale x 2 x float> %splat)
367 ret <vscale x 2 x float> %v
370 declare <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float>, <vscale x 4 x float>)
372 define <vscale x 4 x float> @vfmin_nxv4f32_vv(<vscale x 4 x float> %a, <vscale x 4 x float> %b) {
373 ; CHECK-LABEL: vfmin_nxv4f32_vv:
375 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
376 ; CHECK-NEXT: vfmin.vv v8, v8, v10
378 %v = call <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %b)
379 ret <vscale x 4 x float> %v
382 define <vscale x 4 x float> @vfmin_nxv4f32_vf(<vscale x 4 x float> %a, float %b) {
383 ; CHECK-LABEL: vfmin_nxv4f32_vf:
385 ; CHECK-NEXT: vsetvli a0, zero, e32, m2, ta, ma
386 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
388 %head = insertelement <vscale x 4 x float> poison, float %b, i32 0
389 %splat = shufflevector <vscale x 4 x float> %head, <vscale x 4 x float> poison, <vscale x 4 x i32> zeroinitializer
390 %v = call <vscale x 4 x float> @llvm.minnum.nxv4f32(<vscale x 4 x float> %a, <vscale x 4 x float> %splat)
391 ret <vscale x 4 x float> %v
394 declare <vscale x 8 x float> @llvm.minnum.nxv8f32(<vscale x 8 x float>, <vscale x 8 x float>)
396 define <vscale x 8 x float> @vfmin_nxv8f32_vv(<vscale x 8 x float> %a, <vscale x 8 x float> %b) {
397 ; CHECK-LABEL: vfmin_nxv8f32_vv:
399 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
400 ; CHECK-NEXT: vfmin.vv v8, v8, v12
402 %v = call <vscale x 8 x float> @llvm.minnum.nxv8f32(<vscale x 8 x float> %a, <vscale x 8 x float> %b)
403 ret <vscale x 8 x float> %v
406 define <vscale x 8 x float> @vfmin_nxv8f32_vf(<vscale x 8 x float> %a, float %b) {
407 ; CHECK-LABEL: vfmin_nxv8f32_vf:
409 ; CHECK-NEXT: vsetvli a0, zero, e32, m4, ta, ma
410 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
412 %head = insertelement <vscale x 8 x float> poison, float %b, i32 0
413 %splat = shufflevector <vscale x 8 x float> %head, <vscale x 8 x float> poison, <vscale x 8 x i32> zeroinitializer
414 %v = call <vscale x 8 x float> @llvm.minnum.nxv8f32(<vscale x 8 x float> %a, <vscale x 8 x float> %splat)
415 ret <vscale x 8 x float> %v
418 declare <vscale x 16 x float> @llvm.minnum.nxv16f32(<vscale x 16 x float>, <vscale x 16 x float>)
420 define <vscale x 16 x float> @vfmin_nxv16f32_vv(<vscale x 16 x float> %a, <vscale x 16 x float> %b) {
421 ; CHECK-LABEL: vfmin_nxv16f32_vv:
423 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
424 ; CHECK-NEXT: vfmin.vv v8, v8, v16
426 %v = call <vscale x 16 x float> @llvm.minnum.nxv16f32(<vscale x 16 x float> %a, <vscale x 16 x float> %b)
427 ret <vscale x 16 x float> %v
430 define <vscale x 16 x float> @vfmin_nxv16f32_vf(<vscale x 16 x float> %a, float %b) {
431 ; CHECK-LABEL: vfmin_nxv16f32_vf:
433 ; CHECK-NEXT: vsetvli a0, zero, e32, m8, ta, ma
434 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
436 %head = insertelement <vscale x 16 x float> poison, float %b, i32 0
437 %splat = shufflevector <vscale x 16 x float> %head, <vscale x 16 x float> poison, <vscale x 16 x i32> zeroinitializer
438 %v = call <vscale x 16 x float> @llvm.minnum.nxv16f32(<vscale x 16 x float> %a, <vscale x 16 x float> %splat)
439 ret <vscale x 16 x float> %v
442 declare <vscale x 1 x double> @llvm.minnum.nxv1f64(<vscale x 1 x double>, <vscale x 1 x double>)
444 define <vscale x 1 x double> @vfmin_nxv1f64_vv(<vscale x 1 x double> %a, <vscale x 1 x double> %b) {
445 ; CHECK-LABEL: vfmin_nxv1f64_vv:
447 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
448 ; CHECK-NEXT: vfmin.vv v8, v8, v9
450 %v = call <vscale x 1 x double> @llvm.minnum.nxv1f64(<vscale x 1 x double> %a, <vscale x 1 x double> %b)
451 ret <vscale x 1 x double> %v
454 define <vscale x 1 x double> @vfmin_nxv1f64_vf(<vscale x 1 x double> %a, double %b) {
455 ; CHECK-LABEL: vfmin_nxv1f64_vf:
457 ; CHECK-NEXT: vsetvli a0, zero, e64, m1, ta, ma
458 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
460 %head = insertelement <vscale x 1 x double> poison, double %b, i32 0
461 %splat = shufflevector <vscale x 1 x double> %head, <vscale x 1 x double> poison, <vscale x 1 x i32> zeroinitializer
462 %v = call <vscale x 1 x double> @llvm.minnum.nxv1f64(<vscale x 1 x double> %a, <vscale x 1 x double> %splat)
463 ret <vscale x 1 x double> %v
466 declare <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double>, <vscale x 2 x double>)
468 define <vscale x 2 x double> @vfmin_nxv2f64_vv(<vscale x 2 x double> %a, <vscale x 2 x double> %b) {
469 ; CHECK-LABEL: vfmin_nxv2f64_vv:
471 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
472 ; CHECK-NEXT: vfmin.vv v8, v8, v10
474 %v = call <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b)
475 ret <vscale x 2 x double> %v
478 define <vscale x 2 x double> @vfmin_nxv2f64_vf(<vscale x 2 x double> %a, double %b) {
479 ; CHECK-LABEL: vfmin_nxv2f64_vf:
481 ; CHECK-NEXT: vsetvli a0, zero, e64, m2, ta, ma
482 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
484 %head = insertelement <vscale x 2 x double> poison, double %b, i32 0
485 %splat = shufflevector <vscale x 2 x double> %head, <vscale x 2 x double> poison, <vscale x 2 x i32> zeroinitializer
486 %v = call <vscale x 2 x double> @llvm.minnum.nxv2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %splat)
487 ret <vscale x 2 x double> %v
490 declare <vscale x 4 x double> @llvm.minnum.nxv4f64(<vscale x 4 x double>, <vscale x 4 x double>)
492 define <vscale x 4 x double> @vfmin_nxv4f64_vv(<vscale x 4 x double> %a, <vscale x 4 x double> %b) {
493 ; CHECK-LABEL: vfmin_nxv4f64_vv:
495 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
496 ; CHECK-NEXT: vfmin.vv v8, v8, v12
498 %v = call <vscale x 4 x double> @llvm.minnum.nxv4f64(<vscale x 4 x double> %a, <vscale x 4 x double> %b)
499 ret <vscale x 4 x double> %v
502 define <vscale x 4 x double> @vfmin_nxv4f64_vf(<vscale x 4 x double> %a, double %b) {
503 ; CHECK-LABEL: vfmin_nxv4f64_vf:
505 ; CHECK-NEXT: vsetvli a0, zero, e64, m4, ta, ma
506 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
508 %head = insertelement <vscale x 4 x double> poison, double %b, i32 0
509 %splat = shufflevector <vscale x 4 x double> %head, <vscale x 4 x double> poison, <vscale x 4 x i32> zeroinitializer
510 %v = call <vscale x 4 x double> @llvm.minnum.nxv4f64(<vscale x 4 x double> %a, <vscale x 4 x double> %splat)
511 ret <vscale x 4 x double> %v
514 declare <vscale x 8 x double> @llvm.minnum.nxv8f64(<vscale x 8 x double>, <vscale x 8 x double>)
516 define <vscale x 8 x double> @vfmin_nxv8f64_vv(<vscale x 8 x double> %a, <vscale x 8 x double> %b) {
517 ; CHECK-LABEL: vfmin_nxv8f64_vv:
519 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
520 ; CHECK-NEXT: vfmin.vv v8, v8, v16
522 %v = call <vscale x 8 x double> @llvm.minnum.nxv8f64(<vscale x 8 x double> %a, <vscale x 8 x double> %b)
523 ret <vscale x 8 x double> %v
526 define <vscale x 8 x double> @vfmin_nxv8f64_vf(<vscale x 8 x double> %a, double %b) {
527 ; CHECK-LABEL: vfmin_nxv8f64_vf:
529 ; CHECK-NEXT: vsetvli a0, zero, e64, m8, ta, ma
530 ; CHECK-NEXT: vfmin.vf v8, v8, fa0
532 %head = insertelement <vscale x 8 x double> poison, double %b, i32 0
533 %splat = shufflevector <vscale x 8 x double> %head, <vscale x 8 x double> poison, <vscale x 8 x i32> zeroinitializer
534 %v = call <vscale x 8 x double> @llvm.minnum.nxv8f64(<vscale x 8 x double> %a, <vscale x 8 x double> %splat)
535 ret <vscale x 8 x double> %v