1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
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: fmin d0, d0, d1
13 %c = call double @llvm.minimum.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: fmax d0, d0, d1
23 %c = call double @llvm.maximum.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: fmin s0, s0, s1
33 %c = call float @llvm.minimum.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: fmax s0, s0, s1
43 %c = call float @llvm.maximum.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: fmin 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: fmin 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: fmin 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: fmin h0, h0, h1
72 ; CHECK-FP16-GI-NEXT: ret
74 %c = call half @llvm.minimum.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: fmax 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: fmax 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: fmax 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: fmax h0, h0, h1
103 ; CHECK-FP16-GI-NEXT: ret
105 %c = call half @llvm.maximum.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: fmin v0.2d, v0.2d, v1.2d
115 %c = call <2 x double> @llvm.minimum.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: fmax v0.2d, v0.2d, v1.2d
125 %c = call <2 x double> @llvm.maximum.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: fmin v2.2d, v2.2d, v5.2d
141 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
142 ; CHECK-SD-NEXT: fmin 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: fmin 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: fmin 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.minimum.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: fmax v2.2d, v2.2d, v5.2d
178 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
179 ; CHECK-SD-NEXT: fmax 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: fmax 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: fmax 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.maximum.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: fmin v1.2d, v1.2d, v3.2d
207 ; CHECK-SD-NEXT: fmin v0.2d, v0.2d, v2.2d
210 ; CHECK-GI-LABEL: min_v4f64:
211 ; CHECK-GI: // %bb.0: // %entry
212 ; CHECK-GI-NEXT: fmin v0.2d, v0.2d, v2.2d
213 ; CHECK-GI-NEXT: fmin v1.2d, v1.2d, v3.2d
216 %c = call <4 x double> @llvm.minimum.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: fmax v1.2d, v1.2d, v3.2d
224 ; CHECK-SD-NEXT: fmax v0.2d, v0.2d, v2.2d
227 ; CHECK-GI-LABEL: max_v4f64:
228 ; CHECK-GI: // %bb.0: // %entry
229 ; CHECK-GI-NEXT: fmax v0.2d, v0.2d, v2.2d
230 ; CHECK-GI-NEXT: fmax v1.2d, v1.2d, v3.2d
233 %c = call <4 x double> @llvm.maximum.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: fmin v0.2s, v0.2s, v1.2s
243 %c = call <2 x float> @llvm.minimum.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: fmax v0.2s, v0.2s, v1.2s
253 %c = call <2 x float> @llvm.maximum.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: fmin v0.4s, v0.4s, v1.4s
263 %c = call <3 x float> @llvm.minimum.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: fmax v0.4s, v0.4s, v1.4s
273 %c = call <3 x float> @llvm.maximum.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: fmin v0.4s, v0.4s, v1.4s
283 %c = call <4 x float> @llvm.minimum.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: fmax v0.4s, v0.4s, v1.4s
293 %c = call <4 x float> @llvm.maximum.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: fmin v4.4s, v4.4s, v1.4s
325 ; CHECK-SD-NEXT: fmin 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: fmin v4.4s, v4.4s, v16.4s
362 ; CHECK-GI-NEXT: fmin 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.minimum.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: fmax v4.4s, v4.4s, v1.4s
404 ; CHECK-SD-NEXT: fmax 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: fmax v4.4s, v4.4s, v16.4s
441 ; CHECK-GI-NEXT: fmax 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.maximum.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: fmin v1.4s, v1.4s, v3.4s
459 ; CHECK-SD-NEXT: fmin v0.4s, v0.4s, v2.4s
462 ; CHECK-GI-LABEL: min_v8f32:
463 ; CHECK-GI: // %bb.0: // %entry
464 ; CHECK-GI-NEXT: fmin v0.4s, v0.4s, v2.4s
465 ; CHECK-GI-NEXT: fmin v1.4s, v1.4s, v3.4s
468 %c = call <8 x float> @llvm.minimum.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: fmax v1.4s, v1.4s, v3.4s
476 ; CHECK-SD-NEXT: fmax v0.4s, v0.4s, v2.4s
479 ; CHECK-GI-LABEL: max_v8f32:
480 ; CHECK-GI: // %bb.0: // %entry
481 ; CHECK-GI-NEXT: fmax v0.4s, v0.4s, v2.4s
482 ; CHECK-GI-NEXT: fmax v1.4s, v1.4s, v3.4s
485 %c = call <8 x float> @llvm.maximum.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: fmin s2, s3, s2
505 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h4
506 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h5
507 ; CHECK-NOFP16-SD-NEXT: fmin s5, s7, s6
508 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[3]
509 ; CHECK-NOFP16-SD-NEXT: fmin 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: fmin 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: fmin 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: fmin 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: fmin v0.4h, v0.4h, v1.4h
538 ; CHECK-FP16-GI-NEXT: ret
540 %c = call <4 x half> @llvm.minimum.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: fmax s2, s3, s2
560 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h4
561 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h5
562 ; CHECK-NOFP16-SD-NEXT: fmax s5, s7, s6
563 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[3]
564 ; CHECK-NOFP16-SD-NEXT: fmax 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: fmax 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: fmax 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: fmax 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: fmax v0.4h, v0.4h, v1.4h
593 ; CHECK-FP16-GI-NEXT: ret
595 %c = call <4 x half> @llvm.maximum.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: fmin 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: fmin s3, s3, s2
617 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
618 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
619 ; CHECK-NOFP16-SD-NEXT: fmin 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: fmin 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: fmin 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: fmin 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: fmin s4, s5, s4
648 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
649 ; CHECK-NOFP16-SD-NEXT: fmin 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: fmin 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 h4, v0.h[4]
668 ; CHECK-NOFP16-GI-NEXT: mov h5, v0.h[5]
669 ; CHECK-NOFP16-GI-NEXT: mov h6, v1.h[4]
670 ; CHECK-NOFP16-GI-NEXT: mov h7, v1.h[5]
671 ; CHECK-NOFP16-GI-NEXT: mov h1, v1.h[6]
672 ; CHECK-NOFP16-GI-NEXT: fmin v2.4s, v2.4s, v3.4s
673 ; CHECK-NOFP16-GI-NEXT: mov h3, v0.h[6]
674 ; CHECK-NOFP16-GI-NEXT: mov v4.h[1], v5.h[0]
675 ; CHECK-NOFP16-GI-NEXT: mov v6.h[1], v7.h[0]
676 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
677 ; CHECK-NOFP16-GI-NEXT: mov v4.h[2], v3.h[0]
678 ; CHECK-NOFP16-GI-NEXT: mov v6.h[2], v1.h[0]
679 ; CHECK-NOFP16-GI-NEXT: mov h1, v0.h[1]
680 ; CHECK-NOFP16-GI-NEXT: mov h5, v0.h[3]
681 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v4.4h
682 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v6.4h
683 ; CHECK-NOFP16-GI-NEXT: mov h4, v0.h[2]
684 ; CHECK-NOFP16-GI-NEXT: mov v0.h[1], v1.h[0]
685 ; CHECK-NOFP16-GI-NEXT: fmin v1.4s, v2.4s, v3.4s
686 ; CHECK-NOFP16-GI-NEXT: mov v0.h[2], v4.h[0]
687 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v1.4s
688 ; CHECK-NOFP16-GI-NEXT: mov v0.h[3], v5.h[0]
689 ; CHECK-NOFP16-GI-NEXT: mov h2, v1.h[1]
690 ; CHECK-NOFP16-GI-NEXT: mov v0.h[4], v1.h[0]
691 ; CHECK-NOFP16-GI-NEXT: mov h1, v1.h[2]
692 ; CHECK-NOFP16-GI-NEXT: mov v0.h[5], v2.h[0]
693 ; CHECK-NOFP16-GI-NEXT: mov v0.h[6], v1.h[0]
694 ; CHECK-NOFP16-GI-NEXT: ret
696 ; CHECK-FP16-GI-LABEL: min_v7f16:
697 ; CHECK-FP16-GI: // %bb.0: // %entry
698 ; CHECK-FP16-GI-NEXT: fmin v0.8h, v0.8h, v1.8h
699 ; CHECK-FP16-GI-NEXT: ret
701 %c = call <7 x half> @llvm.minimum.v7f16(<7 x half> %a, <7 x half> %b)
705 define <7 x half> @max_v7f16(<7 x half> %a, <7 x half> %b) {
706 ; CHECK-NOFP16-SD-LABEL: max_v7f16:
707 ; CHECK-NOFP16-SD: // %bb.0: // %entry
708 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
709 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
710 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
711 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
712 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
713 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
714 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
715 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
716 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
717 ; CHECK-NOFP16-SD-NEXT: fmax s4, s5, s4
718 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
719 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
720 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
721 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
722 ; CHECK-NOFP16-SD-NEXT: fmax s3, s3, s2
723 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
724 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
725 ; CHECK-NOFP16-SD-NEXT: fmax s4, s7, s6
726 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
727 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
728 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
729 ; CHECK-NOFP16-SD-NEXT: fmax s5, s5, s16
730 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
731 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
732 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
733 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
734 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
735 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
736 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
737 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
738 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
739 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
740 ; CHECK-NOFP16-SD-NEXT: fmax s3, s6, s3
741 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
742 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
743 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
744 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
745 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
746 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
747 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
748 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
749 ; CHECK-NOFP16-SD-NEXT: fmax s6, s16, s7
750 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
751 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
752 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
753 ; CHECK-NOFP16-SD-NEXT: fmax s4, s5, s4
754 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
755 ; CHECK-NOFP16-SD-NEXT: fmax s0, s0, s1
756 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
757 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
758 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
759 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
760 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
761 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
762 ; CHECK-NOFP16-SD-NEXT: ret
764 ; CHECK-FP16-SD-LABEL: max_v7f16:
765 ; CHECK-FP16-SD: // %bb.0: // %entry
766 ; CHECK-FP16-SD-NEXT: fmax v0.8h, v0.8h, v1.8h
767 ; CHECK-FP16-SD-NEXT: ret
769 ; CHECK-NOFP16-GI-LABEL: max_v7f16:
770 ; CHECK-NOFP16-GI: // %bb.0: // %entry
771 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
772 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
773 ; CHECK-NOFP16-GI-NEXT: mov h4, v0.h[4]
774 ; CHECK-NOFP16-GI-NEXT: mov h5, v0.h[5]
775 ; CHECK-NOFP16-GI-NEXT: mov h6, v1.h[4]
776 ; CHECK-NOFP16-GI-NEXT: mov h7, v1.h[5]
777 ; CHECK-NOFP16-GI-NEXT: mov h1, v1.h[6]
778 ; CHECK-NOFP16-GI-NEXT: fmax v2.4s, v2.4s, v3.4s
779 ; CHECK-NOFP16-GI-NEXT: mov h3, v0.h[6]
780 ; CHECK-NOFP16-GI-NEXT: mov v4.h[1], v5.h[0]
781 ; CHECK-NOFP16-GI-NEXT: mov v6.h[1], v7.h[0]
782 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
783 ; CHECK-NOFP16-GI-NEXT: mov v4.h[2], v3.h[0]
784 ; CHECK-NOFP16-GI-NEXT: mov v6.h[2], v1.h[0]
785 ; CHECK-NOFP16-GI-NEXT: mov h1, v0.h[1]
786 ; CHECK-NOFP16-GI-NEXT: mov h5, v0.h[3]
787 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v4.4h
788 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v6.4h
789 ; CHECK-NOFP16-GI-NEXT: mov h4, v0.h[2]
790 ; CHECK-NOFP16-GI-NEXT: mov v0.h[1], v1.h[0]
791 ; CHECK-NOFP16-GI-NEXT: fmax v1.4s, v2.4s, v3.4s
792 ; CHECK-NOFP16-GI-NEXT: mov v0.h[2], v4.h[0]
793 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v1.4s
794 ; CHECK-NOFP16-GI-NEXT: mov v0.h[3], v5.h[0]
795 ; CHECK-NOFP16-GI-NEXT: mov h2, v1.h[1]
796 ; CHECK-NOFP16-GI-NEXT: mov v0.h[4], v1.h[0]
797 ; CHECK-NOFP16-GI-NEXT: mov h1, v1.h[2]
798 ; CHECK-NOFP16-GI-NEXT: mov v0.h[5], v2.h[0]
799 ; CHECK-NOFP16-GI-NEXT: mov v0.h[6], v1.h[0]
800 ; CHECK-NOFP16-GI-NEXT: ret
802 ; CHECK-FP16-GI-LABEL: max_v7f16:
803 ; CHECK-FP16-GI: // %bb.0: // %entry
804 ; CHECK-FP16-GI-NEXT: fmax v0.8h, v0.8h, v1.8h
805 ; CHECK-FP16-GI-NEXT: ret
807 %c = call <7 x half> @llvm.maximum.v7f16(<7 x half> %a, <7 x half> %b)
811 define <8 x half> @min_v8f16(<8 x half> %a, <8 x half> %b) {
812 ; CHECK-NOFP16-SD-LABEL: min_v8f16:
813 ; CHECK-NOFP16-SD: // %bb.0: // %entry
814 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
815 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
816 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
817 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
818 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
819 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
820 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
821 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
822 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
823 ; CHECK-NOFP16-SD-NEXT: fmin s4, s5, s4
824 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
825 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
826 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
827 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
828 ; CHECK-NOFP16-SD-NEXT: fmin s3, s3, s2
829 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
830 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
831 ; CHECK-NOFP16-SD-NEXT: fmin s4, s7, s6
832 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
833 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
834 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
835 ; CHECK-NOFP16-SD-NEXT: fmin s5, s5, s16
836 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
837 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
838 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
839 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
840 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
841 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
842 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
843 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
844 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
845 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
846 ; CHECK-NOFP16-SD-NEXT: fmin s3, s6, s3
847 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
848 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
849 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
850 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
851 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
852 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
853 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
854 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
855 ; CHECK-NOFP16-SD-NEXT: fmin s6, s16, s7
856 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
857 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
858 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
859 ; CHECK-NOFP16-SD-NEXT: fmin s4, s5, s4
860 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
861 ; CHECK-NOFP16-SD-NEXT: fmin s0, s0, s1
862 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
863 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
864 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
865 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
866 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
867 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
868 ; CHECK-NOFP16-SD-NEXT: ret
870 ; CHECK-FP16-SD-LABEL: min_v8f16:
871 ; CHECK-FP16-SD: // %bb.0: // %entry
872 ; CHECK-FP16-SD-NEXT: fmin v0.8h, v0.8h, v1.8h
873 ; CHECK-FP16-SD-NEXT: ret
875 ; CHECK-NOFP16-GI-LABEL: min_v8f16:
876 ; CHECK-NOFP16-GI: // %bb.0: // %entry
877 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
878 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
879 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
880 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
881 ; CHECK-NOFP16-GI-NEXT: fmin v2.4s, v2.4s, v3.4s
882 ; CHECK-NOFP16-GI-NEXT: fmin v1.4s, v0.4s, v1.4s
883 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
884 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v1.4s
885 ; CHECK-NOFP16-GI-NEXT: ret
887 ; CHECK-FP16-GI-LABEL: min_v8f16:
888 ; CHECK-FP16-GI: // %bb.0: // %entry
889 ; CHECK-FP16-GI-NEXT: fmin v0.8h, v0.8h, v1.8h
890 ; CHECK-FP16-GI-NEXT: ret
892 %c = call <8 x half> @llvm.minimum.v8f16(<8 x half> %a, <8 x half> %b)
896 define <8 x half> @max_v8f16(<8 x half> %a, <8 x half> %b) {
897 ; CHECK-NOFP16-SD-LABEL: max_v8f16:
898 ; CHECK-NOFP16-SD: // %bb.0: // %entry
899 ; CHECK-NOFP16-SD-NEXT: mov h2, v1.h[1]
900 ; CHECK-NOFP16-SD-NEXT: mov h3, v0.h[1]
901 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h1
902 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
903 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[2]
904 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[2]
905 ; CHECK-NOFP16-SD-NEXT: mov h16, v1.h[3]
906 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
907 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
908 ; CHECK-NOFP16-SD-NEXT: fmax s4, s5, s4
909 ; CHECK-NOFP16-SD-NEXT: mov h5, v0.h[3]
910 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
911 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
912 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
913 ; CHECK-NOFP16-SD-NEXT: fmax s3, s3, s2
914 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h5
915 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s4
916 ; CHECK-NOFP16-SD-NEXT: fmax s4, s7, s6
917 ; CHECK-NOFP16-SD-NEXT: mov h6, v1.h[4]
918 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[4]
919 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
920 ; CHECK-NOFP16-SD-NEXT: fmax s5, s5, s16
921 ; CHECK-NOFP16-SD-NEXT: mov h16, v0.h[5]
922 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
923 ; CHECK-NOFP16-SD-NEXT: mov v2.h[1], v3.h[0]
924 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h6
925 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h7
926 ; CHECK-NOFP16-SD-NEXT: mov h7, v1.h[5]
927 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s5
928 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h16
929 ; CHECK-NOFP16-SD-NEXT: mov v2.h[2], v4.h[0]
930 ; CHECK-NOFP16-SD-NEXT: mov h4, v1.h[6]
931 ; CHECK-NOFP16-SD-NEXT: fmax s3, s6, s3
932 ; CHECK-NOFP16-SD-NEXT: mov h6, v0.h[6]
933 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
934 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
935 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
936 ; CHECK-NOFP16-SD-NEXT: mov v2.h[3], v5.h[0]
937 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h4
938 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s3
939 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h6
940 ; CHECK-NOFP16-SD-NEXT: fmax s6, s16, s7
941 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
942 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
943 ; CHECK-NOFP16-SD-NEXT: mov v2.h[4], v3.h[0]
944 ; CHECK-NOFP16-SD-NEXT: fmax s4, s5, s4
945 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s6
946 ; CHECK-NOFP16-SD-NEXT: fmax s0, s0, s1
947 ; CHECK-NOFP16-SD-NEXT: mov v2.h[5], v3.h[0]
948 ; CHECK-NOFP16-SD-NEXT: fcvt h3, s4
949 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
950 ; CHECK-NOFP16-SD-NEXT: mov v2.h[6], v3.h[0]
951 ; CHECK-NOFP16-SD-NEXT: mov v2.h[7], v0.h[0]
952 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v2.16b
953 ; CHECK-NOFP16-SD-NEXT: ret
955 ; CHECK-FP16-SD-LABEL: max_v8f16:
956 ; CHECK-FP16-SD: // %bb.0: // %entry
957 ; CHECK-FP16-SD-NEXT: fmax v0.8h, v0.8h, v1.8h
958 ; CHECK-FP16-SD-NEXT: ret
960 ; CHECK-NOFP16-GI-LABEL: max_v8f16:
961 ; CHECK-NOFP16-GI: // %bb.0: // %entry
962 ; CHECK-NOFP16-GI-NEXT: fcvtl v2.4s, v0.4h
963 ; CHECK-NOFP16-GI-NEXT: fcvtl v3.4s, v1.4h
964 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
965 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
966 ; CHECK-NOFP16-GI-NEXT: fmax v2.4s, v2.4s, v3.4s
967 ; CHECK-NOFP16-GI-NEXT: fmax v1.4s, v0.4s, v1.4s
968 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v2.4s
969 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v1.4s
970 ; CHECK-NOFP16-GI-NEXT: ret
972 ; CHECK-FP16-GI-LABEL: max_v8f16:
973 ; CHECK-FP16-GI: // %bb.0: // %entry
974 ; CHECK-FP16-GI-NEXT: fmax v0.8h, v0.8h, v1.8h
975 ; CHECK-FP16-GI-NEXT: ret
977 %c = call <8 x half> @llvm.maximum.v8f16(<8 x half> %a, <8 x half> %b)
981 define <16 x half> @min_v16f16(<16 x half> %a, <16 x half> %b) {
982 ; CHECK-NOFP16-SD-LABEL: min_v16f16:
983 ; CHECK-NOFP16-SD: // %bb.0: // %entry
984 ; CHECK-NOFP16-SD-NEXT: mov h6, v2.h[1]
985 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[1]
986 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h2
987 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
988 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[1]
989 ; CHECK-NOFP16-SD-NEXT: mov h17, v1.h[1]
990 ; CHECK-NOFP16-SD-NEXT: mov h18, v2.h[2]
991 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[2]
992 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h3
993 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h1
994 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[2]
995 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[2]
996 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
997 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
998 ; CHECK-NOFP16-SD-NEXT: mov h24, v0.h[6]
999 ; CHECK-NOFP16-SD-NEXT: fmin s4, s5, s4
1000 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h16
1001 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h17
1002 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h18
1003 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1004 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[3]
1005 ; CHECK-NOFP16-SD-NEXT: fmin s20, s21, s20
1006 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1007 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[3]
1008 ; CHECK-NOFP16-SD-NEXT: fmin s6, s7, s6
1009 ; CHECK-NOFP16-SD-NEXT: mov h7, v2.h[3]
1010 ; CHECK-NOFP16-SD-NEXT: mov h25, v1.h[6]
1011 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
1012 ; CHECK-NOFP16-SD-NEXT: fmin s5, s16, s5
1013 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1014 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[3]
1015 ; CHECK-NOFP16-SD-NEXT: fmin s17, s18, s17
1016 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1017 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1018 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1019 ; CHECK-NOFP16-SD-NEXT: fcvt h19, s5
1020 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s20
1021 ; CHECK-NOFP16-SD-NEXT: fmin s16, s16, s21
1022 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1023 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1024 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[4]
1025 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[4]
1026 ; CHECK-NOFP16-SD-NEXT: mov v4.h[1], v6.h[0]
1027 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h22
1028 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[4]
1029 ; CHECK-NOFP16-SD-NEXT: fmin s7, s18, s7
1030 ; CHECK-NOFP16-SD-NEXT: mov h18, v3.h[4]
1031 ; CHECK-NOFP16-SD-NEXT: mov v5.h[1], v19.h[0]
1032 ; CHECK-NOFP16-SD-NEXT: fcvt h16, s16
1033 ; CHECK-NOFP16-SD-NEXT: fmin s6, s20, s6
1034 ; CHECK-NOFP16-SD-NEXT: mov v4.h[2], v17.h[0]
1035 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h21
1036 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h22
1037 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1038 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h18
1039 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1040 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[5]
1041 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[5]
1042 ; CHECK-NOFP16-SD-NEXT: mov v5.h[2], v16.h[0]
1043 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[5]
1044 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[5]
1045 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1046 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
1047 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
1048 ; CHECK-NOFP16-SD-NEXT: fmin s17, s19, s17
1049 ; CHECK-NOFP16-SD-NEXT: mov h19, v2.h[6]
1050 ; CHECK-NOFP16-SD-NEXT: mov v4.h[3], v7.h[0]
1051 ; CHECK-NOFP16-SD-NEXT: fmin s18, s20, s18
1052 ; CHECK-NOFP16-SD-NEXT: mov h20, v3.h[6]
1053 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h21
1054 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1055 ; CHECK-NOFP16-SD-NEXT: fcvt s22, h24
1056 ; CHECK-NOFP16-SD-NEXT: mov h2, v2.h[7]
1057 ; CHECK-NOFP16-SD-NEXT: mov v5.h[3], v6.h[0]
1058 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h16
1059 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1060 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1061 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h19
1062 ; CHECK-NOFP16-SD-NEXT: fcvt s23, h25
1063 ; CHECK-NOFP16-SD-NEXT: fcvt h18, s18
1064 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h20
1065 ; CHECK-NOFP16-SD-NEXT: mov h3, v3.h[7]
1066 ; CHECK-NOFP16-SD-NEXT: fmin s7, s21, s7
1067 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
1068 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
1069 ; CHECK-NOFP16-SD-NEXT: fmin s6, s16, s6
1070 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
1071 ; CHECK-NOFP16-SD-NEXT: mov v4.h[4], v17.h[0]
1072 ; CHECK-NOFP16-SD-NEXT: fmin s16, s22, s19
1073 ; CHECK-NOFP16-SD-NEXT: mov v5.h[4], v18.h[0]
1074 ; CHECK-NOFP16-SD-NEXT: fmin s17, s23, s20
1075 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
1076 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1077 ; CHECK-NOFP16-SD-NEXT: fmin s0, s0, s2
1078 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1079 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s16
1080 ; CHECK-NOFP16-SD-NEXT: fmin s1, s1, s3
1081 ; CHECK-NOFP16-SD-NEXT: mov v4.h[5], v7.h[0]
1082 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
1083 ; CHECK-NOFP16-SD-NEXT: mov v5.h[5], v6.h[0]
1084 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s17
1085 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
1086 ; CHECK-NOFP16-SD-NEXT: mov v4.h[6], v2.h[0]
1087 ; CHECK-NOFP16-SD-NEXT: mov v5.h[6], v6.h[0]
1088 ; CHECK-NOFP16-SD-NEXT: mov v4.h[7], v0.h[0]
1089 ; CHECK-NOFP16-SD-NEXT: mov v5.h[7], v1.h[0]
1090 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v4.16b
1091 ; CHECK-NOFP16-SD-NEXT: mov v1.16b, v5.16b
1092 ; CHECK-NOFP16-SD-NEXT: ret
1094 ; CHECK-FP16-SD-LABEL: min_v16f16:
1095 ; CHECK-FP16-SD: // %bb.0: // %entry
1096 ; CHECK-FP16-SD-NEXT: fmin v1.8h, v1.8h, v3.8h
1097 ; CHECK-FP16-SD-NEXT: fmin v0.8h, v0.8h, v2.8h
1098 ; CHECK-FP16-SD-NEXT: ret
1100 ; CHECK-NOFP16-GI-LABEL: min_v16f16:
1101 ; CHECK-NOFP16-GI: // %bb.0: // %entry
1102 ; CHECK-NOFP16-GI-NEXT: fcvtl v4.4s, v0.4h
1103 ; CHECK-NOFP16-GI-NEXT: fcvtl v5.4s, v1.4h
1104 ; CHECK-NOFP16-GI-NEXT: fcvtl v6.4s, v2.4h
1105 ; CHECK-NOFP16-GI-NEXT: fcvtl v7.4s, v3.4h
1106 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
1107 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
1108 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v2.4s, v2.8h
1109 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v3.4s, v3.8h
1110 ; CHECK-NOFP16-GI-NEXT: fmin v4.4s, v4.4s, v6.4s
1111 ; CHECK-NOFP16-GI-NEXT: fmin v5.4s, v5.4s, v7.4s
1112 ; CHECK-NOFP16-GI-NEXT: fmin v2.4s, v0.4s, v2.4s
1113 ; CHECK-NOFP16-GI-NEXT: fmin v3.4s, v1.4s, v3.4s
1114 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v4.4s
1115 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v5.4s
1116 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v2.4s
1117 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v1.8h, v3.4s
1118 ; CHECK-NOFP16-GI-NEXT: ret
1120 ; CHECK-FP16-GI-LABEL: min_v16f16:
1121 ; CHECK-FP16-GI: // %bb.0: // %entry
1122 ; CHECK-FP16-GI-NEXT: fmin v0.8h, v0.8h, v2.8h
1123 ; CHECK-FP16-GI-NEXT: fmin v1.8h, v1.8h, v3.8h
1124 ; CHECK-FP16-GI-NEXT: ret
1126 %c = call <16 x half> @llvm.minimum.v16f16(<16 x half> %a, <16 x half> %b)
1130 define <16 x half> @max_v16f16(<16 x half> %a, <16 x half> %b) {
1131 ; CHECK-NOFP16-SD-LABEL: max_v16f16:
1132 ; CHECK-NOFP16-SD: // %bb.0: // %entry
1133 ; CHECK-NOFP16-SD-NEXT: mov h6, v2.h[1]
1134 ; CHECK-NOFP16-SD-NEXT: mov h7, v0.h[1]
1135 ; CHECK-NOFP16-SD-NEXT: fcvt s4, h2
1136 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h0
1137 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[1]
1138 ; CHECK-NOFP16-SD-NEXT: mov h17, v1.h[1]
1139 ; CHECK-NOFP16-SD-NEXT: mov h18, v2.h[2]
1140 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[2]
1141 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h3
1142 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h1
1143 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[2]
1144 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[2]
1145 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h6
1146 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1147 ; CHECK-NOFP16-SD-NEXT: mov h24, v0.h[6]
1148 ; CHECK-NOFP16-SD-NEXT: fmax s4, s5, s4
1149 ; CHECK-NOFP16-SD-NEXT: fcvt s5, h16
1150 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h17
1151 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h18
1152 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1153 ; CHECK-NOFP16-SD-NEXT: mov h19, v0.h[3]
1154 ; CHECK-NOFP16-SD-NEXT: fmax s20, s21, s20
1155 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1156 ; CHECK-NOFP16-SD-NEXT: mov h22, v3.h[3]
1157 ; CHECK-NOFP16-SD-NEXT: fmax s6, s7, s6
1158 ; CHECK-NOFP16-SD-NEXT: mov h7, v2.h[3]
1159 ; CHECK-NOFP16-SD-NEXT: mov h25, v1.h[6]
1160 ; CHECK-NOFP16-SD-NEXT: fcvt h4, s4
1161 ; CHECK-NOFP16-SD-NEXT: fmax s5, s16, s5
1162 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1163 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[3]
1164 ; CHECK-NOFP16-SD-NEXT: fmax s17, s18, s17
1165 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h19
1166 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1167 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h7
1168 ; CHECK-NOFP16-SD-NEXT: fcvt h19, s5
1169 ; CHECK-NOFP16-SD-NEXT: fcvt h5, s20
1170 ; CHECK-NOFP16-SD-NEXT: fmax s16, s16, s21
1171 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1172 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1173 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[4]
1174 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[4]
1175 ; CHECK-NOFP16-SD-NEXT: mov v4.h[1], v6.h[0]
1176 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h22
1177 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[4]
1178 ; CHECK-NOFP16-SD-NEXT: fmax s7, s18, s7
1179 ; CHECK-NOFP16-SD-NEXT: mov h18, v3.h[4]
1180 ; CHECK-NOFP16-SD-NEXT: mov v5.h[1], v19.h[0]
1181 ; CHECK-NOFP16-SD-NEXT: fcvt h16, s16
1182 ; CHECK-NOFP16-SD-NEXT: fmax s6, s20, s6
1183 ; CHECK-NOFP16-SD-NEXT: mov v4.h[2], v17.h[0]
1184 ; CHECK-NOFP16-SD-NEXT: fcvt s17, h21
1185 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h22
1186 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1187 ; CHECK-NOFP16-SD-NEXT: fcvt s18, h18
1188 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h23
1189 ; CHECK-NOFP16-SD-NEXT: mov h21, v2.h[5]
1190 ; CHECK-NOFP16-SD-NEXT: mov h22, v0.h[5]
1191 ; CHECK-NOFP16-SD-NEXT: mov v5.h[2], v16.h[0]
1192 ; CHECK-NOFP16-SD-NEXT: mov h16, v3.h[5]
1193 ; CHECK-NOFP16-SD-NEXT: mov h23, v1.h[5]
1194 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1195 ; CHECK-NOFP16-SD-NEXT: mov h0, v0.h[7]
1196 ; CHECK-NOFP16-SD-NEXT: mov h1, v1.h[7]
1197 ; CHECK-NOFP16-SD-NEXT: fmax s17, s19, s17
1198 ; CHECK-NOFP16-SD-NEXT: mov h19, v2.h[6]
1199 ; CHECK-NOFP16-SD-NEXT: mov v4.h[3], v7.h[0]
1200 ; CHECK-NOFP16-SD-NEXT: fmax s18, s20, s18
1201 ; CHECK-NOFP16-SD-NEXT: mov h20, v3.h[6]
1202 ; CHECK-NOFP16-SD-NEXT: fcvt s7, h21
1203 ; CHECK-NOFP16-SD-NEXT: fcvt s21, h22
1204 ; CHECK-NOFP16-SD-NEXT: fcvt s22, h24
1205 ; CHECK-NOFP16-SD-NEXT: mov h2, v2.h[7]
1206 ; CHECK-NOFP16-SD-NEXT: mov v5.h[3], v6.h[0]
1207 ; CHECK-NOFP16-SD-NEXT: fcvt s6, h16
1208 ; CHECK-NOFP16-SD-NEXT: fcvt s16, h23
1209 ; CHECK-NOFP16-SD-NEXT: fcvt h17, s17
1210 ; CHECK-NOFP16-SD-NEXT: fcvt s19, h19
1211 ; CHECK-NOFP16-SD-NEXT: fcvt s23, h25
1212 ; CHECK-NOFP16-SD-NEXT: fcvt h18, s18
1213 ; CHECK-NOFP16-SD-NEXT: fcvt s20, h20
1214 ; CHECK-NOFP16-SD-NEXT: mov h3, v3.h[7]
1215 ; CHECK-NOFP16-SD-NEXT: fmax s7, s21, s7
1216 ; CHECK-NOFP16-SD-NEXT: fcvt s2, h2
1217 ; CHECK-NOFP16-SD-NEXT: fcvt s0, h0
1218 ; CHECK-NOFP16-SD-NEXT: fmax s6, s16, s6
1219 ; CHECK-NOFP16-SD-NEXT: fcvt s1, h1
1220 ; CHECK-NOFP16-SD-NEXT: mov v4.h[4], v17.h[0]
1221 ; CHECK-NOFP16-SD-NEXT: fmax s16, s22, s19
1222 ; CHECK-NOFP16-SD-NEXT: mov v5.h[4], v18.h[0]
1223 ; CHECK-NOFP16-SD-NEXT: fmax s17, s23, s20
1224 ; CHECK-NOFP16-SD-NEXT: fcvt s3, h3
1225 ; CHECK-NOFP16-SD-NEXT: fcvt h7, s7
1226 ; CHECK-NOFP16-SD-NEXT: fmax s0, s0, s2
1227 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s6
1228 ; CHECK-NOFP16-SD-NEXT: fcvt h2, s16
1229 ; CHECK-NOFP16-SD-NEXT: fmax s1, s1, s3
1230 ; CHECK-NOFP16-SD-NEXT: mov v4.h[5], v7.h[0]
1231 ; CHECK-NOFP16-SD-NEXT: fcvt h0, s0
1232 ; CHECK-NOFP16-SD-NEXT: mov v5.h[5], v6.h[0]
1233 ; CHECK-NOFP16-SD-NEXT: fcvt h6, s17
1234 ; CHECK-NOFP16-SD-NEXT: fcvt h1, s1
1235 ; CHECK-NOFP16-SD-NEXT: mov v4.h[6], v2.h[0]
1236 ; CHECK-NOFP16-SD-NEXT: mov v5.h[6], v6.h[0]
1237 ; CHECK-NOFP16-SD-NEXT: mov v4.h[7], v0.h[0]
1238 ; CHECK-NOFP16-SD-NEXT: mov v5.h[7], v1.h[0]
1239 ; CHECK-NOFP16-SD-NEXT: mov v0.16b, v4.16b
1240 ; CHECK-NOFP16-SD-NEXT: mov v1.16b, v5.16b
1241 ; CHECK-NOFP16-SD-NEXT: ret
1243 ; CHECK-FP16-SD-LABEL: max_v16f16:
1244 ; CHECK-FP16-SD: // %bb.0: // %entry
1245 ; CHECK-FP16-SD-NEXT: fmax v1.8h, v1.8h, v3.8h
1246 ; CHECK-FP16-SD-NEXT: fmax v0.8h, v0.8h, v2.8h
1247 ; CHECK-FP16-SD-NEXT: ret
1249 ; CHECK-NOFP16-GI-LABEL: max_v16f16:
1250 ; CHECK-NOFP16-GI: // %bb.0: // %entry
1251 ; CHECK-NOFP16-GI-NEXT: fcvtl v4.4s, v0.4h
1252 ; CHECK-NOFP16-GI-NEXT: fcvtl v5.4s, v1.4h
1253 ; CHECK-NOFP16-GI-NEXT: fcvtl v6.4s, v2.4h
1254 ; CHECK-NOFP16-GI-NEXT: fcvtl v7.4s, v3.4h
1255 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v0.4s, v0.8h
1256 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v1.4s, v1.8h
1257 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v2.4s, v2.8h
1258 ; CHECK-NOFP16-GI-NEXT: fcvtl2 v3.4s, v3.8h
1259 ; CHECK-NOFP16-GI-NEXT: fmax v4.4s, v4.4s, v6.4s
1260 ; CHECK-NOFP16-GI-NEXT: fmax v5.4s, v5.4s, v7.4s
1261 ; CHECK-NOFP16-GI-NEXT: fmax v2.4s, v0.4s, v2.4s
1262 ; CHECK-NOFP16-GI-NEXT: fmax v3.4s, v1.4s, v3.4s
1263 ; CHECK-NOFP16-GI-NEXT: fcvtn v0.4h, v4.4s
1264 ; CHECK-NOFP16-GI-NEXT: fcvtn v1.4h, v5.4s
1265 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v0.8h, v2.4s
1266 ; CHECK-NOFP16-GI-NEXT: fcvtn2 v1.8h, v3.4s
1267 ; CHECK-NOFP16-GI-NEXT: ret
1269 ; CHECK-FP16-GI-LABEL: max_v16f16:
1270 ; CHECK-FP16-GI: // %bb.0: // %entry
1271 ; CHECK-FP16-GI-NEXT: fmax v0.8h, v0.8h, v2.8h
1272 ; CHECK-FP16-GI-NEXT: fmax v1.8h, v1.8h, v3.8h
1273 ; CHECK-FP16-GI-NEXT: ret
1275 %c = call <16 x half> @llvm.maximum.v16f16(<16 x half> %a, <16 x half> %b)
1279 declare <16 x half> @llvm.maximum.v16f16(<16 x half>, <16 x half>)
1280 declare <16 x half> @llvm.minimum.v16f16(<16 x half>, <16 x half>)
1281 declare <2 x double> @llvm.maximum.v2f64(<2 x double>, <2 x double>)
1282 declare <2 x double> @llvm.minimum.v2f64(<2 x double>, <2 x double>)
1283 declare <2 x float> @llvm.maximum.v2f32(<2 x float>, <2 x float>)
1284 declare <2 x float> @llvm.minimum.v2f32(<2 x float>, <2 x float>)
1285 declare <3 x double> @llvm.maximum.v3f64(<3 x double>, <3 x double>)
1286 declare <3 x double> @llvm.minimum.v3f64(<3 x double>, <3 x double>)
1287 declare <3 x float> @llvm.maximum.v3f32(<3 x float>, <3 x float>)
1288 declare <3 x float> @llvm.minimum.v3f32(<3 x float>, <3 x float>)
1289 declare <4 x double> @llvm.maximum.v4f64(<4 x double>, <4 x double>)
1290 declare <4 x double> @llvm.minimum.v4f64(<4 x double>, <4 x double>)
1291 declare <4 x float> @llvm.maximum.v4f32(<4 x float>, <4 x float>)
1292 declare <4 x float> @llvm.minimum.v4f32(<4 x float>, <4 x float>)
1293 declare <4 x half> @llvm.maximum.v4f16(<4 x half>, <4 x half>)
1294 declare <4 x half> @llvm.minimum.v4f16(<4 x half>, <4 x half>)
1295 declare <7 x float> @llvm.maximum.v7f32(<7 x float>, <7 x float>)
1296 declare <7 x float> @llvm.minimum.v7f32(<7 x float>, <7 x float>)
1297 declare <7 x half> @llvm.maximum.v7f16(<7 x half>, <7 x half>)
1298 declare <7 x half> @llvm.minimum.v7f16(<7 x half>, <7 x half>)
1299 declare <8 x float> @llvm.maximum.v8f32(<8 x float>, <8 x float>)
1300 declare <8 x float> @llvm.minimum.v8f32(<8 x float>, <8 x float>)
1301 declare <8 x half> @llvm.maximum.v8f16(<8 x half>, <8 x half>)
1302 declare <8 x half> @llvm.minimum.v8f16(<8 x half>, <8 x half>)
1303 declare double @llvm.maximum.f64(double, double)
1304 declare double @llvm.minimum.f64(double, double)
1305 declare float @llvm.maximum.f32(float, float)
1306 declare float @llvm.minimum.f32(float, float)
1307 declare half @llvm.maximum.f16(half, half)
1308 declare half @llvm.minimum.f16(half, half)