1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-NOFP16-SD
3 ; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD,CHECK-FP16-SD
4 ; RUN: llc -mtriple=aarch64 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-NOFP16-GI
5 ; RUN: llc -mtriple=aarch64 -mattr=+fullfp16 -global-isel -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI,CHECK-FP16-GI
7 define double @min_f64(double %a, double %b) {
8 ; CHECK-LABEL: min_f64:
9 ; CHECK: // %bb.0: // %entry
10 ; CHECK-NEXT: fminnm d0, d0, d1
13 %c = call double @llvm.minnum.f64(double %a, double %b)
17 define double @max_f64(double %a, double %b) {
18 ; CHECK-LABEL: max_f64:
19 ; CHECK: // %bb.0: // %entry
20 ; CHECK-NEXT: fmaxnm d0, d0, d1
23 %c = call double @llvm.maxnum.f64(double %a, double %b)
27 define float @min_f32(float %a, float %b) {
28 ; CHECK-LABEL: min_f32:
29 ; CHECK: // %bb.0: // %entry
30 ; CHECK-NEXT: fminnm s0, s0, s1
33 %c = call float @llvm.minnum.f32(float %a, float %b)
37 define float @max_f32(float %a, float %b) {
38 ; CHECK-LABEL: max_f32:
39 ; CHECK: // %bb.0: // %entry
40 ; CHECK-NEXT: fmaxnm s0, s0, s1
43 %c = call float @llvm.maxnum.f32(float %a, float %b)
47 define half @min_f16(half %a, half %b) {
48 ; CHECK-NOFP16-SD-LABEL: min_f16:
49 ; CHECK-NOFP16-SD: // %bb.0: // %entry
50 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
51 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
52 ; CHECK-NOFP16-SD-NEXT: fminnm s0, s0, s1
53 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
54 ; CHECK-NOFP16-SD-NEXT: ret
56 ; CHECK-FP16-SD-LABEL: min_f16:
57 ; CHECK-FP16-SD: // %bb.0: // %entry
58 ; CHECK-FP16-SD-NEXT: fminnm h0, h0, h1
59 ; CHECK-FP16-SD-NEXT: ret
61 ; CHECK-NOFP16-GI-LABEL: min_f16:
62 ; CHECK-NOFP16-GI: // %bb.0: // %entry
63 ; CHECK-NOFP16-GI-NEXT: fcvt s0, h0
64 ; CHECK-NOFP16-GI-NEXT: fcvt s1, h1
65 ; CHECK-NOFP16-GI-NEXT: fminnm s0, s0, s1
66 ; CHECK-NOFP16-GI-NEXT: fcvt h0, s0
67 ; CHECK-NOFP16-GI-NEXT: ret
69 ; CHECK-FP16-GI-LABEL: min_f16:
70 ; CHECK-FP16-GI: // %bb.0: // %entry
71 ; CHECK-FP16-GI-NEXT: fminnm h0, h0, h1
72 ; CHECK-FP16-GI-NEXT: ret
74 %c = call half @llvm.minnum.f16(half %a, half %b)
78 define half @max_f16(half %a, half %b) {
79 ; CHECK-NOFP16-SD-LABEL: max_f16:
80 ; CHECK-NOFP16-SD: // %bb.0: // %entry
81 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
82 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
83 ; CHECK-NOFP16-SD-NEXT: fmaxnm s0, s0, s1
84 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
85 ; CHECK-NOFP16-SD-NEXT: ret
87 ; CHECK-FP16-SD-LABEL: max_f16:
88 ; CHECK-FP16-SD: // %bb.0: // %entry
89 ; CHECK-FP16-SD-NEXT: fmaxnm h0, h0, h1
90 ; CHECK-FP16-SD-NEXT: ret
92 ; CHECK-NOFP16-GI-LABEL: max_f16:
93 ; CHECK-NOFP16-GI: // %bb.0: // %entry
94 ; CHECK-NOFP16-GI-NEXT: fcvt s0, h0
95 ; CHECK-NOFP16-GI-NEXT: fcvt s1, h1
96 ; CHECK-NOFP16-GI-NEXT: fmaxnm s0, s0, s1
97 ; CHECK-NOFP16-GI-NEXT: fcvt h0, s0
98 ; CHECK-NOFP16-GI-NEXT: ret
100 ; CHECK-FP16-GI-LABEL: max_f16:
101 ; CHECK-FP16-GI: // %bb.0: // %entry
102 ; CHECK-FP16-GI-NEXT: fmaxnm h0, h0, h1
103 ; CHECK-FP16-GI-NEXT: ret
105 %c = call half @llvm.maxnum.f16(half %a, half %b)
109 define <2 x double> @min_v2f64(<2 x double> %a, <2 x double> %b) {
110 ; CHECK-LABEL: min_v2f64:
111 ; CHECK: // %bb.0: // %entry
112 ; CHECK-NEXT: fminnm v0.2d, v0.2d, v1.2d
115 %c = call <2 x double> @llvm.minnum.v2f64(<2 x double> %a, <2 x double> %b)
119 define <2 x double> @max_v2f64(<2 x double> %a, <2 x double> %b) {
120 ; CHECK-LABEL: max_v2f64:
121 ; CHECK: // %bb.0: // %entry
122 ; CHECK-NEXT: fmaxnm v0.2d, v0.2d, v1.2d
125 %c = call <2 x double> @llvm.maxnum.v2f64(<2 x double> %a, <2 x double> %b)
129 define <3 x double> @min_v3f64(<3 x double> %a, <3 x double> %b) {
130 ; CHECK-SD-LABEL: min_v3f64:
131 ; CHECK-SD: // %bb.0: // %entry
132 ; CHECK-SD-NEXT: // kill: def $d3 killed $d3 def $q3
133 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
134 ; CHECK-SD-NEXT: // kill: def $d4 killed $d4 def $q4
135 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
136 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
137 ; CHECK-SD-NEXT: // kill: def $d5 killed $d5 def $q5
138 ; CHECK-SD-NEXT: mov v3.d[1], v4.d[0]
139 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
140 ; CHECK-SD-NEXT: fminnm v2.2d, v2.2d, v5.2d
141 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
142 ; CHECK-SD-NEXT: fminnm v0.2d, v0.2d, v3.2d
143 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
144 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
145 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
148 ; CHECK-GI-LABEL: min_v3f64:
149 ; CHECK-GI: // %bb.0: // %entry
150 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
151 ; CHECK-GI-NEXT: // kill: def $d3 killed $d3 def $q3
152 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
153 ; CHECK-GI-NEXT: // kill: def $d4 killed $d4 def $q4
154 ; CHECK-GI-NEXT: fminnm d2, d2, d5
155 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
156 ; CHECK-GI-NEXT: mov v3.d[1], v4.d[0]
157 ; CHECK-GI-NEXT: fminnm v0.2d, v0.2d, v3.2d
158 ; CHECK-GI-NEXT: mov d1, v0.d[1]
159 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
162 %c = call <3 x double> @llvm.minnum.v3f64(<3 x double> %a, <3 x double> %b)
166 define <3 x double> @max_v3f64(<3 x double> %a, <3 x double> %b) {
167 ; CHECK-SD-LABEL: max_v3f64:
168 ; CHECK-SD: // %bb.0: // %entry
169 ; CHECK-SD-NEXT: // kill: def $d3 killed $d3 def $q3
170 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
171 ; CHECK-SD-NEXT: // kill: def $d4 killed $d4 def $q4
172 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
173 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
174 ; CHECK-SD-NEXT: // kill: def $d5 killed $d5 def $q5
175 ; CHECK-SD-NEXT: mov v3.d[1], v4.d[0]
176 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
177 ; CHECK-SD-NEXT: fmaxnm v2.2d, v2.2d, v5.2d
178 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
179 ; CHECK-SD-NEXT: fmaxnm v0.2d, v0.2d, v3.2d
180 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
181 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
182 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
185 ; CHECK-GI-LABEL: max_v3f64:
186 ; CHECK-GI: // %bb.0: // %entry
187 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
188 ; CHECK-GI-NEXT: // kill: def $d3 killed $d3 def $q3
189 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
190 ; CHECK-GI-NEXT: // kill: def $d4 killed $d4 def $q4
191 ; CHECK-GI-NEXT: fmaxnm d2, d2, d5
192 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
193 ; CHECK-GI-NEXT: mov v3.d[1], v4.d[0]
194 ; CHECK-GI-NEXT: fmaxnm v0.2d, v0.2d, v3.2d
195 ; CHECK-GI-NEXT: mov d1, v0.d[1]
196 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
199 %c = call <3 x double> @llvm.maxnum.v3f64(<3 x double> %a, <3 x double> %b)
203 define <4 x double> @min_v4f64(<4 x double> %a, <4 x double> %b) {
204 ; CHECK-SD-LABEL: min_v4f64:
205 ; CHECK-SD: // %bb.0: // %entry
206 ; CHECK-SD-NEXT: fminnm v1.2d, v1.2d, v3.2d
207 ; CHECK-SD-NEXT: fminnm v0.2d, v0.2d, v2.2d
210 ; CHECK-GI-LABEL: min_v4f64:
211 ; CHECK-GI: // %bb.0: // %entry
212 ; CHECK-GI-NEXT: fminnm v0.2d, v0.2d, v2.2d
213 ; CHECK-GI-NEXT: fminnm v1.2d, v1.2d, v3.2d
216 %c = call <4 x double> @llvm.minnum.v4f64(<4 x double> %a, <4 x double> %b)
220 define <4 x double> @max_v4f64(<4 x double> %a, <4 x double> %b) {
221 ; CHECK-SD-LABEL: max_v4f64:
222 ; CHECK-SD: // %bb.0: // %entry
223 ; CHECK-SD-NEXT: fmaxnm v1.2d, v1.2d, v3.2d
224 ; CHECK-SD-NEXT: fmaxnm v0.2d, v0.2d, v2.2d
227 ; CHECK-GI-LABEL: max_v4f64:
228 ; CHECK-GI: // %bb.0: // %entry
229 ; CHECK-GI-NEXT: fmaxnm v0.2d, v0.2d, v2.2d
230 ; CHECK-GI-NEXT: fmaxnm v1.2d, v1.2d, v3.2d
233 %c = call <4 x double> @llvm.maxnum.v4f64(<4 x double> %a, <4 x double> %b)
237 define <2 x float> @min_v2f32(<2 x float> %a, <2 x float> %b) {
238 ; CHECK-LABEL: min_v2f32:
239 ; CHECK: // %bb.0: // %entry
240 ; CHECK-NEXT: fminnm v0.2s, v0.2s, v1.2s
243 %c = call <2 x float> @llvm.minnum.v2f32(<2 x float> %a, <2 x float> %b)
247 define <2 x float> @max_v2f32(<2 x float> %a, <2 x float> %b) {
248 ; CHECK-LABEL: max_v2f32:
249 ; CHECK: // %bb.0: // %entry
250 ; CHECK-NEXT: fmaxnm v0.2s, v0.2s, v1.2s
253 %c = call <2 x float> @llvm.maxnum.v2f32(<2 x float> %a, <2 x float> %b)
257 define <3 x float> @min_v3f32(<3 x float> %a, <3 x float> %b) {
258 ; CHECK-LABEL: min_v3f32:
259 ; CHECK: // %bb.0: // %entry
260 ; CHECK-NEXT: fminnm v0.4s, v0.4s, v1.4s
263 %c = call <3 x float> @llvm.minnum.v3f32(<3 x float> %a, <3 x float> %b)
267 define <3 x float> @max_v3f32(<3 x float> %a, <3 x float> %b) {
268 ; CHECK-LABEL: max_v3f32:
269 ; CHECK: // %bb.0: // %entry
270 ; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
273 %c = call <3 x float> @llvm.maxnum.v3f32(<3 x float> %a, <3 x float> %b)
277 define <4 x float> @min_v4f32(<4 x float> %a, <4 x float> %b) {
278 ; CHECK-LABEL: min_v4f32:
279 ; CHECK: // %bb.0: // %entry
280 ; CHECK-NEXT: fminnm v0.4s, v0.4s, v1.4s
283 %c = call <4 x float> @llvm.minnum.v4f32(<4 x float> %a, <4 x float> %b)
287 define <4 x float> @max_v4f32(<4 x float> %a, <4 x float> %b) {
288 ; CHECK-LABEL: max_v4f32:
289 ; CHECK: // %bb.0: // %entry
290 ; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
293 %c = call <4 x float> @llvm.maxnum.v4f32(<4 x float> %a, <4 x float> %b)
297 define <7 x float> @min_v7f32(<7 x float> %a, <7 x float> %b) {
298 ; CHECK-SD-LABEL: min_v7f32:
299 ; CHECK-SD: // %bb.0: // %entry
300 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
301 ; CHECK-SD-NEXT: // kill: def $s1 killed $s1 def $q1
302 ; CHECK-SD-NEXT: // kill: def $s7 killed $s7 def $q7
303 ; CHECK-SD-NEXT: mov x8, sp
304 ; CHECK-SD-NEXT: // kill: def $s4 killed $s4 def $q4
305 ; CHECK-SD-NEXT: // kill: def $s5 killed $s5 def $q5
306 ; CHECK-SD-NEXT: // kill: def $s2 killed $s2 def $q2
307 ; CHECK-SD-NEXT: // kill: def $s6 killed $s6 def $q6
308 ; CHECK-SD-NEXT: // kill: def $s3 killed $s3 def $q3
309 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
310 ; CHECK-SD-NEXT: ld1 { v7.s }[1], [x8]
311 ; CHECK-SD-NEXT: ldr s1, [sp, #24]
312 ; CHECK-SD-NEXT: add x8, sp, #8
313 ; CHECK-SD-NEXT: mov v4.s[1], v5.s[0]
314 ; CHECK-SD-NEXT: ld1 { v7.s }[2], [x8]
315 ; CHECK-SD-NEXT: add x8, sp, #32
316 ; CHECK-SD-NEXT: mov v0.s[2], v2.s[0]
317 ; CHECK-SD-NEXT: ld1 { v1.s }[1], [x8]
318 ; CHECK-SD-NEXT: add x8, sp, #16
319 ; CHECK-SD-NEXT: mov v4.s[2], v6.s[0]
320 ; CHECK-SD-NEXT: ld1 { v7.s }[3], [x8]
321 ; CHECK-SD-NEXT: add x8, sp, #40
322 ; CHECK-SD-NEXT: ld1 { v1.s }[2], [x8]
323 ; CHECK-SD-NEXT: mov v0.s[3], v3.s[0]
324 ; CHECK-SD-NEXT: fminnm v4.4s, v4.4s, v1.4s
325 ; CHECK-SD-NEXT: fminnm v0.4s, v0.4s, v7.4s
326 ; CHECK-SD-NEXT: mov s5, v4.s[1]
327 ; CHECK-SD-NEXT: mov s6, v4.s[2]
328 ; CHECK-SD-NEXT: // kill: def $s4 killed $s4 killed $q4
329 ; CHECK-SD-NEXT: mov s1, v0.s[1]
330 ; CHECK-SD-NEXT: mov s2, v0.s[2]
331 ; CHECK-SD-NEXT: mov s3, v0.s[3]
332 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
335 ; CHECK-GI-LABEL: min_v7f32:
336 ; CHECK-GI: // %bb.0: // %entry
337 ; CHECK-GI-NEXT: ldr s16, [sp]
338 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
339 ; CHECK-GI-NEXT: // kill: def $s7 killed $s7 def $q7
340 ; CHECK-GI-NEXT: // kill: def $s1 killed $s1 def $q1
341 ; CHECK-GI-NEXT: ldr s17, [sp, #32]
342 ; CHECK-GI-NEXT: // kill: def $s4 killed $s4 def $q4
343 ; CHECK-GI-NEXT: // kill: def $s2 killed $s2 def $q2
344 ; CHECK-GI-NEXT: // kill: def $s5 killed $s5 def $q5
345 ; CHECK-GI-NEXT: // kill: def $s3 killed $s3 def $q3
346 ; CHECK-GI-NEXT: // kill: def $s6 killed $s6 def $q6
347 ; CHECK-GI-NEXT: mov v0.s[1], v1.s[0]
348 ; CHECK-GI-NEXT: ldr s1, [sp, #8]
349 ; CHECK-GI-NEXT: mov v4.s[1], v5.s[0]
350 ; CHECK-GI-NEXT: mov v7.s[1], v16.s[0]
351 ; CHECK-GI-NEXT: ldr s16, [sp, #24]
352 ; CHECK-GI-NEXT: mov v16.s[1], v17.s[0]
353 ; CHECK-GI-NEXT: mov v0.s[2], v2.s[0]
354 ; CHECK-GI-NEXT: ldr s2, [sp, #40]
355 ; CHECK-GI-NEXT: mov v4.s[2], v6.s[0]
356 ; CHECK-GI-NEXT: mov v7.s[2], v1.s[0]
357 ; CHECK-GI-NEXT: ldr s1, [sp, #16]
358 ; CHECK-GI-NEXT: mov v16.s[2], v2.s[0]
359 ; CHECK-GI-NEXT: mov v0.s[3], v3.s[0]
360 ; CHECK-GI-NEXT: mov v7.s[3], v1.s[0]
361 ; CHECK-GI-NEXT: fminnm v4.4s, v4.4s, v16.4s
362 ; CHECK-GI-NEXT: fminnm v0.4s, v0.4s, v7.4s
363 ; CHECK-GI-NEXT: mov s5, v4.s[1]
364 ; CHECK-GI-NEXT: mov s6, v4.s[2]
365 ; CHECK-GI-NEXT: // kill: def $s4 killed $s4 killed $q4
366 ; CHECK-GI-NEXT: mov s1, v0.s[1]
367 ; CHECK-GI-NEXT: mov s2, v0.s[2]
368 ; CHECK-GI-NEXT: mov s3, v0.s[3]
369 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
372 %c = call <7 x float> @llvm.minnum.v7f32(<7 x float> %a, <7 x float> %b)
376 define <7 x float> @max_v7f32(<7 x float> %a, <7 x float> %b) {
377 ; CHECK-SD-LABEL: max_v7f32:
378 ; CHECK-SD: // %bb.0: // %entry
379 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 def $q0
380 ; CHECK-SD-NEXT: // kill: def $s1 killed $s1 def $q1
381 ; CHECK-SD-NEXT: // kill: def $s7 killed $s7 def $q7
382 ; CHECK-SD-NEXT: mov x8, sp
383 ; CHECK-SD-NEXT: // kill: def $s4 killed $s4 def $q4
384 ; CHECK-SD-NEXT: // kill: def $s5 killed $s5 def $q5
385 ; CHECK-SD-NEXT: // kill: def $s2 killed $s2 def $q2
386 ; CHECK-SD-NEXT: // kill: def $s6 killed $s6 def $q6
387 ; CHECK-SD-NEXT: // kill: def $s3 killed $s3 def $q3
388 ; CHECK-SD-NEXT: mov v0.s[1], v1.s[0]
389 ; CHECK-SD-NEXT: ld1 { v7.s }[1], [x8]
390 ; CHECK-SD-NEXT: ldr s1, [sp, #24]
391 ; CHECK-SD-NEXT: add x8, sp, #8
392 ; CHECK-SD-NEXT: mov v4.s[1], v5.s[0]
393 ; CHECK-SD-NEXT: ld1 { v7.s }[2], [x8]
394 ; CHECK-SD-NEXT: add x8, sp, #32
395 ; CHECK-SD-NEXT: mov v0.s[2], v2.s[0]
396 ; CHECK-SD-NEXT: ld1 { v1.s }[1], [x8]
397 ; CHECK-SD-NEXT: add x8, sp, #16
398 ; CHECK-SD-NEXT: mov v4.s[2], v6.s[0]
399 ; CHECK-SD-NEXT: ld1 { v7.s }[3], [x8]
400 ; CHECK-SD-NEXT: add x8, sp, #40
401 ; CHECK-SD-NEXT: ld1 { v1.s }[2], [x8]
402 ; CHECK-SD-NEXT: mov v0.s[3], v3.s[0]
403 ; CHECK-SD-NEXT: fmaxnm v4.4s, v4.4s, v1.4s
404 ; CHECK-SD-NEXT: fmaxnm v0.4s, v0.4s, v7.4s
405 ; CHECK-SD-NEXT: mov s5, v4.s[1]
406 ; CHECK-SD-NEXT: mov s6, v4.s[2]
407 ; CHECK-SD-NEXT: // kill: def $s4 killed $s4 killed $q4
408 ; CHECK-SD-NEXT: mov s1, v0.s[1]
409 ; CHECK-SD-NEXT: mov s2, v0.s[2]
410 ; CHECK-SD-NEXT: mov s3, v0.s[3]
411 ; CHECK-SD-NEXT: // kill: def $s0 killed $s0 killed $q0
414 ; CHECK-GI-LABEL: max_v7f32:
415 ; CHECK-GI: // %bb.0: // %entry
416 ; CHECK-GI-NEXT: ldr s16, [sp]
417 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 def $q0
418 ; CHECK-GI-NEXT: // kill: def $s7 killed $s7 def $q7
419 ; CHECK-GI-NEXT: // kill: def $s1 killed $s1 def $q1
420 ; CHECK-GI-NEXT: ldr s17, [sp, #32]
421 ; CHECK-GI-NEXT: // kill: def $s4 killed $s4 def $q4
422 ; CHECK-GI-NEXT: // kill: def $s2 killed $s2 def $q2
423 ; CHECK-GI-NEXT: // kill: def $s5 killed $s5 def $q5
424 ; CHECK-GI-NEXT: // kill: def $s3 killed $s3 def $q3
425 ; CHECK-GI-NEXT: // kill: def $s6 killed $s6 def $q6
426 ; CHECK-GI-NEXT: mov v0.s[1], v1.s[0]
427 ; CHECK-GI-NEXT: ldr s1, [sp, #8]
428 ; CHECK-GI-NEXT: mov v4.s[1], v5.s[0]
429 ; CHECK-GI-NEXT: mov v7.s[1], v16.s[0]
430 ; CHECK-GI-NEXT: ldr s16, [sp, #24]
431 ; CHECK-GI-NEXT: mov v16.s[1], v17.s[0]
432 ; CHECK-GI-NEXT: mov v0.s[2], v2.s[0]
433 ; CHECK-GI-NEXT: ldr s2, [sp, #40]
434 ; CHECK-GI-NEXT: mov v4.s[2], v6.s[0]
435 ; CHECK-GI-NEXT: mov v7.s[2], v1.s[0]
436 ; CHECK-GI-NEXT: ldr s1, [sp, #16]
437 ; CHECK-GI-NEXT: mov v16.s[2], v2.s[0]
438 ; CHECK-GI-NEXT: mov v0.s[3], v3.s[0]
439 ; CHECK-GI-NEXT: mov v7.s[3], v1.s[0]
440 ; CHECK-GI-NEXT: fmaxnm v4.4s, v4.4s, v16.4s
441 ; CHECK-GI-NEXT: fmaxnm v0.4s, v0.4s, v7.4s
442 ; CHECK-GI-NEXT: mov s5, v4.s[1]
443 ; CHECK-GI-NEXT: mov s6, v4.s[2]
444 ; CHECK-GI-NEXT: // kill: def $s4 killed $s4 killed $q4
445 ; CHECK-GI-NEXT: mov s1, v0.s[1]
446 ; CHECK-GI-NEXT: mov s2, v0.s[2]
447 ; CHECK-GI-NEXT: mov s3, v0.s[3]
448 ; CHECK-GI-NEXT: // kill: def $s0 killed $s0 killed $q0
451 %c = call <7 x float> @llvm.maxnum.v7f32(<7 x float> %a, <7 x float> %b)
455 define <8 x float> @min_v8f32(<8 x float> %a, <8 x float> %b) {
456 ; CHECK-SD-LABEL: min_v8f32:
457 ; CHECK-SD: // %bb.0: // %entry
458 ; CHECK-SD-NEXT: fminnm v1.4s, v1.4s, v3.4s
459 ; CHECK-SD-NEXT: fminnm v0.4s, v0.4s, v2.4s
462 ; CHECK-GI-LABEL: min_v8f32:
463 ; CHECK-GI: // %bb.0: // %entry
464 ; CHECK-GI-NEXT: fminnm v0.4s, v0.4s, v2.4s
465 ; CHECK-GI-NEXT: fminnm v1.4s, v1.4s, v3.4s
468 %c = call <8 x float> @llvm.minnum.v8f32(<8 x float> %a, <8 x float> %b)
472 define <8 x float> @max_v8f32(<8 x float> %a, <8 x float> %b) {
473 ; CHECK-SD-LABEL: max_v8f32:
474 ; CHECK-SD: // %bb.0: // %entry
475 ; CHECK-SD-NEXT: fmaxnm v1.4s, v1.4s, v3.4s
476 ; CHECK-SD-NEXT: fmaxnm v0.4s, v0.4s, v2.4s
479 ; CHECK-GI-LABEL: max_v8f32:
480 ; CHECK-GI: // %bb.0: // %entry
481 ; CHECK-GI-NEXT: fmaxnm v0.4s, v0.4s, v2.4s
482 ; CHECK-GI-NEXT: fmaxnm v1.4s, v1.4s, v3.4s
485 %c = call <8 x float> @llvm.maxnum.v8f32(<8 x float> %a, <8 x float> %b)
489 define <4 x half> @min_v4f16(<4 x half> %a, <4 x half> %b) {
490 ; CHECK-NOFP16-SD-LABEL: min_v4f16:
491 ; CHECK-NOFP16-SD: // %bb.0: // %entry
492 ; CHECK-NOFP16-SD-NEXT: // kill: def $d1 killed $d1 def $q1
493 ; CHECK-NOFP16-SD-NEXT: // kill: def $d0 killed $d0 def $q0
494 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
495 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
496 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[2]
497 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[2]
498 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h1
499 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h0
500 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[3]
501 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
502 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
503 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
504 ; CHECK-NOFP16-SD-NEXT: fminnm s2, s3, s2
505 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h4
506 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h5
507 ; CHECK-NOFP16-SD-NEXT: fminnm s5, s7, s6
508 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[3]
509 ; CHECK-NOFP16-SD-NEXT: fminnm s3, s4, s3
510 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s2
511 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s5
512 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h6
513 ; CHECK-NOFP16-SD-NEXT: mov v0.h[1], v2.h[0]
514 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s3
515 ; CHECK-NOFP16-SD-NEXT: fminnm s1, s4, s1
516 ; CHECK-NOFP16-SD-NEXT: mov v0.h[2], v2.h[0]
517 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
518 ; CHECK-NOFP16-SD-NEXT: mov v0.h[3], v1.h[0]
519 ; CHECK-NOFP16-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
520 ; CHECK-NOFP16-SD-NEXT: ret
522 ; CHECK-FP16-SD-LABEL: min_v4f16:
523 ; CHECK-FP16-SD: // %bb.0: // %entry
524 ; CHECK-FP16-SD-NEXT: fminnm v0.4h, v0.4h, v1.4h
525 ; CHECK-FP16-SD-NEXT: ret
527 ; CHECK-NOFP16-GI-LABEL: min_v4f16:
528 ; CHECK-NOFP16-GI: // %bb.0: // %entry
529 ; CHECK-NOFP16-GI-NEXT: fcvtl v0.4s, v0.4h
530 ; CHECK-NOFP16-GI-NEXT: fcvtl v1.4s, v1.4h
531 ; CHECK-NOFP16-GI-NEXT: fminnm v0.4s, v0.4s, v1.4s
532 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v0.4s
533 ; CHECK-NOFP16-GI-NEXT: ret
535 ; CHECK-FP16-GI-LABEL: min_v4f16:
536 ; CHECK-FP16-GI: // %bb.0: // %entry
537 ; CHECK-FP16-GI-NEXT: fminnm v0.4h, v0.4h, v1.4h
538 ; CHECK-FP16-GI-NEXT: ret
540 %c = call <4 x half> @llvm.minnum.v4f16(<4 x half> %a, <4 x half> %b)
544 define <4 x half> @max_v4f16(<4 x half> %a, <4 x half> %b) {
545 ; CHECK-NOFP16-SD-LABEL: max_v4f16:
546 ; CHECK-NOFP16-SD: // %bb.0: // %entry
547 ; CHECK-NOFP16-SD-NEXT: // kill: def $d1 killed $d1 def $q1
548 ; CHECK-NOFP16-SD-NEXT: // kill: def $d0 killed $d0 def $q0
549 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
550 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
551 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[2]
552 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[2]
553 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h1
554 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h0
555 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[3]
556 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
557 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
558 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
559 ; CHECK-NOFP16-SD-NEXT: fmaxnm s2, s3, s2
560 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h4
561 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h5
562 ; CHECK-NOFP16-SD-NEXT: fmaxnm s5, s7, s6
563 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[3]
564 ; CHECK-NOFP16-SD-NEXT: fmaxnm s3, s4, s3
565 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s2
566 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s5
567 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h6
568 ; CHECK-NOFP16-SD-NEXT: mov v0.h[1], v2.h[0]
569 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s3
570 ; CHECK-NOFP16-SD-NEXT: fmaxnm s1, s4, s1
571 ; CHECK-NOFP16-SD-NEXT: mov v0.h[2], v2.h[0]
572 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
573 ; CHECK-NOFP16-SD-NEXT: mov v0.h[3], v1.h[0]
574 ; CHECK-NOFP16-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
575 ; CHECK-NOFP16-SD-NEXT: ret
577 ; CHECK-FP16-SD-LABEL: max_v4f16:
578 ; CHECK-FP16-SD: // %bb.0: // %entry
579 ; CHECK-FP16-SD-NEXT: fmaxnm v0.4h, v0.4h, v1.4h
580 ; CHECK-FP16-SD-NEXT: ret
582 ; CHECK-NOFP16-GI-LABEL: max_v4f16:
583 ; CHECK-NOFP16-GI: // %bb.0: // %entry
584 ; CHECK-NOFP16-GI-NEXT: fcvtl v0.4s, v0.4h
585 ; CHECK-NOFP16-GI-NEXT: fcvtl v1.4s, v1.4h
586 ; CHECK-NOFP16-GI-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
587 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v0.4s
588 ; CHECK-NOFP16-GI-NEXT: ret
590 ; CHECK-FP16-GI-LABEL: max_v4f16:
591 ; CHECK-FP16-GI: // %bb.0: // %entry
592 ; CHECK-FP16-GI-NEXT: fmaxnm v0.4h, v0.4h, v1.4h
593 ; CHECK-FP16-GI-NEXT: ret
595 %c = call <4 x half> @llvm.maxnum.v4f16(<4 x half> %a, <4 x half> %b)
599 define <7 x half> @min_v7f16(<7 x half> %a, <7 x half> %b) {
600 ; CHECK-NOFP16-SD-LABEL: min_v7f16:
601 ; CHECK-NOFP16-SD: // %bb.0: // %entry
602 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
603 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
604 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
605 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
606 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
607 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
608 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
609 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
610 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
611 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s5, s4
612 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
613 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
614 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
615 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
616 ; CHECK-NOFP16-SD-NEXT: fminnm s3, s3, s2
617 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
618 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
619 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s7, s6
620 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
621 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
622 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
623 ; CHECK-NOFP16-SD-NEXT: fminnm s5, s5, s16
624 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
625 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
626 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
627 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
628 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
629 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
630 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
631 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
632 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
633 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
634 ; CHECK-NOFP16-SD-NEXT: fminnm s3, s6, s3
635 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
636 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
637 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
638 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
639 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
640 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
641 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
642 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
643 ; CHECK-NOFP16-SD-NEXT: fminnm s6, s16, s7
644 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
645 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
646 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
647 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s5, s4
648 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
649 ; CHECK-NOFP16-SD-NEXT: fminnm s0, s0, s1
650 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
651 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
652 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
653 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
654 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
655 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
656 ; CHECK-NOFP16-SD-NEXT: ret
658 ; CHECK-FP16-SD-LABEL: min_v7f16:
659 ; CHECK-FP16-SD: // %bb.0: // %entry
660 ; CHECK-FP16-SD-NEXT: fminnm v0.8h, v0.8h, v1.8h
661 ; CHECK-FP16-SD-NEXT: ret
663 ; CHECK-NOFP16-GI-LABEL: min_v7f16:
664 ; CHECK-NOFP16-GI: // %bb.0: // %entry
665 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
666 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
667 ; CHECK-NOFP16-GI-NEXT: mov v4.h[0], v0.h[4]
668 ; CHECK-NOFP16-GI-NEXT: fminnm v2.4s, v2.4s, v3.4s
669 ; CHECK-NOFP16-GI-NEXT: mov v3.h[0], v1.h[4]
670 ; CHECK-NOFP16-GI-NEXT: mov v4.h[1], v0.h[5]
671 ; CHECK-NOFP16-GI-NEXT: mov v3.h[1], v1.h[5]
672 ; CHECK-NOFP16-GI-NEXT: fcvtn v2.4h, v2.4s
673 ; CHECK-NOFP16-GI-NEXT: mov v4.h[2], v0.h[6]
674 ; CHECK-NOFP16-GI-NEXT: mov v3.h[2], v1.h[6]
675 ; CHECK-NOFP16-GI-NEXT: mov v0.h[0], v2.h[0]
676 ; CHECK-NOFP16-GI-NEXT: fcvtl v1.4s, v4.4h
677 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v3.4h
678 ; CHECK-NOFP16-GI-NEXT: mov v0.h[1], v2.h[1]
679 ; CHECK-NOFP16-GI-NEXT: fminnm v1.4s, v1.4s, v3.4s
680 ; CHECK-NOFP16-GI-NEXT: mov v0.h[2], v2.h[2]
681 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v1.4s
682 ; CHECK-NOFP16-GI-NEXT: mov v0.h[3], v2.h[3]
683 ; CHECK-NOFP16-GI-NEXT: mov v0.h[4], v1.h[0]
684 ; CHECK-NOFP16-GI-NEXT: mov v0.h[5], v1.h[1]
685 ; CHECK-NOFP16-GI-NEXT: mov v0.h[6], v1.h[2]
686 ; CHECK-NOFP16-GI-NEXT: ret
688 ; CHECK-FP16-GI-LABEL: min_v7f16:
689 ; CHECK-FP16-GI: // %bb.0: // %entry
690 ; CHECK-FP16-GI-NEXT: fminnm v0.8h, v0.8h, v1.8h
691 ; CHECK-FP16-GI-NEXT: ret
693 %c = call <7 x half> @llvm.minnum.v7f16(<7 x half> %a, <7 x half> %b)
697 define <7 x half> @max_v7f16(<7 x half> %a, <7 x half> %b) {
698 ; CHECK-NOFP16-SD-LABEL: max_v7f16:
699 ; CHECK-NOFP16-SD: // %bb.0: // %entry
700 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
701 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
702 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
703 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
704 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
705 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
706 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
707 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
708 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
709 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s5, s4
710 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
711 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
712 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
713 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
714 ; CHECK-NOFP16-SD-NEXT: fmaxnm s3, s3, s2
715 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
716 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
717 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s7, s6
718 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
719 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
720 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
721 ; CHECK-NOFP16-SD-NEXT: fmaxnm s5, s5, s16
722 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
723 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
724 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
725 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
726 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
727 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
728 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
729 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
730 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
731 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
732 ; CHECK-NOFP16-SD-NEXT: fmaxnm s3, s6, s3
733 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
734 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
735 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
736 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
737 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
738 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
739 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
740 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
741 ; CHECK-NOFP16-SD-NEXT: fmaxnm s6, s16, s7
742 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
743 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
744 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
745 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s5, s4
746 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
747 ; CHECK-NOFP16-SD-NEXT: fmaxnm s0, s0, s1
748 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
749 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
750 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
751 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
752 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
753 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
754 ; CHECK-NOFP16-SD-NEXT: ret
756 ; CHECK-FP16-SD-LABEL: max_v7f16:
757 ; CHECK-FP16-SD: // %bb.0: // %entry
758 ; CHECK-FP16-SD-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
759 ; CHECK-FP16-SD-NEXT: ret
761 ; CHECK-NOFP16-GI-LABEL: max_v7f16:
762 ; CHECK-NOFP16-GI: // %bb.0: // %entry
763 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
764 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
765 ; CHECK-NOFP16-GI-NEXT: mov v4.h[0], v0.h[4]
766 ; CHECK-NOFP16-GI-NEXT: fmaxnm v2.4s, v2.4s, v3.4s
767 ; CHECK-NOFP16-GI-NEXT: mov v3.h[0], v1.h[4]
768 ; CHECK-NOFP16-GI-NEXT: mov v4.h[1], v0.h[5]
769 ; CHECK-NOFP16-GI-NEXT: mov v3.h[1], v1.h[5]
770 ; CHECK-NOFP16-GI-NEXT: fcvtn v2.4h, v2.4s
771 ; CHECK-NOFP16-GI-NEXT: mov v4.h[2], v0.h[6]
772 ; CHECK-NOFP16-GI-NEXT: mov v3.h[2], v1.h[6]
773 ; CHECK-NOFP16-GI-NEXT: mov v0.h[0], v2.h[0]
774 ; CHECK-NOFP16-GI-NEXT: fcvtl v1.4s, v4.4h
775 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v3.4h
776 ; CHECK-NOFP16-GI-NEXT: mov v0.h[1], v2.h[1]
777 ; CHECK-NOFP16-GI-NEXT: fmaxnm v1.4s, v1.4s, v3.4s
778 ; CHECK-NOFP16-GI-NEXT: mov v0.h[2], v2.h[2]
779 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v1.4s
780 ; CHECK-NOFP16-GI-NEXT: mov v0.h[3], v2.h[3]
781 ; CHECK-NOFP16-GI-NEXT: mov v0.h[4], v1.h[0]
782 ; CHECK-NOFP16-GI-NEXT: mov v0.h[5], v1.h[1]
783 ; CHECK-NOFP16-GI-NEXT: mov v0.h[6], v1.h[2]
784 ; CHECK-NOFP16-GI-NEXT: ret
786 ; CHECK-FP16-GI-LABEL: max_v7f16:
787 ; CHECK-FP16-GI: // %bb.0: // %entry
788 ; CHECK-FP16-GI-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
789 ; CHECK-FP16-GI-NEXT: ret
791 %c = call <7 x half> @llvm.maxnum.v7f16(<7 x half> %a, <7 x half> %b)
795 define <8 x half> @min_v8f16(<8 x half> %a, <8 x half> %b) {
796 ; CHECK-NOFP16-SD-LABEL: min_v8f16:
797 ; CHECK-NOFP16-SD: // %bb.0: // %entry
798 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
799 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
800 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
801 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
802 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
803 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
804 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
805 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
806 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
807 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s5, s4
808 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
809 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
810 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
811 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
812 ; CHECK-NOFP16-SD-NEXT: fminnm s3, s3, s2
813 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
814 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
815 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s7, s6
816 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
817 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
818 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
819 ; CHECK-NOFP16-SD-NEXT: fminnm s5, s5, s16
820 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
821 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
822 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
823 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
824 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
825 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
826 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
827 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
828 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
829 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
830 ; CHECK-NOFP16-SD-NEXT: fminnm s3, s6, s3
831 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
832 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
833 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
834 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
835 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
836 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
837 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
838 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
839 ; CHECK-NOFP16-SD-NEXT: fminnm s6, s16, s7
840 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
841 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
842 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
843 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s5, s4
844 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
845 ; CHECK-NOFP16-SD-NEXT: fminnm s0, s0, s1
846 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
847 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
848 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
849 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
850 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
851 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
852 ; CHECK-NOFP16-SD-NEXT: ret
854 ; CHECK-FP16-SD-LABEL: min_v8f16:
855 ; CHECK-FP16-SD: // %bb.0: // %entry
856 ; CHECK-FP16-SD-NEXT: fminnm v0.8h, v0.8h, v1.8h
857 ; CHECK-FP16-SD-NEXT: ret
859 ; CHECK-NOFP16-GI-LABEL: min_v8f16:
860 ; CHECK-NOFP16-GI: // %bb.0: // %entry
861 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
862 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
863 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
864 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
865 ; CHECK-NOFP16-GI-NEXT: fminnm v2.4s, v2.4s, v3.4s
866 ; CHECK-NOFP16-GI-NEXT: fminnm v1.4s, v0.4s, v1.4s
867 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
868 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v1.4s
869 ; CHECK-NOFP16-GI-NEXT: ret
871 ; CHECK-FP16-GI-LABEL: min_v8f16:
872 ; CHECK-FP16-GI: // %bb.0: // %entry
873 ; CHECK-FP16-GI-NEXT: fminnm v0.8h, v0.8h, v1.8h
874 ; CHECK-FP16-GI-NEXT: ret
876 %c = call <8 x half> @llvm.minnum.v8f16(<8 x half> %a, <8 x half> %b)
880 define <8 x half> @max_v8f16(<8 x half> %a, <8 x half> %b) {
881 ; CHECK-NOFP16-SD-LABEL: max_v8f16:
882 ; CHECK-NOFP16-SD: // %bb.0: // %entry
883 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
884 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
885 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
886 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
887 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
888 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
889 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
890 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
891 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
892 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s5, s4
893 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
894 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
895 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
896 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
897 ; CHECK-NOFP16-SD-NEXT: fmaxnm s3, s3, s2
898 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
899 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
900 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s7, s6
901 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
902 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
903 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
904 ; CHECK-NOFP16-SD-NEXT: fmaxnm s5, s5, s16
905 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
906 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
907 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
908 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
909 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
910 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
911 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
912 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
913 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
914 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
915 ; CHECK-NOFP16-SD-NEXT: fmaxnm s3, s6, s3
916 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
917 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
918 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
919 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
920 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
921 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
922 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
923 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
924 ; CHECK-NOFP16-SD-NEXT: fmaxnm s6, s16, s7
925 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
926 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
927 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
928 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s5, s4
929 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
930 ; CHECK-NOFP16-SD-NEXT: fmaxnm s0, s0, s1
931 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
932 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
933 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
934 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
935 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
936 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
937 ; CHECK-NOFP16-SD-NEXT: ret
939 ; CHECK-FP16-SD-LABEL: max_v8f16:
940 ; CHECK-FP16-SD: // %bb.0: // %entry
941 ; CHECK-FP16-SD-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
942 ; CHECK-FP16-SD-NEXT: ret
944 ; CHECK-NOFP16-GI-LABEL: max_v8f16:
945 ; CHECK-NOFP16-GI: // %bb.0: // %entry
946 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
947 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
948 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
949 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
950 ; CHECK-NOFP16-GI-NEXT: fmaxnm v2.4s, v2.4s, v3.4s
951 ; CHECK-NOFP16-GI-NEXT: fmaxnm v1.4s, v0.4s, v1.4s
952 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
953 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v1.4s
954 ; CHECK-NOFP16-GI-NEXT: ret
956 ; CHECK-FP16-GI-LABEL: max_v8f16:
957 ; CHECK-FP16-GI: // %bb.0: // %entry
958 ; CHECK-FP16-GI-NEXT: fmaxnm v0.8h, v0.8h, v1.8h
959 ; CHECK-FP16-GI-NEXT: ret
961 %c = call <8 x half> @llvm.maxnum.v8f16(<8 x half> %a, <8 x half> %b)
965 define <16 x half> @min_v16f16(<16 x half> %a, <16 x half> %b) {
966 ; CHECK-NOFP16-SD-LABEL: min_v16f16:
967 ; CHECK-NOFP16-SD: // %bb.0: // %entry
968 ; CHECK-NOFP16-SD-NEXT: mov h6, v2.h[1]
969 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[1]
970 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h2
971 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
972 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[1]
973 ; CHECK-NOFP16-SD-NEXT: mov h17, v1.h[1]
974 ; CHECK-NOFP16-SD-NEXT: mov h18, v2.h[2]
975 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[2]
976 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h3
977 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h1
978 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[2]
979 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[2]
980 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
981 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
982 ; CHECK-NOFP16-SD-NEXT: mov h24, v0.h[6]
983 ; CHECK-NOFP16-SD-NEXT: fminnm s4, s5, s4
984 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h16
985 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h17
986 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h18
987 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
988 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[3]
989 ; CHECK-NOFP16-SD-NEXT: fminnm s20, s21, s20
990 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
991 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[3]
992 ; CHECK-NOFP16-SD-NEXT: fminnm s6, s7, s6
993 ; CHECK-NOFP16-SD-NEXT: mov h7, v2.h[3]
994 ; CHECK-NOFP16-SD-NEXT: mov h25, v1.h[6]
995 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
996 ; CHECK-NOFP16-SD-NEXT: fminnm s5, s16, s5
997 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
998 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[3]
999 ; CHECK-NOFP16-SD-NEXT: fminnm s17, s18, s17
1000 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1001 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1002 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1003 ; CHECK-NOFP16-SD-NEXT: fcvt h19, s5
1004 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s20
1005 ; CHECK-NOFP16-SD-NEXT: fminnm s16, s16, s21
1006 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1007 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1008 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[4]
1009 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[4]
1010 ; CHECK-NOFP16-SD-NEXT: mov v4.h[1], v6.h[0]
1011 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h22
1012 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[4]
1013 ; CHECK-NOFP16-SD-NEXT: fminnm s7, s18, s7
1014 ; CHECK-NOFP16-SD-NEXT: mov h18, v3.h[4]
1015 ; CHECK-NOFP16-SD-NEXT: mov v5.h[1], v19.h[0]
1016 ; CHECK-NOFP16-SD-NEXT: fcvt h16, s16
1017 ; CHECK-NOFP16-SD-NEXT: fminnm s6, s20, s6
1018 ; CHECK-NOFP16-SD-NEXT: mov v4.h[2], v17.h[0]
1019 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h21
1020 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h22
1021 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1022 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h18
1023 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1024 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[5]
1025 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[5]
1026 ; CHECK-NOFP16-SD-NEXT: mov v5.h[2], v16.h[0]
1027 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[5]
1028 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[5]
1029 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1030 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
1031 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
1032 ; CHECK-NOFP16-SD-NEXT: fminnm s17, s19, s17
1033 ; CHECK-NOFP16-SD-NEXT: mov h19, v2.h[6]
1034 ; CHECK-NOFP16-SD-NEXT: mov v4.h[3], v7.h[0]
1035 ; CHECK-NOFP16-SD-NEXT: fminnm s18, s20, s18
1036 ; CHECK-NOFP16-SD-NEXT: mov h20, v3.h[6]
1037 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h21
1038 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1039 ; CHECK-NOFP16-SD-NEXT: fcvt s22, h24
1040 ; CHECK-NOFP16-SD-NEXT: mov h2, v2.h[7]
1041 ; CHECK-NOFP16-SD-NEXT: mov v5.h[3], v6.h[0]
1042 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h16
1043 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1044 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1045 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h19
1046 ; CHECK-NOFP16-SD-NEXT: fcvt s23, h25
1047 ; CHECK-NOFP16-SD-NEXT: fcvt h18, s18
1048 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h20
1049 ; CHECK-NOFP16-SD-NEXT: mov h3, v3.h[7]
1050 ; CHECK-NOFP16-SD-NEXT: fminnm s7, s21, s7
1051 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
1052 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
1053 ; CHECK-NOFP16-SD-NEXT: fminnm s6, s16, s6
1054 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
1055 ; CHECK-NOFP16-SD-NEXT: mov v4.h[4], v17.h[0]
1056 ; CHECK-NOFP16-SD-NEXT: fminnm s16, s22, s19
1057 ; CHECK-NOFP16-SD-NEXT: mov v5.h[4], v18.h[0]
1058 ; CHECK-NOFP16-SD-NEXT: fminnm s17, s23, s20
1059 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
1060 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1061 ; CHECK-NOFP16-SD-NEXT: fminnm s0, s0, s2
1062 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1063 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s16
1064 ; CHECK-NOFP16-SD-NEXT: fminnm s1, s1, s3
1065 ; CHECK-NOFP16-SD-NEXT: mov v4.h[5], v7.h[0]
1066 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
1067 ; CHECK-NOFP16-SD-NEXT: mov v5.h[5], v6.h[0]
1068 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s17
1069 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
1070 ; CHECK-NOFP16-SD-NEXT: mov v4.h[6], v2.h[0]
1071 ; CHECK-NOFP16-SD-NEXT: mov v5.h[6], v6.h[0]
1072 ; CHECK-NOFP16-SD-NEXT: mov v4.h[7], v0.h[0]
1073 ; CHECK-NOFP16-SD-NEXT: mov v5.h[7], v1.h[0]
1074 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v4.16b
1075 ; CHECK-NOFP16-SD-NEXT: mov v1.16b, v5.16b
1076 ; CHECK-NOFP16-SD-NEXT: ret
1078 ; CHECK-FP16-SD-LABEL: min_v16f16:
1079 ; CHECK-FP16-SD: // %bb.0: // %entry
1080 ; CHECK-FP16-SD-NEXT: fminnm v1.8h, v1.8h, v3.8h
1081 ; CHECK-FP16-SD-NEXT: fminnm v0.8h, v0.8h, v2.8h
1082 ; CHECK-FP16-SD-NEXT: ret
1084 ; CHECK-NOFP16-GI-LABEL: min_v16f16:
1085 ; CHECK-NOFP16-GI: // %bb.0: // %entry
1086 ; CHECK-NOFP16-GI-NEXT: fcvtl v4.4s, v0.4h
1087 ; CHECK-NOFP16-GI-NEXT: fcvtl v5.4s, v1.4h
1088 ; CHECK-NOFP16-GI-NEXT: fcvtl v6.4s, v2.4h
1089 ; CHECK-NOFP16-GI-NEXT: fcvtl v7.4s, v3.4h
1090 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
1091 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
1092 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v2.4s, v2.8h
1093 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v3.4s, v3.8h
1094 ; CHECK-NOFP16-GI-NEXT: fminnm v4.4s, v4.4s, v6.4s
1095 ; CHECK-NOFP16-GI-NEXT: fminnm v5.4s, v5.4s, v7.4s
1096 ; CHECK-NOFP16-GI-NEXT: fminnm v2.4s, v0.4s, v2.4s
1097 ; CHECK-NOFP16-GI-NEXT: fminnm v3.4s, v1.4s, v3.4s
1098 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v4.4s
1099 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v5.4s
1100 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v2.4s
1101 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v1.8h, v3.4s
1102 ; CHECK-NOFP16-GI-NEXT: ret
1104 ; CHECK-FP16-GI-LABEL: min_v16f16:
1105 ; CHECK-FP16-GI: // %bb.0: // %entry
1106 ; CHECK-FP16-GI-NEXT: fminnm v0.8h, v0.8h, v2.8h
1107 ; CHECK-FP16-GI-NEXT: fminnm v1.8h, v1.8h, v3.8h
1108 ; CHECK-FP16-GI-NEXT: ret
1110 %c = call <16 x half> @llvm.minnum.v16f16(<16 x half> %a, <16 x half> %b)
1114 define <16 x half> @max_v16f16(<16 x half> %a, <16 x half> %b) {
1115 ; CHECK-NOFP16-SD-LABEL: max_v16f16:
1116 ; CHECK-NOFP16-SD: // %bb.0: // %entry
1117 ; CHECK-NOFP16-SD-NEXT: mov h6, v2.h[1]
1118 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[1]
1119 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h2
1120 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
1121 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[1]
1122 ; CHECK-NOFP16-SD-NEXT: mov h17, v1.h[1]
1123 ; CHECK-NOFP16-SD-NEXT: mov h18, v2.h[2]
1124 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[2]
1125 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h3
1126 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h1
1127 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[2]
1128 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[2]
1129 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
1130 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1131 ; CHECK-NOFP16-SD-NEXT: mov h24, v0.h[6]
1132 ; CHECK-NOFP16-SD-NEXT: fmaxnm s4, s5, s4
1133 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h16
1134 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h17
1135 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h18
1136 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1137 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[3]
1138 ; CHECK-NOFP16-SD-NEXT: fmaxnm s20, s21, s20
1139 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1140 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[3]
1141 ; CHECK-NOFP16-SD-NEXT: fmaxnm s6, s7, s6
1142 ; CHECK-NOFP16-SD-NEXT: mov h7, v2.h[3]
1143 ; CHECK-NOFP16-SD-NEXT: mov h25, v1.h[6]
1144 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
1145 ; CHECK-NOFP16-SD-NEXT: fmaxnm s5, s16, s5
1146 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1147 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[3]
1148 ; CHECK-NOFP16-SD-NEXT: fmaxnm s17, s18, s17
1149 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1150 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1151 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1152 ; CHECK-NOFP16-SD-NEXT: fcvt h19, s5
1153 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s20
1154 ; CHECK-NOFP16-SD-NEXT: fmaxnm s16, s16, s21
1155 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1156 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1157 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[4]
1158 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[4]
1159 ; CHECK-NOFP16-SD-NEXT: mov v4.h[1], v6.h[0]
1160 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h22
1161 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[4]
1162 ; CHECK-NOFP16-SD-NEXT: fmaxnm s7, s18, s7
1163 ; CHECK-NOFP16-SD-NEXT: mov h18, v3.h[4]
1164 ; CHECK-NOFP16-SD-NEXT: mov v5.h[1], v19.h[0]
1165 ; CHECK-NOFP16-SD-NEXT: fcvt h16, s16
1166 ; CHECK-NOFP16-SD-NEXT: fmaxnm s6, s20, s6
1167 ; CHECK-NOFP16-SD-NEXT: mov v4.h[2], v17.h[0]
1168 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h21
1169 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h22
1170 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1171 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h18
1172 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1173 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[5]
1174 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[5]
1175 ; CHECK-NOFP16-SD-NEXT: mov v5.h[2], v16.h[0]
1176 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[5]
1177 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[5]
1178 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1179 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
1180 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
1181 ; CHECK-NOFP16-SD-NEXT: fmaxnm s17, s19, s17
1182 ; CHECK-NOFP16-SD-NEXT: mov h19, v2.h[6]
1183 ; CHECK-NOFP16-SD-NEXT: mov v4.h[3], v7.h[0]
1184 ; CHECK-NOFP16-SD-NEXT: fmaxnm s18, s20, s18
1185 ; CHECK-NOFP16-SD-NEXT: mov h20, v3.h[6]
1186 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h21
1187 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1188 ; CHECK-NOFP16-SD-NEXT: fcvt s22, h24
1189 ; CHECK-NOFP16-SD-NEXT: mov h2, v2.h[7]
1190 ; CHECK-NOFP16-SD-NEXT: mov v5.h[3], v6.h[0]
1191 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h16
1192 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1193 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1194 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h19
1195 ; CHECK-NOFP16-SD-NEXT: fcvt s23, h25
1196 ; CHECK-NOFP16-SD-NEXT: fcvt h18, s18
1197 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h20
1198 ; CHECK-NOFP16-SD-NEXT: mov h3, v3.h[7]
1199 ; CHECK-NOFP16-SD-NEXT: fmaxnm s7, s21, s7
1200 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
1201 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
1202 ; CHECK-NOFP16-SD-NEXT: fmaxnm s6, s16, s6
1203 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
1204 ; CHECK-NOFP16-SD-NEXT: mov v4.h[4], v17.h[0]
1205 ; CHECK-NOFP16-SD-NEXT: fmaxnm s16, s22, s19
1206 ; CHECK-NOFP16-SD-NEXT: mov v5.h[4], v18.h[0]
1207 ; CHECK-NOFP16-SD-NEXT: fmaxnm s17, s23, s20
1208 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
1209 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1210 ; CHECK-NOFP16-SD-NEXT: fmaxnm s0, s0, s2
1211 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1212 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s16
1213 ; CHECK-NOFP16-SD-NEXT: fmaxnm s1, s1, s3
1214 ; CHECK-NOFP16-SD-NEXT: mov v4.h[5], v7.h[0]
1215 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
1216 ; CHECK-NOFP16-SD-NEXT: mov v5.h[5], v6.h[0]
1217 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s17
1218 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
1219 ; CHECK-NOFP16-SD-NEXT: mov v4.h[6], v2.h[0]
1220 ; CHECK-NOFP16-SD-NEXT: mov v5.h[6], v6.h[0]
1221 ; CHECK-NOFP16-SD-NEXT: mov v4.h[7], v0.h[0]
1222 ; CHECK-NOFP16-SD-NEXT: mov v5.h[7], v1.h[0]
1223 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v4.16b
1224 ; CHECK-NOFP16-SD-NEXT: mov v1.16b, v5.16b
1225 ; CHECK-NOFP16-SD-NEXT: ret
1227 ; CHECK-FP16-SD-LABEL: max_v16f16:
1228 ; CHECK-FP16-SD: // %bb.0: // %entry
1229 ; CHECK-FP16-SD-NEXT: fmaxnm v1.8h, v1.8h, v3.8h
1230 ; CHECK-FP16-SD-NEXT: fmaxnm v0.8h, v0.8h, v2.8h
1231 ; CHECK-FP16-SD-NEXT: ret
1233 ; CHECK-NOFP16-GI-LABEL: max_v16f16:
1234 ; CHECK-NOFP16-GI: // %bb.0: // %entry
1235 ; CHECK-NOFP16-GI-NEXT: fcvtl v4.4s, v0.4h
1236 ; CHECK-NOFP16-GI-NEXT: fcvtl v5.4s, v1.4h
1237 ; CHECK-NOFP16-GI-NEXT: fcvtl v6.4s, v2.4h
1238 ; CHECK-NOFP16-GI-NEXT: fcvtl v7.4s, v3.4h
1239 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
1240 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
1241 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v2.4s, v2.8h
1242 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v3.4s, v3.8h
1243 ; CHECK-NOFP16-GI-NEXT: fmaxnm v4.4s, v4.4s, v6.4s
1244 ; CHECK-NOFP16-GI-NEXT: fmaxnm v5.4s, v5.4s, v7.4s
1245 ; CHECK-NOFP16-GI-NEXT: fmaxnm v2.4s, v0.4s, v2.4s
1246 ; CHECK-NOFP16-GI-NEXT: fmaxnm v3.4s, v1.4s, v3.4s
1247 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v4.4s
1248 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v5.4s
1249 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v2.4s
1250 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v1.8h, v3.4s
1251 ; CHECK-NOFP16-GI-NEXT: ret
1253 ; CHECK-FP16-GI-LABEL: max_v16f16:
1254 ; CHECK-FP16-GI: // %bb.0: // %entry
1255 ; CHECK-FP16-GI-NEXT: fmaxnm v0.8h, v0.8h, v2.8h
1256 ; CHECK-FP16-GI-NEXT: fmaxnm v1.8h, v1.8h, v3.8h
1257 ; CHECK-FP16-GI-NEXT: ret
1259 %c = call <16 x half> @llvm.maxnum.v16f16(<16 x half> %a, <16 x half> %b)
1263 declare <16 x half> @llvm.maxnum.v16f16(<16 x half>, <16 x half>)
1264 declare <16 x half> @llvm.minnum.v16f16(<16 x half>, <16 x half>)
1265 declare <2 x double> @llvm.maxnum.v2f64(<2 x double>, <2 x double>)
1266 declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
1267 declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
1268 declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
1269 declare <3 x double> @llvm.maxnum.v3f64(<3 x double>, <3 x double>)
1270 declare <3 x double> @llvm.minnum.v3f64(<3 x double>, <3 x double>)
1271 declare <3 x float> @llvm.maxnum.v3f32(<3 x float>, <3 x float>)
1272 declare <3 x float> @llvm.minnum.v3f32(<3 x float>, <3 x float>)
1273 declare <4 x double> @llvm.maxnum.v4f64(<4 x double>, <4 x double>)
1274 declare <4 x double> @llvm.minnum.v4f64(<4 x double>, <4 x double>)
1275 declare <4 x float> @llvm.maxnum.v4f32(<4 x float>, <4 x float>)
1276 declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
1277 declare <4 x half> @llvm.maxnum.v4f16(<4 x half>, <4 x half>)
1278 declare <4 x half> @llvm.minnum.v4f16(<4 x half>, <4 x half>)
1279 declare <7 x float> @llvm.maxnum.v7f32(<7 x float>, <7 x float>)
1280 declare <7 x float> @llvm.minnum.v7f32(<7 x float>, <7 x float>)
1281 declare <7 x half> @llvm.maxnum.v7f16(<7 x half>, <7 x half>)
1282 declare <7 x half> @llvm.minnum.v7f16(<7 x half>, <7 x half>)
1283 declare <8 x float> @llvm.maxnum.v8f32(<8 x float>, <8 x float>)
1284 declare <8 x float> @llvm.minnum.v8f32(<8 x float>, <8 x float>)
1285 declare <8 x half> @llvm.maxnum.v8f16(<8 x half>, <8 x half>)
1286 declare <8 x half> @llvm.minnum.v8f16(<8 x half>, <8 x half>)
1287 declare double @llvm.maxnum.f64(double, double)
1288 declare double @llvm.minnum.f64(double, double)
1289 declare float @llvm.maxnum.f32(float, float)
1290 declare float @llvm.minnum.f32(float, float)
1291 declare half @llvm.maxnum.f16(half, half)
1292 declare half @llvm.minnum.f16(half, half)