1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=aarch64-unknown-unknown | FileCheck %s
4 ; There are 4 commuted variants (abbc/abcb/bcab/bcba) *
5 ; 4 predicate variants ([*][lg][te]) *
6 ; 4 min/max flavors (smin/smax/umin/umax) *
10 define <4 x i32> @smin_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
11 ; CHECK-LABEL: smin_ab_bc:
13 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
14 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
15 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
17 %cmp_ab = icmp slt <4 x i32> %a, %b
18 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
19 %cmp_bc = icmp slt <4 x i32> %b, %c
20 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
21 %cmp_ac = icmp slt <4 x i32> %a, %c
22 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
26 define <4 x i32> @smin_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
27 ; CHECK-LABEL: smin_ab_cb:
29 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
30 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
31 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
33 %cmp_ab = icmp slt <4 x i32> %a, %b
34 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
35 %cmp_cb = icmp slt <4 x i32> %c, %b
36 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
37 %cmp_ac = icmp slt <4 x i32> %a, %c
38 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
42 define <4 x i32> @smin_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
43 ; CHECK-LABEL: smin_bc_ab:
45 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
46 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
47 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
49 %cmp_bc = icmp slt <4 x i32> %b, %c
50 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
51 %cmp_ab = icmp slt <4 x i32> %a, %b
52 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
53 %cmp_ca = icmp slt <4 x i32> %c, %a
54 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
58 define <4 x i32> @smin_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
59 ; CHECK-LABEL: smin_bc_ba:
61 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
62 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
63 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
65 %cmp_bc = icmp slt <4 x i32> %b, %c
66 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
67 %cmp_ba = icmp slt <4 x i32> %b, %a
68 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
69 %cmp_ca = icmp slt <4 x i32> %c, %a
70 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
74 define <4 x i32> @smin_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
75 ; CHECK-LABEL: smin_ab_bc_swap_pred:
77 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
78 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
79 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
81 %cmp_ab = icmp slt <4 x i32> %a, %b
82 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
83 %cmp_bc = icmp slt <4 x i32> %b, %c
84 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
85 %cmp_ac = icmp sgt <4 x i32> %c, %a
86 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
90 define <4 x i32> @smin_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
91 ; CHECK-LABEL: smin_ab_cb_swap_pred:
93 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
94 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
95 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
97 %cmp_ab = icmp slt <4 x i32> %a, %b
98 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
99 %cmp_cb = icmp slt <4 x i32> %c, %b
100 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
101 %cmp_ac = icmp sgt <4 x i32> %c, %a
102 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
106 define <4 x i32> @smin_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
107 ; CHECK-LABEL: smin_bc_ab_swap_pred:
109 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
110 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
111 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
113 %cmp_bc = icmp slt <4 x i32> %b, %c
114 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
115 %cmp_ab = icmp slt <4 x i32> %a, %b
116 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
117 %cmp_ca = icmp sgt <4 x i32> %a, %c
118 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
122 define <4 x i32> @smin_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
123 ; CHECK-LABEL: smin_bc_ba_swap_pred:
125 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
126 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
127 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
129 %cmp_bc = icmp slt <4 x i32> %b, %c
130 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
131 %cmp_ba = icmp slt <4 x i32> %b, %a
132 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
133 %cmp_ca = icmp sgt <4 x i32> %a, %c
134 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
138 define <4 x i32> @smin_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
139 ; CHECK-LABEL: smin_ab_bc_eq_pred:
141 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
142 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
143 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
145 %cmp_ab = icmp slt <4 x i32> %a, %b
146 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
147 %cmp_bc = icmp slt <4 x i32> %b, %c
148 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
149 %cmp_ac = icmp sle <4 x i32> %a, %c
150 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
154 define <4 x i32> @smin_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
155 ; CHECK-LABEL: smin_ab_cb_eq_pred:
157 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
158 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
159 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
161 %cmp_ab = icmp slt <4 x i32> %a, %b
162 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
163 %cmp_cb = icmp slt <4 x i32> %c, %b
164 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
165 %cmp_ac = icmp sle <4 x i32> %a, %c
166 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
170 define <4 x i32> @smin_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
171 ; CHECK-LABEL: smin_bc_ab_eq_pred:
173 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
174 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
175 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
177 %cmp_bc = icmp slt <4 x i32> %b, %c
178 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
179 %cmp_ab = icmp slt <4 x i32> %a, %b
180 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
181 %cmp_ca = icmp sle <4 x i32> %c, %a
182 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
186 define <4 x i32> @smin_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
187 ; CHECK-LABEL: smin_bc_ba_eq_pred:
189 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
190 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
191 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
193 %cmp_bc = icmp slt <4 x i32> %b, %c
194 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
195 %cmp_ba = icmp slt <4 x i32> %b, %a
196 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
197 %cmp_ca = icmp sle <4 x i32> %c, %a
198 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
202 define <4 x i32> @smin_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
203 ; CHECK-LABEL: smin_ab_bc_eq_swap_pred:
205 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
206 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
207 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
209 %cmp_ab = icmp slt <4 x i32> %a, %b
210 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
211 %cmp_bc = icmp slt <4 x i32> %b, %c
212 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
213 %cmp_ac = icmp sge <4 x i32> %c, %a
214 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
218 define <4 x i32> @smin_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
219 ; CHECK-LABEL: smin_ab_cb_eq_swap_pred:
221 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
222 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
223 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
225 %cmp_ab = icmp slt <4 x i32> %a, %b
226 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
227 %cmp_cb = icmp slt <4 x i32> %c, %b
228 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
229 %cmp_ac = icmp sge <4 x i32> %c, %a
230 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
234 define <4 x i32> @smin_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
235 ; CHECK-LABEL: smin_bc_ab_eq_swap_pred:
237 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
238 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
239 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
241 %cmp_bc = icmp slt <4 x i32> %b, %c
242 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
243 %cmp_ab = icmp slt <4 x i32> %a, %b
244 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
245 %cmp_ca = icmp sge <4 x i32> %a, %c
246 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
250 define <4 x i32> @smin_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
251 ; CHECK-LABEL: smin_bc_ba_eq_swap_pred:
253 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
254 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
255 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
257 %cmp_bc = icmp slt <4 x i32> %b, %c
258 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
259 %cmp_ba = icmp slt <4 x i32> %b, %a
260 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
261 %cmp_ca = icmp sge <4 x i32> %a, %c
262 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
266 define <4 x i32> @smax_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
267 ; CHECK-LABEL: smax_ab_bc:
269 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
270 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
271 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
273 %cmp_ab = icmp sgt <4 x i32> %a, %b
274 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
275 %cmp_bc = icmp sgt <4 x i32> %b, %c
276 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
277 %cmp_ac = icmp sgt <4 x i32> %a, %c
278 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
282 define <4 x i32> @smax_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
283 ; CHECK-LABEL: smax_ab_cb:
285 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
286 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
287 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
289 %cmp_ab = icmp sgt <4 x i32> %a, %b
290 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
291 %cmp_cb = icmp sgt <4 x i32> %c, %b
292 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
293 %cmp_ac = icmp sgt <4 x i32> %a, %c
294 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
298 define <4 x i32> @smax_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
299 ; CHECK-LABEL: smax_bc_ab:
301 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
302 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
303 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
305 %cmp_bc = icmp sgt <4 x i32> %b, %c
306 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
307 %cmp_ab = icmp sgt <4 x i32> %a, %b
308 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
309 %cmp_ca = icmp sgt <4 x i32> %c, %a
310 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
314 define <4 x i32> @smax_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
315 ; CHECK-LABEL: smax_bc_ba:
317 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
318 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
319 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
321 %cmp_bc = icmp sgt <4 x i32> %b, %c
322 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
323 %cmp_ba = icmp sgt <4 x i32> %b, %a
324 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
325 %cmp_ca = icmp sgt <4 x i32> %c, %a
326 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
330 define <4 x i32> @smax_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
331 ; CHECK-LABEL: smax_ab_bc_swap_pred:
333 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
334 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
335 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
337 %cmp_ab = icmp sgt <4 x i32> %a, %b
338 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
339 %cmp_bc = icmp sgt <4 x i32> %b, %c
340 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
341 %cmp_ac = icmp slt <4 x i32> %c, %a
342 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
346 define <4 x i32> @smax_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
347 ; CHECK-LABEL: smax_ab_cb_swap_pred:
349 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
350 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
351 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
353 %cmp_ab = icmp sgt <4 x i32> %a, %b
354 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
355 %cmp_cb = icmp sgt <4 x i32> %c, %b
356 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
357 %cmp_ac = icmp slt <4 x i32> %c, %a
358 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
362 define <4 x i32> @smax_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
363 ; CHECK-LABEL: smax_bc_ab_swap_pred:
365 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
366 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
367 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
369 %cmp_bc = icmp sgt <4 x i32> %b, %c
370 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
371 %cmp_ab = icmp sgt <4 x i32> %a, %b
372 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
373 %cmp_ca = icmp slt <4 x i32> %a, %c
374 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
378 define <4 x i32> @smax_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
379 ; CHECK-LABEL: smax_bc_ba_swap_pred:
381 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
382 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
383 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
385 %cmp_bc = icmp sgt <4 x i32> %b, %c
386 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
387 %cmp_ba = icmp sgt <4 x i32> %b, %a
388 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
389 %cmp_ca = icmp slt <4 x i32> %a, %c
390 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
394 define <4 x i32> @smax_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
395 ; CHECK-LABEL: smax_ab_bc_eq_pred:
397 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
398 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
399 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
401 %cmp_ab = icmp sgt <4 x i32> %a, %b
402 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
403 %cmp_bc = icmp sgt <4 x i32> %b, %c
404 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
405 %cmp_ac = icmp sge <4 x i32> %a, %c
406 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
410 define <4 x i32> @smax_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
411 ; CHECK-LABEL: smax_ab_cb_eq_pred:
413 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
414 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
415 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
417 %cmp_ab = icmp sgt <4 x i32> %a, %b
418 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
419 %cmp_cb = icmp sgt <4 x i32> %c, %b
420 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
421 %cmp_ac = icmp sge <4 x i32> %a, %c
422 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
426 define <4 x i32> @smax_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
427 ; CHECK-LABEL: smax_bc_ab_eq_pred:
429 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
430 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
431 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
433 %cmp_bc = icmp sgt <4 x i32> %b, %c
434 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
435 %cmp_ab = icmp sgt <4 x i32> %a, %b
436 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
437 %cmp_ca = icmp sge <4 x i32> %c, %a
438 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
442 define <4 x i32> @smax_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
443 ; CHECK-LABEL: smax_bc_ba_eq_pred:
445 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
446 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
447 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
449 %cmp_bc = icmp sgt <4 x i32> %b, %c
450 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
451 %cmp_ba = icmp sgt <4 x i32> %b, %a
452 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
453 %cmp_ca = icmp sge <4 x i32> %c, %a
454 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
458 define <4 x i32> @smax_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
459 ; CHECK-LABEL: smax_ab_bc_eq_swap_pred:
461 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
462 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
463 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
465 %cmp_ab = icmp sgt <4 x i32> %a, %b
466 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
467 %cmp_bc = icmp sgt <4 x i32> %b, %c
468 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
469 %cmp_ac = icmp sle <4 x i32> %c, %a
470 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
474 define <4 x i32> @smax_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
475 ; CHECK-LABEL: smax_ab_cb_eq_swap_pred:
477 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
478 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
479 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
481 %cmp_ab = icmp sgt <4 x i32> %a, %b
482 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
483 %cmp_cb = icmp sgt <4 x i32> %c, %b
484 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
485 %cmp_ac = icmp sle <4 x i32> %c, %a
486 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
490 define <4 x i32> @smax_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
491 ; CHECK-LABEL: smax_bc_ab_eq_swap_pred:
493 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
494 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
495 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
497 %cmp_bc = icmp sgt <4 x i32> %b, %c
498 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
499 %cmp_ab = icmp sgt <4 x i32> %a, %b
500 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
501 %cmp_ca = icmp sle <4 x i32> %a, %c
502 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
506 define <4 x i32> @smax_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
507 ; CHECK-LABEL: smax_bc_ba_eq_swap_pred:
509 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
510 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
511 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
513 %cmp_bc = icmp sgt <4 x i32> %b, %c
514 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
515 %cmp_ba = icmp sgt <4 x i32> %b, %a
516 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
517 %cmp_ca = icmp sle <4 x i32> %a, %c
518 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
522 define <4 x i32> @umin_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
523 ; CHECK-LABEL: umin_ab_bc:
525 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
526 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
527 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
529 %cmp_ab = icmp ult <4 x i32> %a, %b
530 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
531 %cmp_bc = icmp ult <4 x i32> %b, %c
532 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
533 %cmp_ac = icmp ult <4 x i32> %a, %c
534 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
538 define <4 x i32> @umin_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
539 ; CHECK-LABEL: umin_ab_cb:
541 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
542 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
543 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
545 %cmp_ab = icmp ult <4 x i32> %a, %b
546 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
547 %cmp_cb = icmp ult <4 x i32> %c, %b
548 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
549 %cmp_ac = icmp ult <4 x i32> %a, %c
550 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
554 define <4 x i32> @umin_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
555 ; CHECK-LABEL: umin_bc_ab:
557 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
558 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
559 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
561 %cmp_bc = icmp ult <4 x i32> %b, %c
562 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
563 %cmp_ab = icmp ult <4 x i32> %a, %b
564 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
565 %cmp_ca = icmp ult <4 x i32> %c, %a
566 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
570 define <4 x i32> @umin_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
571 ; CHECK-LABEL: umin_bc_ba:
573 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
574 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
575 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
577 %cmp_bc = icmp ult <4 x i32> %b, %c
578 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
579 %cmp_ba = icmp ult <4 x i32> %b, %a
580 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
581 %cmp_ca = icmp ult <4 x i32> %c, %a
582 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
586 define <4 x i32> @umin_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
587 ; CHECK-LABEL: umin_ab_bc_swap_pred:
589 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
590 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
591 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
593 %cmp_ab = icmp ult <4 x i32> %a, %b
594 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
595 %cmp_bc = icmp ult <4 x i32> %b, %c
596 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
597 %cmp_ac = icmp ugt <4 x i32> %c, %a
598 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
602 define <4 x i32> @umin_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
603 ; CHECK-LABEL: umin_ab_cb_swap_pred:
605 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
606 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
607 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
609 %cmp_ab = icmp ult <4 x i32> %a, %b
610 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
611 %cmp_cb = icmp ult <4 x i32> %c, %b
612 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
613 %cmp_ac = icmp ugt <4 x i32> %c, %a
614 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
618 define <4 x i32> @umin_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
619 ; CHECK-LABEL: umin_bc_ab_swap_pred:
621 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
622 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
623 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
625 %cmp_bc = icmp ult <4 x i32> %b, %c
626 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
627 %cmp_ab = icmp ult <4 x i32> %a, %b
628 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
629 %cmp_ca = icmp ugt <4 x i32> %a, %c
630 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
634 define <4 x i32> @umin_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
635 ; CHECK-LABEL: umin_bc_ba_swap_pred:
637 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
638 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
639 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
641 %cmp_bc = icmp ult <4 x i32> %b, %c
642 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
643 %cmp_ba = icmp ult <4 x i32> %b, %a
644 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
645 %cmp_ca = icmp ugt <4 x i32> %a, %c
646 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
650 define <4 x i32> @umin_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
651 ; CHECK-LABEL: umin_ab_bc_eq_pred:
653 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
654 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
655 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
657 %cmp_ab = icmp ult <4 x i32> %a, %b
658 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
659 %cmp_bc = icmp ult <4 x i32> %b, %c
660 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
661 %cmp_ac = icmp ule <4 x i32> %a, %c
662 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
666 define <4 x i32> @umin_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
667 ; CHECK-LABEL: umin_ab_cb_eq_pred:
669 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
670 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
671 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
673 %cmp_ab = icmp ult <4 x i32> %a, %b
674 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
675 %cmp_cb = icmp ult <4 x i32> %c, %b
676 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
677 %cmp_ac = icmp ule <4 x i32> %a, %c
678 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
682 define <4 x i32> @umin_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
683 ; CHECK-LABEL: umin_bc_ab_eq_pred:
685 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
686 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
687 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
689 %cmp_bc = icmp ult <4 x i32> %b, %c
690 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
691 %cmp_ab = icmp ult <4 x i32> %a, %b
692 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
693 %cmp_ca = icmp ule <4 x i32> %c, %a
694 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
698 define <4 x i32> @umin_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
699 ; CHECK-LABEL: umin_bc_ba_eq_pred:
701 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
702 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
703 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
705 %cmp_bc = icmp ult <4 x i32> %b, %c
706 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
707 %cmp_ba = icmp ult <4 x i32> %b, %a
708 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
709 %cmp_ca = icmp ule <4 x i32> %c, %a
710 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
714 define <4 x i32> @umin_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
715 ; CHECK-LABEL: umin_ab_bc_eq_swap_pred:
717 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
718 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
719 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
721 %cmp_ab = icmp ult <4 x i32> %a, %b
722 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
723 %cmp_bc = icmp ult <4 x i32> %b, %c
724 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
725 %cmp_ac = icmp uge <4 x i32> %c, %a
726 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
730 define <4 x i32> @umin_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
731 ; CHECK-LABEL: umin_ab_cb_eq_swap_pred:
733 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
734 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
735 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
737 %cmp_ab = icmp ult <4 x i32> %a, %b
738 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
739 %cmp_cb = icmp ult <4 x i32> %c, %b
740 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
741 %cmp_ac = icmp uge <4 x i32> %c, %a
742 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
746 define <4 x i32> @umin_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
747 ; CHECK-LABEL: umin_bc_ab_eq_swap_pred:
749 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
750 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
751 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
753 %cmp_bc = icmp ult <4 x i32> %b, %c
754 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
755 %cmp_ab = icmp ult <4 x i32> %a, %b
756 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
757 %cmp_ca = icmp uge <4 x i32> %a, %c
758 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
762 define <4 x i32> @umin_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
763 ; CHECK-LABEL: umin_bc_ba_eq_swap_pred:
765 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
766 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
767 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
769 %cmp_bc = icmp ult <4 x i32> %b, %c
770 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
771 %cmp_ba = icmp ult <4 x i32> %b, %a
772 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
773 %cmp_ca = icmp uge <4 x i32> %a, %c
774 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
778 define <4 x i32> @umax_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
779 ; CHECK-LABEL: umax_ab_bc:
781 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
782 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
783 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
785 %cmp_ab = icmp ugt <4 x i32> %a, %b
786 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
787 %cmp_bc = icmp ugt <4 x i32> %b, %c
788 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
789 %cmp_ac = icmp ugt <4 x i32> %a, %c
790 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
794 define <4 x i32> @umax_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
795 ; CHECK-LABEL: umax_ab_cb:
797 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
798 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
799 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
801 %cmp_ab = icmp ugt <4 x i32> %a, %b
802 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
803 %cmp_cb = icmp ugt <4 x i32> %c, %b
804 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
805 %cmp_ac = icmp ugt <4 x i32> %a, %c
806 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
810 define <4 x i32> @umax_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
811 ; CHECK-LABEL: umax_bc_ab:
813 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
814 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
815 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
817 %cmp_bc = icmp ugt <4 x i32> %b, %c
818 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
819 %cmp_ab = icmp ugt <4 x i32> %a, %b
820 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
821 %cmp_ca = icmp ugt <4 x i32> %c, %a
822 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
826 define <4 x i32> @umax_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
827 ; CHECK-LABEL: umax_bc_ba:
829 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
830 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
831 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
833 %cmp_bc = icmp ugt <4 x i32> %b, %c
834 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
835 %cmp_ba = icmp ugt <4 x i32> %b, %a
836 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
837 %cmp_ca = icmp ugt <4 x i32> %c, %a
838 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
842 define <4 x i32> @umax_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
843 ; CHECK-LABEL: umax_ab_bc_swap_pred:
845 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
846 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
847 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
849 %cmp_ab = icmp ugt <4 x i32> %a, %b
850 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
851 %cmp_bc = icmp ugt <4 x i32> %b, %c
852 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
853 %cmp_ac = icmp ult <4 x i32> %c, %a
854 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
858 define <4 x i32> @umax_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
859 ; CHECK-LABEL: umax_ab_cb_swap_pred:
861 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
862 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
863 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
865 %cmp_ab = icmp ugt <4 x i32> %a, %b
866 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
867 %cmp_cb = icmp ugt <4 x i32> %c, %b
868 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
869 %cmp_ac = icmp ult <4 x i32> %c, %a
870 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
874 define <4 x i32> @umax_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
875 ; CHECK-LABEL: umax_bc_ab_swap_pred:
877 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
878 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
879 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
881 %cmp_bc = icmp ugt <4 x i32> %b, %c
882 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
883 %cmp_ab = icmp ugt <4 x i32> %a, %b
884 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
885 %cmp_ca = icmp ult <4 x i32> %a, %c
886 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
890 define <4 x i32> @umax_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
891 ; CHECK-LABEL: umax_bc_ba_swap_pred:
893 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
894 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
895 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
897 %cmp_bc = icmp ugt <4 x i32> %b, %c
898 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
899 %cmp_ba = icmp ugt <4 x i32> %b, %a
900 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
901 %cmp_ca = icmp ult <4 x i32> %a, %c
902 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
906 define <4 x i32> @umax_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
907 ; CHECK-LABEL: umax_ab_bc_eq_pred:
909 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
910 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
911 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
913 %cmp_ab = icmp ugt <4 x i32> %a, %b
914 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
915 %cmp_bc = icmp ugt <4 x i32> %b, %c
916 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
917 %cmp_ac = icmp uge <4 x i32> %a, %c
918 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
922 define <4 x i32> @umax_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
923 ; CHECK-LABEL: umax_ab_cb_eq_pred:
925 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
926 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
927 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
929 %cmp_ab = icmp ugt <4 x i32> %a, %b
930 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
931 %cmp_cb = icmp ugt <4 x i32> %c, %b
932 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
933 %cmp_ac = icmp uge <4 x i32> %a, %c
934 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
938 define <4 x i32> @umax_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
939 ; CHECK-LABEL: umax_bc_ab_eq_pred:
941 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
942 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
943 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
945 %cmp_bc = icmp ugt <4 x i32> %b, %c
946 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
947 %cmp_ab = icmp ugt <4 x i32> %a, %b
948 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
949 %cmp_ca = icmp uge <4 x i32> %c, %a
950 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
954 define <4 x i32> @umax_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
955 ; CHECK-LABEL: umax_bc_ba_eq_pred:
957 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
958 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
959 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
961 %cmp_bc = icmp ugt <4 x i32> %b, %c
962 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
963 %cmp_ba = icmp ugt <4 x i32> %b, %a
964 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
965 %cmp_ca = icmp uge <4 x i32> %c, %a
966 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
970 define <4 x i32> @umax_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
971 ; CHECK-LABEL: umax_ab_bc_eq_swap_pred:
973 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
974 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
975 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
977 %cmp_ab = icmp ugt <4 x i32> %a, %b
978 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
979 %cmp_bc = icmp ugt <4 x i32> %b, %c
980 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
981 %cmp_ac = icmp ule <4 x i32> %c, %a
982 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
986 define <4 x i32> @umax_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
987 ; CHECK-LABEL: umax_ab_cb_eq_swap_pred:
989 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
990 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
991 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
993 %cmp_ab = icmp ugt <4 x i32> %a, %b
994 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
995 %cmp_cb = icmp ugt <4 x i32> %c, %b
996 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
997 %cmp_ac = icmp ule <4 x i32> %c, %a
998 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1002 define <4 x i32> @umax_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1003 ; CHECK-LABEL: umax_bc_ab_eq_swap_pred:
1005 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
1006 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
1007 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
1009 %cmp_bc = icmp ugt <4 x i32> %b, %c
1010 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1011 %cmp_ab = icmp ugt <4 x i32> %a, %b
1012 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1013 %cmp_ca = icmp ule <4 x i32> %a, %c
1014 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1018 define <4 x i32> @umax_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
1019 ; CHECK-LABEL: umax_bc_ba_eq_swap_pred:
1021 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
1022 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
1023 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
1025 %cmp_bc = icmp ugt <4 x i32> %b, %c
1026 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1027 %cmp_ba = icmp ugt <4 x i32> %b, %a
1028 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1029 %cmp_ca = icmp ule <4 x i32> %a, %c
1030 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1034 define <4 x i32> @notted_smin_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1035 ; CHECK-LABEL: notted_smin_ab_bc:
1037 ; CHECK-NEXT: mvn v0.16b, v0.16b
1038 ; CHECK-NEXT: mvn v1.16b, v1.16b
1039 ; CHECK-NEXT: mvn v2.16b, v2.16b
1040 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1041 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
1042 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1044 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1045 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1046 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1047 %cmp_ab = icmp slt <4 x i32> %a, %b
1048 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1049 %cmp_bc = icmp slt <4 x i32> %b, %c
1050 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1051 %cmp_ac = icmp slt <4 x i32> %z, %x
1052 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1056 define <4 x i32> @notted_smin_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1057 ; CHECK-LABEL: notted_smin_ab_cb:
1059 ; CHECK-NEXT: mvn v0.16b, v0.16b
1060 ; CHECK-NEXT: mvn v1.16b, v1.16b
1061 ; CHECK-NEXT: mvn v2.16b, v2.16b
1062 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1063 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
1064 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1066 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1067 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1068 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1069 %cmp_ab = icmp slt <4 x i32> %a, %b
1070 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1071 %cmp_cb = icmp slt <4 x i32> %c, %b
1072 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1073 %cmp_ac = icmp slt <4 x i32> %z, %x
1074 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1078 define <4 x i32> @notted_smin_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1079 ; CHECK-LABEL: notted_smin_bc_ab:
1081 ; CHECK-NEXT: mvn v0.16b, v0.16b
1082 ; CHECK-NEXT: mvn v1.16b, v1.16b
1083 ; CHECK-NEXT: mvn v2.16b, v2.16b
1084 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1085 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1086 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1088 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1089 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1090 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1091 %cmp_bc = icmp slt <4 x i32> %b, %c
1092 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1093 %cmp_ab = icmp slt <4 x i32> %a, %b
1094 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1095 %cmp_ca = icmp slt <4 x i32> %x, %z
1096 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1100 define <4 x i32> @notted_smin_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1101 ; CHECK-LABEL: notted_smin_bc_ba:
1103 ; CHECK-NEXT: mvn v0.16b, v0.16b
1104 ; CHECK-NEXT: mvn v1.16b, v1.16b
1105 ; CHECK-NEXT: mvn v2.16b, v2.16b
1106 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1107 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
1108 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1110 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1111 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1112 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1113 %cmp_bc = icmp slt <4 x i32> %b, %c
1114 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1115 %cmp_ba = icmp slt <4 x i32> %b, %a
1116 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1117 %cmp_ca = icmp slt <4 x i32> %x, %z
1118 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1122 define <4 x i32> @notted_smin_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1123 ; CHECK-LABEL: notted_smin_ab_bc_swap_pred:
1125 ; CHECK-NEXT: mvn v0.16b, v0.16b
1126 ; CHECK-NEXT: mvn v1.16b, v1.16b
1127 ; CHECK-NEXT: mvn v2.16b, v2.16b
1128 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1129 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
1130 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1132 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1133 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1134 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1135 %cmp_ab = icmp slt <4 x i32> %a, %b
1136 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1137 %cmp_bc = icmp slt <4 x i32> %b, %c
1138 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1139 %cmp_ac = icmp sgt <4 x i32> %x, %z
1140 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1144 define <4 x i32> @notted_smin_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1145 ; CHECK-LABEL: notted_smin_ab_cb_swap_pred:
1147 ; CHECK-NEXT: mvn v0.16b, v0.16b
1148 ; CHECK-NEXT: mvn v1.16b, v1.16b
1149 ; CHECK-NEXT: mvn v2.16b, v2.16b
1150 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1151 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
1152 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1154 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1155 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1156 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1157 %cmp_ab = icmp slt <4 x i32> %a, %b
1158 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1159 %cmp_cb = icmp slt <4 x i32> %c, %b
1160 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1161 %cmp_ac = icmp sgt <4 x i32> %x, %z
1162 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1166 define <4 x i32> @notted_smin_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1167 ; CHECK-LABEL: notted_smin_bc_ab_swap_pred:
1169 ; CHECK-NEXT: mvn v0.16b, v0.16b
1170 ; CHECK-NEXT: mvn v1.16b, v1.16b
1171 ; CHECK-NEXT: mvn v2.16b, v2.16b
1172 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1173 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1174 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1176 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1177 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1178 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1179 %cmp_bc = icmp slt <4 x i32> %b, %c
1180 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1181 %cmp_ab = icmp slt <4 x i32> %a, %b
1182 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1183 %cmp_ca = icmp sgt <4 x i32> %z, %x
1184 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1188 define <4 x i32> @notted_smin_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1189 ; CHECK-LABEL: notted_smin_bc_ba_swap_pred:
1191 ; CHECK-NEXT: mvn v0.16b, v0.16b
1192 ; CHECK-NEXT: mvn v1.16b, v1.16b
1193 ; CHECK-NEXT: mvn v2.16b, v2.16b
1194 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1195 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
1196 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1198 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1199 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1200 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1201 %cmp_bc = icmp slt <4 x i32> %b, %c
1202 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1203 %cmp_ba = icmp slt <4 x i32> %b, %a
1204 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1205 %cmp_ca = icmp sgt <4 x i32> %z, %x
1206 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1210 define <4 x i32> @notted_smin_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1211 ; CHECK-LABEL: notted_smin_ab_bc_eq_pred:
1213 ; CHECK-NEXT: mvn v0.16b, v0.16b
1214 ; CHECK-NEXT: mvn v1.16b, v1.16b
1215 ; CHECK-NEXT: mvn v2.16b, v2.16b
1216 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1217 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
1218 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1220 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1221 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1222 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1223 %cmp_ab = icmp slt <4 x i32> %a, %b
1224 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1225 %cmp_bc = icmp slt <4 x i32> %b, %c
1226 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1227 %cmp_ac = icmp sle <4 x i32> %z, %x
1228 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1232 define <4 x i32> @notted_smin_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1233 ; CHECK-LABEL: notted_smin_ab_cb_eq_pred:
1235 ; CHECK-NEXT: mvn v0.16b, v0.16b
1236 ; CHECK-NEXT: mvn v1.16b, v1.16b
1237 ; CHECK-NEXT: mvn v2.16b, v2.16b
1238 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1239 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
1240 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1242 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1243 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1244 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1245 %cmp_ab = icmp slt <4 x i32> %a, %b
1246 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1247 %cmp_cb = icmp slt <4 x i32> %c, %b
1248 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1249 %cmp_ac = icmp sle <4 x i32> %z, %x
1250 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1254 define <4 x i32> @notted_smin_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1255 ; CHECK-LABEL: notted_smin_bc_ab_eq_pred:
1257 ; CHECK-NEXT: mvn v0.16b, v0.16b
1258 ; CHECK-NEXT: mvn v1.16b, v1.16b
1259 ; CHECK-NEXT: mvn v2.16b, v2.16b
1260 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1261 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1262 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1264 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1265 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1266 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1267 %cmp_bc = icmp slt <4 x i32> %b, %c
1268 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1269 %cmp_ab = icmp slt <4 x i32> %a, %b
1270 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1271 %cmp_ca = icmp sle <4 x i32> %x, %z
1272 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1276 define <4 x i32> @notted_smin_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1277 ; CHECK-LABEL: notted_smin_bc_ba_eq_pred:
1279 ; CHECK-NEXT: mvn v0.16b, v0.16b
1280 ; CHECK-NEXT: mvn v1.16b, v1.16b
1281 ; CHECK-NEXT: mvn v2.16b, v2.16b
1282 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1283 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
1284 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1286 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1287 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1288 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1289 %cmp_bc = icmp slt <4 x i32> %b, %c
1290 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1291 %cmp_ba = icmp slt <4 x i32> %b, %a
1292 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1293 %cmp_ca = icmp sle <4 x i32> %x, %z
1294 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1298 define <4 x i32> @notted_smin_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1299 ; CHECK-LABEL: notted_smin_ab_bc_eq_swap_pred:
1301 ; CHECK-NEXT: mvn v0.16b, v0.16b
1302 ; CHECK-NEXT: mvn v1.16b, v1.16b
1303 ; CHECK-NEXT: mvn v2.16b, v2.16b
1304 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1305 ; CHECK-NEXT: smin v1.4s, v1.4s, v2.4s
1306 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1308 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1309 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1310 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1311 %cmp_ab = icmp slt <4 x i32> %a, %b
1312 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1313 %cmp_bc = icmp slt <4 x i32> %b, %c
1314 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1315 %cmp_ac = icmp sge <4 x i32> %x, %z
1316 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1320 define <4 x i32> @notted_smin_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1321 ; CHECK-LABEL: notted_smin_ab_cb_eq_swap_pred:
1323 ; CHECK-NEXT: mvn v0.16b, v0.16b
1324 ; CHECK-NEXT: mvn v1.16b, v1.16b
1325 ; CHECK-NEXT: mvn v2.16b, v2.16b
1326 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1327 ; CHECK-NEXT: smin v1.4s, v2.4s, v1.4s
1328 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1330 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1331 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1332 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1333 %cmp_ab = icmp slt <4 x i32> %a, %b
1334 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1335 %cmp_cb = icmp slt <4 x i32> %c, %b
1336 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1337 %cmp_ac = icmp sge <4 x i32> %x, %z
1338 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1342 define <4 x i32> @notted_smin_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1343 ; CHECK-LABEL: notted_smin_bc_ab_eq_swap_pred:
1345 ; CHECK-NEXT: mvn v0.16b, v0.16b
1346 ; CHECK-NEXT: mvn v1.16b, v1.16b
1347 ; CHECK-NEXT: mvn v2.16b, v2.16b
1348 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1349 ; CHECK-NEXT: smin v0.4s, v0.4s, v1.4s
1350 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1352 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1353 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1354 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1355 %cmp_bc = icmp slt <4 x i32> %b, %c
1356 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1357 %cmp_ab = icmp slt <4 x i32> %a, %b
1358 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1359 %cmp_ca = icmp sge <4 x i32> %z, %x
1360 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1364 define <4 x i32> @notted_smin_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1365 ; CHECK-LABEL: notted_smin_bc_ba_eq_swap_pred:
1367 ; CHECK-NEXT: mvn v0.16b, v0.16b
1368 ; CHECK-NEXT: mvn v1.16b, v1.16b
1369 ; CHECK-NEXT: mvn v2.16b, v2.16b
1370 ; CHECK-NEXT: smin v2.4s, v1.4s, v2.4s
1371 ; CHECK-NEXT: smin v0.4s, v1.4s, v0.4s
1372 ; CHECK-NEXT: smin v0.4s, v2.4s, v0.4s
1374 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1375 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1376 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1377 %cmp_bc = icmp slt <4 x i32> %b, %c
1378 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1379 %cmp_ba = icmp slt <4 x i32> %b, %a
1380 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1381 %cmp_ca = icmp sge <4 x i32> %z, %x
1382 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1386 define <4 x i32> @notted_smax_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1387 ; CHECK-LABEL: notted_smax_ab_bc:
1389 ; CHECK-NEXT: mvn v0.16b, v0.16b
1390 ; CHECK-NEXT: mvn v1.16b, v1.16b
1391 ; CHECK-NEXT: mvn v2.16b, v2.16b
1392 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1393 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
1394 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1396 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1397 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1398 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1399 %cmp_ab = icmp sgt <4 x i32> %a, %b
1400 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1401 %cmp_bc = icmp sgt <4 x i32> %b, %c
1402 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1403 %cmp_ac = icmp sgt <4 x i32> %z, %x
1404 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1408 define <4 x i32> @notted_smax_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1409 ; CHECK-LABEL: notted_smax_ab_cb:
1411 ; CHECK-NEXT: mvn v0.16b, v0.16b
1412 ; CHECK-NEXT: mvn v1.16b, v1.16b
1413 ; CHECK-NEXT: mvn v2.16b, v2.16b
1414 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1415 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
1416 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1418 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1419 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1420 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1421 %cmp_ab = icmp sgt <4 x i32> %a, %b
1422 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1423 %cmp_cb = icmp sgt <4 x i32> %c, %b
1424 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1425 %cmp_ac = icmp sgt <4 x i32> %z, %x
1426 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1430 define <4 x i32> @notted_smax_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1431 ; CHECK-LABEL: notted_smax_bc_ab:
1433 ; CHECK-NEXT: mvn v0.16b, v0.16b
1434 ; CHECK-NEXT: mvn v1.16b, v1.16b
1435 ; CHECK-NEXT: mvn v2.16b, v2.16b
1436 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1437 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1438 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1440 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1441 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1442 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1443 %cmp_bc = icmp sgt <4 x i32> %b, %c
1444 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1445 %cmp_ab = icmp sgt <4 x i32> %a, %b
1446 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1447 %cmp_ca = icmp sgt <4 x i32> %x, %z
1448 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1452 define <4 x i32> @notted_smax_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1453 ; CHECK-LABEL: notted_smax_bc_ba:
1455 ; CHECK-NEXT: mvn v0.16b, v0.16b
1456 ; CHECK-NEXT: mvn v1.16b, v1.16b
1457 ; CHECK-NEXT: mvn v2.16b, v2.16b
1458 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1459 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
1460 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1462 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1463 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1464 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1465 %cmp_bc = icmp sgt <4 x i32> %b, %c
1466 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1467 %cmp_ba = icmp sgt <4 x i32> %b, %a
1468 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1469 %cmp_ca = icmp sgt <4 x i32> %x, %z
1470 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1474 define <4 x i32> @notted_smax_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1475 ; CHECK-LABEL: notted_smax_ab_bc_swap_pred:
1477 ; CHECK-NEXT: mvn v0.16b, v0.16b
1478 ; CHECK-NEXT: mvn v1.16b, v1.16b
1479 ; CHECK-NEXT: mvn v2.16b, v2.16b
1480 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1481 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
1482 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1484 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1485 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1486 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1487 %cmp_ab = icmp sgt <4 x i32> %a, %b
1488 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1489 %cmp_bc = icmp sgt <4 x i32> %b, %c
1490 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1491 %cmp_ac = icmp slt <4 x i32> %x, %z
1492 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1496 define <4 x i32> @notted_smax_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1497 ; CHECK-LABEL: notted_smax_ab_cb_swap_pred:
1499 ; CHECK-NEXT: mvn v0.16b, v0.16b
1500 ; CHECK-NEXT: mvn v1.16b, v1.16b
1501 ; CHECK-NEXT: mvn v2.16b, v2.16b
1502 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1503 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
1504 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1506 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1507 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1508 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1509 %cmp_ab = icmp sgt <4 x i32> %a, %b
1510 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1511 %cmp_cb = icmp sgt <4 x i32> %c, %b
1512 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1513 %cmp_ac = icmp slt <4 x i32> %x, %z
1514 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1518 define <4 x i32> @notted_smax_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1519 ; CHECK-LABEL: notted_smax_bc_ab_swap_pred:
1521 ; CHECK-NEXT: mvn v0.16b, v0.16b
1522 ; CHECK-NEXT: mvn v1.16b, v1.16b
1523 ; CHECK-NEXT: mvn v2.16b, v2.16b
1524 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1525 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1526 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1528 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1529 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1530 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1531 %cmp_bc = icmp sgt <4 x i32> %b, %c
1532 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1533 %cmp_ab = icmp sgt <4 x i32> %a, %b
1534 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1535 %cmp_ca = icmp slt <4 x i32> %z, %x
1536 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1540 define <4 x i32> @notted_smax_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1541 ; CHECK-LABEL: notted_smax_bc_ba_swap_pred:
1543 ; CHECK-NEXT: mvn v0.16b, v0.16b
1544 ; CHECK-NEXT: mvn v1.16b, v1.16b
1545 ; CHECK-NEXT: mvn v2.16b, v2.16b
1546 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1547 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
1548 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1550 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1551 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1552 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1553 %cmp_bc = icmp sgt <4 x i32> %b, %c
1554 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1555 %cmp_ba = icmp sgt <4 x i32> %b, %a
1556 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1557 %cmp_ca = icmp slt <4 x i32> %z, %x
1558 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1562 define <4 x i32> @notted_smax_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1563 ; CHECK-LABEL: notted_smax_ab_bc_eq_pred:
1565 ; CHECK-NEXT: mvn v0.16b, v0.16b
1566 ; CHECK-NEXT: mvn v1.16b, v1.16b
1567 ; CHECK-NEXT: mvn v2.16b, v2.16b
1568 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1569 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
1570 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1572 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1573 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1574 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1575 %cmp_ab = icmp sgt <4 x i32> %a, %b
1576 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1577 %cmp_bc = icmp sgt <4 x i32> %b, %c
1578 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1579 %cmp_ac = icmp sge <4 x i32> %z, %x
1580 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1584 define <4 x i32> @notted_smax_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1585 ; CHECK-LABEL: notted_smax_ab_cb_eq_pred:
1587 ; CHECK-NEXT: mvn v0.16b, v0.16b
1588 ; CHECK-NEXT: mvn v1.16b, v1.16b
1589 ; CHECK-NEXT: mvn v2.16b, v2.16b
1590 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1591 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
1592 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1594 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1595 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1596 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1597 %cmp_ab = icmp sgt <4 x i32> %a, %b
1598 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1599 %cmp_cb = icmp sgt <4 x i32> %c, %b
1600 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1601 %cmp_ac = icmp sge <4 x i32> %z, %x
1602 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1606 define <4 x i32> @notted_smax_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1607 ; CHECK-LABEL: notted_smax_bc_ab_eq_pred:
1609 ; CHECK-NEXT: mvn v0.16b, v0.16b
1610 ; CHECK-NEXT: mvn v1.16b, v1.16b
1611 ; CHECK-NEXT: mvn v2.16b, v2.16b
1612 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1613 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1614 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1616 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1617 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1618 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1619 %cmp_bc = icmp sgt <4 x i32> %b, %c
1620 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1621 %cmp_ab = icmp sgt <4 x i32> %a, %b
1622 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1623 %cmp_ca = icmp sge <4 x i32> %x, %z
1624 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1628 define <4 x i32> @notted_smax_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1629 ; CHECK-LABEL: notted_smax_bc_ba_eq_pred:
1631 ; CHECK-NEXT: mvn v0.16b, v0.16b
1632 ; CHECK-NEXT: mvn v1.16b, v1.16b
1633 ; CHECK-NEXT: mvn v2.16b, v2.16b
1634 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1635 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
1636 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1638 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1639 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1640 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1641 %cmp_bc = icmp sgt <4 x i32> %b, %c
1642 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1643 %cmp_ba = icmp sgt <4 x i32> %b, %a
1644 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1645 %cmp_ca = icmp sge <4 x i32> %x, %z
1646 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1650 define <4 x i32> @notted_smax_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1651 ; CHECK-LABEL: notted_smax_ab_bc_eq_swap_pred:
1653 ; CHECK-NEXT: mvn v0.16b, v0.16b
1654 ; CHECK-NEXT: mvn v1.16b, v1.16b
1655 ; CHECK-NEXT: mvn v2.16b, v2.16b
1656 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1657 ; CHECK-NEXT: smax v1.4s, v1.4s, v2.4s
1658 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1660 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1661 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1662 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1663 %cmp_ab = icmp sgt <4 x i32> %a, %b
1664 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1665 %cmp_bc = icmp sgt <4 x i32> %b, %c
1666 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1667 %cmp_ac = icmp sle <4 x i32> %x, %z
1668 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1672 define <4 x i32> @notted_smax_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1673 ; CHECK-LABEL: notted_smax_ab_cb_eq_swap_pred:
1675 ; CHECK-NEXT: mvn v0.16b, v0.16b
1676 ; CHECK-NEXT: mvn v1.16b, v1.16b
1677 ; CHECK-NEXT: mvn v2.16b, v2.16b
1678 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1679 ; CHECK-NEXT: smax v1.4s, v2.4s, v1.4s
1680 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1682 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1683 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1684 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1685 %cmp_ab = icmp sgt <4 x i32> %a, %b
1686 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1687 %cmp_cb = icmp sgt <4 x i32> %c, %b
1688 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1689 %cmp_ac = icmp sle <4 x i32> %x, %z
1690 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1694 define <4 x i32> @notted_smax_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1695 ; CHECK-LABEL: notted_smax_bc_ab_eq_swap_pred:
1697 ; CHECK-NEXT: mvn v0.16b, v0.16b
1698 ; CHECK-NEXT: mvn v1.16b, v1.16b
1699 ; CHECK-NEXT: mvn v2.16b, v2.16b
1700 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1701 ; CHECK-NEXT: smax v0.4s, v0.4s, v1.4s
1702 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1704 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1705 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1706 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1707 %cmp_bc = icmp sgt <4 x i32> %b, %c
1708 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1709 %cmp_ab = icmp sgt <4 x i32> %a, %b
1710 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1711 %cmp_ca = icmp sle <4 x i32> %z, %x
1712 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1716 define <4 x i32> @notted_smax_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1717 ; CHECK-LABEL: notted_smax_bc_ba_eq_swap_pred:
1719 ; CHECK-NEXT: mvn v0.16b, v0.16b
1720 ; CHECK-NEXT: mvn v1.16b, v1.16b
1721 ; CHECK-NEXT: mvn v2.16b, v2.16b
1722 ; CHECK-NEXT: smax v2.4s, v1.4s, v2.4s
1723 ; CHECK-NEXT: smax v0.4s, v1.4s, v0.4s
1724 ; CHECK-NEXT: smax v0.4s, v2.4s, v0.4s
1726 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1727 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1728 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1729 %cmp_bc = icmp sgt <4 x i32> %b, %c
1730 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1731 %cmp_ba = icmp sgt <4 x i32> %b, %a
1732 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1733 %cmp_ca = icmp sle <4 x i32> %z, %x
1734 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1738 define <4 x i32> @notted_umin_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1739 ; CHECK-LABEL: notted_umin_ab_bc:
1741 ; CHECK-NEXT: mvn v0.16b, v0.16b
1742 ; CHECK-NEXT: mvn v1.16b, v1.16b
1743 ; CHECK-NEXT: mvn v2.16b, v2.16b
1744 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1745 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
1746 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1748 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1749 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1750 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1751 %cmp_ab = icmp ult <4 x i32> %a, %b
1752 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1753 %cmp_bc = icmp ult <4 x i32> %b, %c
1754 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1755 %cmp_ac = icmp ult <4 x i32> %z, %x
1756 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1760 define <4 x i32> @notted_umin_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1761 ; CHECK-LABEL: notted_umin_ab_cb:
1763 ; CHECK-NEXT: mvn v0.16b, v0.16b
1764 ; CHECK-NEXT: mvn v1.16b, v1.16b
1765 ; CHECK-NEXT: mvn v2.16b, v2.16b
1766 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1767 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
1768 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1770 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1771 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1772 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1773 %cmp_ab = icmp ult <4 x i32> %a, %b
1774 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1775 %cmp_cb = icmp ult <4 x i32> %c, %b
1776 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1777 %cmp_ac = icmp ult <4 x i32> %z, %x
1778 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1782 define <4 x i32> @notted_umin_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1783 ; CHECK-LABEL: notted_umin_bc_ab:
1785 ; CHECK-NEXT: mvn v0.16b, v0.16b
1786 ; CHECK-NEXT: mvn v1.16b, v1.16b
1787 ; CHECK-NEXT: mvn v2.16b, v2.16b
1788 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1789 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1790 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1792 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1793 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1794 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1795 %cmp_bc = icmp ult <4 x i32> %b, %c
1796 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1797 %cmp_ab = icmp ult <4 x i32> %a, %b
1798 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1799 %cmp_ca = icmp ult <4 x i32> %x, %z
1800 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1804 define <4 x i32> @notted_umin_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1805 ; CHECK-LABEL: notted_umin_bc_ba:
1807 ; CHECK-NEXT: mvn v0.16b, v0.16b
1808 ; CHECK-NEXT: mvn v1.16b, v1.16b
1809 ; CHECK-NEXT: mvn v2.16b, v2.16b
1810 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1811 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
1812 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1814 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1815 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1816 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1817 %cmp_bc = icmp ult <4 x i32> %b, %c
1818 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1819 %cmp_ba = icmp ult <4 x i32> %b, %a
1820 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1821 %cmp_ca = icmp ult <4 x i32> %x, %z
1822 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1826 define <4 x i32> @notted_umin_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1827 ; CHECK-LABEL: notted_umin_ab_bc_swap_pred:
1829 ; CHECK-NEXT: mvn v0.16b, v0.16b
1830 ; CHECK-NEXT: mvn v1.16b, v1.16b
1831 ; CHECK-NEXT: mvn v2.16b, v2.16b
1832 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1833 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
1834 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1836 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1837 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1838 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1839 %cmp_ab = icmp ult <4 x i32> %a, %b
1840 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1841 %cmp_bc = icmp ult <4 x i32> %b, %c
1842 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1843 %cmp_ac = icmp ugt <4 x i32> %x, %z
1844 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1848 define <4 x i32> @notted_umin_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1849 ; CHECK-LABEL: notted_umin_ab_cb_swap_pred:
1851 ; CHECK-NEXT: mvn v0.16b, v0.16b
1852 ; CHECK-NEXT: mvn v1.16b, v1.16b
1853 ; CHECK-NEXT: mvn v2.16b, v2.16b
1854 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1855 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
1856 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1858 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1859 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1860 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1861 %cmp_ab = icmp ult <4 x i32> %a, %b
1862 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1863 %cmp_cb = icmp ult <4 x i32> %c, %b
1864 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1865 %cmp_ac = icmp ugt <4 x i32> %x, %z
1866 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1870 define <4 x i32> @notted_umin_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1871 ; CHECK-LABEL: notted_umin_bc_ab_swap_pred:
1873 ; CHECK-NEXT: mvn v0.16b, v0.16b
1874 ; CHECK-NEXT: mvn v1.16b, v1.16b
1875 ; CHECK-NEXT: mvn v2.16b, v2.16b
1876 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1877 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1878 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1880 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1881 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1882 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1883 %cmp_bc = icmp ult <4 x i32> %b, %c
1884 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1885 %cmp_ab = icmp ult <4 x i32> %a, %b
1886 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1887 %cmp_ca = icmp ugt <4 x i32> %z, %x
1888 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1892 define <4 x i32> @notted_umin_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1893 ; CHECK-LABEL: notted_umin_bc_ba_swap_pred:
1895 ; CHECK-NEXT: mvn v0.16b, v0.16b
1896 ; CHECK-NEXT: mvn v1.16b, v1.16b
1897 ; CHECK-NEXT: mvn v2.16b, v2.16b
1898 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1899 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
1900 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1902 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1903 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1904 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1905 %cmp_bc = icmp ult <4 x i32> %b, %c
1906 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1907 %cmp_ba = icmp ult <4 x i32> %b, %a
1908 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1909 %cmp_ca = icmp ugt <4 x i32> %z, %x
1910 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
1914 define <4 x i32> @notted_umin_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1915 ; CHECK-LABEL: notted_umin_ab_bc_eq_pred:
1917 ; CHECK-NEXT: mvn v0.16b, v0.16b
1918 ; CHECK-NEXT: mvn v1.16b, v1.16b
1919 ; CHECK-NEXT: mvn v2.16b, v2.16b
1920 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1921 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
1922 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1924 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1925 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1926 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1927 %cmp_ab = icmp ult <4 x i32> %a, %b
1928 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1929 %cmp_bc = icmp ult <4 x i32> %b, %c
1930 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1931 %cmp_ac = icmp ule <4 x i32> %z, %x
1932 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
1936 define <4 x i32> @notted_umin_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1937 ; CHECK-LABEL: notted_umin_ab_cb_eq_pred:
1939 ; CHECK-NEXT: mvn v0.16b, v0.16b
1940 ; CHECK-NEXT: mvn v1.16b, v1.16b
1941 ; CHECK-NEXT: mvn v2.16b, v2.16b
1942 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1943 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
1944 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1946 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1947 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1948 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1949 %cmp_ab = icmp ult <4 x i32> %a, %b
1950 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1951 %cmp_cb = icmp ult <4 x i32> %c, %b
1952 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
1953 %cmp_ac = icmp ule <4 x i32> %z, %x
1954 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
1958 define <4 x i32> @notted_umin_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1959 ; CHECK-LABEL: notted_umin_bc_ab_eq_pred:
1961 ; CHECK-NEXT: mvn v0.16b, v0.16b
1962 ; CHECK-NEXT: mvn v1.16b, v1.16b
1963 ; CHECK-NEXT: mvn v2.16b, v2.16b
1964 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1965 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
1966 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1968 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1969 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1970 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1971 %cmp_bc = icmp ult <4 x i32> %b, %c
1972 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1973 %cmp_ab = icmp ult <4 x i32> %a, %b
1974 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
1975 %cmp_ca = icmp ule <4 x i32> %x, %z
1976 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
1980 define <4 x i32> @notted_umin_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
1981 ; CHECK-LABEL: notted_umin_bc_ba_eq_pred:
1983 ; CHECK-NEXT: mvn v0.16b, v0.16b
1984 ; CHECK-NEXT: mvn v1.16b, v1.16b
1985 ; CHECK-NEXT: mvn v2.16b, v2.16b
1986 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
1987 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
1988 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
1990 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
1991 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
1992 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
1993 %cmp_bc = icmp ult <4 x i32> %b, %c
1994 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
1995 %cmp_ba = icmp ult <4 x i32> %b, %a
1996 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
1997 %cmp_ca = icmp ule <4 x i32> %x, %z
1998 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
2002 define <4 x i32> @notted_umin_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2003 ; CHECK-LABEL: notted_umin_ab_bc_eq_swap_pred:
2005 ; CHECK-NEXT: mvn v0.16b, v0.16b
2006 ; CHECK-NEXT: mvn v1.16b, v1.16b
2007 ; CHECK-NEXT: mvn v2.16b, v2.16b
2008 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
2009 ; CHECK-NEXT: umin v1.4s, v1.4s, v2.4s
2010 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
2012 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2013 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2014 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2015 %cmp_ab = icmp ult <4 x i32> %a, %b
2016 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2017 %cmp_bc = icmp ult <4 x i32> %b, %c
2018 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2019 %cmp_ac = icmp uge <4 x i32> %x, %z
2020 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
2024 define <4 x i32> @notted_umin_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2025 ; CHECK-LABEL: notted_umin_ab_cb_eq_swap_pred:
2027 ; CHECK-NEXT: mvn v0.16b, v0.16b
2028 ; CHECK-NEXT: mvn v1.16b, v1.16b
2029 ; CHECK-NEXT: mvn v2.16b, v2.16b
2030 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
2031 ; CHECK-NEXT: umin v1.4s, v2.4s, v1.4s
2032 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
2034 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2035 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2036 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2037 %cmp_ab = icmp ult <4 x i32> %a, %b
2038 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2039 %cmp_cb = icmp ult <4 x i32> %c, %b
2040 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
2041 %cmp_ac = icmp uge <4 x i32> %x, %z
2042 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
2046 define <4 x i32> @notted_umin_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2047 ; CHECK-LABEL: notted_umin_bc_ab_eq_swap_pred:
2049 ; CHECK-NEXT: mvn v0.16b, v0.16b
2050 ; CHECK-NEXT: mvn v1.16b, v1.16b
2051 ; CHECK-NEXT: mvn v2.16b, v2.16b
2052 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
2053 ; CHECK-NEXT: umin v0.4s, v0.4s, v1.4s
2054 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
2056 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2057 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2058 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2059 %cmp_bc = icmp ult <4 x i32> %b, %c
2060 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2061 %cmp_ab = icmp ult <4 x i32> %a, %b
2062 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2063 %cmp_ca = icmp uge <4 x i32> %z, %x
2064 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
2068 define <4 x i32> @notted_umin_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2069 ; CHECK-LABEL: notted_umin_bc_ba_eq_swap_pred:
2071 ; CHECK-NEXT: mvn v0.16b, v0.16b
2072 ; CHECK-NEXT: mvn v1.16b, v1.16b
2073 ; CHECK-NEXT: mvn v2.16b, v2.16b
2074 ; CHECK-NEXT: umin v2.4s, v1.4s, v2.4s
2075 ; CHECK-NEXT: umin v0.4s, v1.4s, v0.4s
2076 ; CHECK-NEXT: umin v0.4s, v2.4s, v0.4s
2078 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2079 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2080 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2081 %cmp_bc = icmp ult <4 x i32> %b, %c
2082 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2083 %cmp_ba = icmp ult <4 x i32> %b, %a
2084 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
2085 %cmp_ca = icmp uge <4 x i32> %z, %x
2086 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
2090 define <4 x i32> @notted_umax_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2091 ; CHECK-LABEL: notted_umax_ab_bc:
2093 ; CHECK-NEXT: mvn v0.16b, v0.16b
2094 ; CHECK-NEXT: mvn v1.16b, v1.16b
2095 ; CHECK-NEXT: mvn v2.16b, v2.16b
2096 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2097 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
2098 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2100 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2101 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2102 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2103 %cmp_ab = icmp ugt <4 x i32> %a, %b
2104 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2105 %cmp_bc = icmp ugt <4 x i32> %b, %c
2106 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2107 %cmp_ac = icmp ugt <4 x i32> %z, %x
2108 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
2112 define <4 x i32> @notted_umax_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2113 ; CHECK-LABEL: notted_umax_ab_cb:
2115 ; CHECK-NEXT: mvn v0.16b, v0.16b
2116 ; CHECK-NEXT: mvn v1.16b, v1.16b
2117 ; CHECK-NEXT: mvn v2.16b, v2.16b
2118 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2119 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
2120 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2122 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2123 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2124 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2125 %cmp_ab = icmp ugt <4 x i32> %a, %b
2126 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2127 %cmp_cb = icmp ugt <4 x i32> %c, %b
2128 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
2129 %cmp_ac = icmp ugt <4 x i32> %z, %x
2130 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
2134 define <4 x i32> @notted_umax_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2135 ; CHECK-LABEL: notted_umax_bc_ab:
2137 ; CHECK-NEXT: mvn v0.16b, v0.16b
2138 ; CHECK-NEXT: mvn v1.16b, v1.16b
2139 ; CHECK-NEXT: mvn v2.16b, v2.16b
2140 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2141 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2142 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2144 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2145 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2146 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2147 %cmp_bc = icmp ugt <4 x i32> %b, %c
2148 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2149 %cmp_ab = icmp ugt <4 x i32> %a, %b
2150 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2151 %cmp_ca = icmp ugt <4 x i32> %x, %z
2152 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
2156 define <4 x i32> @notted_umax_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2157 ; CHECK-LABEL: notted_umax_bc_ba:
2159 ; CHECK-NEXT: mvn v0.16b, v0.16b
2160 ; CHECK-NEXT: mvn v1.16b, v1.16b
2161 ; CHECK-NEXT: mvn v2.16b, v2.16b
2162 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2163 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
2164 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2166 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2167 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2168 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2169 %cmp_bc = icmp ugt <4 x i32> %b, %c
2170 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2171 %cmp_ba = icmp ugt <4 x i32> %b, %a
2172 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
2173 %cmp_ca = icmp ugt <4 x i32> %x, %z
2174 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
2178 define <4 x i32> @notted_umax_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2179 ; CHECK-LABEL: notted_umax_ab_bc_swap_pred:
2181 ; CHECK-NEXT: mvn v0.16b, v0.16b
2182 ; CHECK-NEXT: mvn v1.16b, v1.16b
2183 ; CHECK-NEXT: mvn v2.16b, v2.16b
2184 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2185 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
2186 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2188 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2189 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2190 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2191 %cmp_ab = icmp ugt <4 x i32> %a, %b
2192 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2193 %cmp_bc = icmp ugt <4 x i32> %b, %c
2194 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2195 %cmp_ac = icmp ult <4 x i32> %x, %z
2196 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
2200 define <4 x i32> @notted_umax_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2201 ; CHECK-LABEL: notted_umax_ab_cb_swap_pred:
2203 ; CHECK-NEXT: mvn v0.16b, v0.16b
2204 ; CHECK-NEXT: mvn v1.16b, v1.16b
2205 ; CHECK-NEXT: mvn v2.16b, v2.16b
2206 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2207 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
2208 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2210 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2211 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2212 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2213 %cmp_ab = icmp ugt <4 x i32> %a, %b
2214 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2215 %cmp_cb = icmp ugt <4 x i32> %c, %b
2216 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
2217 %cmp_ac = icmp ult <4 x i32> %x, %z
2218 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
2222 define <4 x i32> @notted_umax_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2223 ; CHECK-LABEL: notted_umax_bc_ab_swap_pred:
2225 ; CHECK-NEXT: mvn v0.16b, v0.16b
2226 ; CHECK-NEXT: mvn v1.16b, v1.16b
2227 ; CHECK-NEXT: mvn v2.16b, v2.16b
2228 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2229 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2230 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2232 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2233 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2234 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2235 %cmp_bc = icmp ugt <4 x i32> %b, %c
2236 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2237 %cmp_ab = icmp ugt <4 x i32> %a, %b
2238 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2239 %cmp_ca = icmp ult <4 x i32> %z, %x
2240 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
2244 define <4 x i32> @notted_umax_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2245 ; CHECK-LABEL: notted_umax_bc_ba_swap_pred:
2247 ; CHECK-NEXT: mvn v0.16b, v0.16b
2248 ; CHECK-NEXT: mvn v1.16b, v1.16b
2249 ; CHECK-NEXT: mvn v2.16b, v2.16b
2250 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2251 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
2252 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2254 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2255 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2256 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2257 %cmp_bc = icmp ugt <4 x i32> %b, %c
2258 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2259 %cmp_ba = icmp ugt <4 x i32> %b, %a
2260 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
2261 %cmp_ca = icmp ult <4 x i32> %z, %x
2262 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
2266 define <4 x i32> @notted_umax_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2267 ; CHECK-LABEL: notted_umax_ab_bc_eq_pred:
2269 ; CHECK-NEXT: mvn v0.16b, v0.16b
2270 ; CHECK-NEXT: mvn v1.16b, v1.16b
2271 ; CHECK-NEXT: mvn v2.16b, v2.16b
2272 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2273 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
2274 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2276 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2277 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2278 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2279 %cmp_ab = icmp ugt <4 x i32> %a, %b
2280 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2281 %cmp_bc = icmp ugt <4 x i32> %b, %c
2282 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2283 %cmp_ac = icmp uge <4 x i32> %z, %x
2284 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
2288 define <4 x i32> @notted_umax_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2289 ; CHECK-LABEL: notted_umax_ab_cb_eq_pred:
2291 ; CHECK-NEXT: mvn v0.16b, v0.16b
2292 ; CHECK-NEXT: mvn v1.16b, v1.16b
2293 ; CHECK-NEXT: mvn v2.16b, v2.16b
2294 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2295 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
2296 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2298 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2299 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2300 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2301 %cmp_ab = icmp ugt <4 x i32> %a, %b
2302 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2303 %cmp_cb = icmp ugt <4 x i32> %c, %b
2304 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
2305 %cmp_ac = icmp uge <4 x i32> %z, %x
2306 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
2310 define <4 x i32> @notted_umax_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2311 ; CHECK-LABEL: notted_umax_bc_ab_eq_pred:
2313 ; CHECK-NEXT: mvn v0.16b, v0.16b
2314 ; CHECK-NEXT: mvn v1.16b, v1.16b
2315 ; CHECK-NEXT: mvn v2.16b, v2.16b
2316 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2317 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2318 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2320 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2321 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2322 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2323 %cmp_bc = icmp ugt <4 x i32> %b, %c
2324 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2325 %cmp_ab = icmp ugt <4 x i32> %a, %b
2326 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2327 %cmp_ca = icmp uge <4 x i32> %x, %z
2328 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
2332 define <4 x i32> @notted_umax_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2333 ; CHECK-LABEL: notted_umax_bc_ba_eq_pred:
2335 ; CHECK-NEXT: mvn v0.16b, v0.16b
2336 ; CHECK-NEXT: mvn v1.16b, v1.16b
2337 ; CHECK-NEXT: mvn v2.16b, v2.16b
2338 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2339 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
2340 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2342 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2343 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2344 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2345 %cmp_bc = icmp ugt <4 x i32> %b, %c
2346 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2347 %cmp_ba = icmp ugt <4 x i32> %b, %a
2348 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
2349 %cmp_ca = icmp uge <4 x i32> %x, %z
2350 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba
2354 define <4 x i32> @notted_umax_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2355 ; CHECK-LABEL: notted_umax_ab_bc_eq_swap_pred:
2357 ; CHECK-NEXT: mvn v0.16b, v0.16b
2358 ; CHECK-NEXT: mvn v1.16b, v1.16b
2359 ; CHECK-NEXT: mvn v2.16b, v2.16b
2360 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2361 ; CHECK-NEXT: umax v1.4s, v1.4s, v2.4s
2362 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2364 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2365 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2366 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2367 %cmp_ab = icmp ugt <4 x i32> %a, %b
2368 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2369 %cmp_bc = icmp ugt <4 x i32> %b, %c
2370 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2371 %cmp_ac = icmp ule <4 x i32> %x, %z
2372 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_bc
2376 define <4 x i32> @notted_umax_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2377 ; CHECK-LABEL: notted_umax_ab_cb_eq_swap_pred:
2379 ; CHECK-NEXT: mvn v0.16b, v0.16b
2380 ; CHECK-NEXT: mvn v1.16b, v1.16b
2381 ; CHECK-NEXT: mvn v2.16b, v2.16b
2382 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2383 ; CHECK-NEXT: umax v1.4s, v2.4s, v1.4s
2384 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2386 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2387 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2388 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2389 %cmp_ab = icmp ugt <4 x i32> %a, %b
2390 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2391 %cmp_cb = icmp ugt <4 x i32> %c, %b
2392 %min_cb = select <4 x i1> %cmp_cb, <4 x i32> %c, <4 x i32> %b
2393 %cmp_ac = icmp ule <4 x i32> %x, %z
2394 %r = select <4 x i1> %cmp_ac, <4 x i32> %min_ab, <4 x i32> %min_cb
2398 define <4 x i32> @notted_umax_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2399 ; CHECK-LABEL: notted_umax_bc_ab_eq_swap_pred:
2401 ; CHECK-NEXT: mvn v0.16b, v0.16b
2402 ; CHECK-NEXT: mvn v1.16b, v1.16b
2403 ; CHECK-NEXT: mvn v2.16b, v2.16b
2404 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2405 ; CHECK-NEXT: umax v0.4s, v0.4s, v1.4s
2406 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2408 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2409 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2410 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2411 %cmp_bc = icmp ugt <4 x i32> %b, %c
2412 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2413 %cmp_ab = icmp ugt <4 x i32> %a, %b
2414 %min_ab = select <4 x i1> %cmp_ab, <4 x i32> %a, <4 x i32> %b
2415 %cmp_ca = icmp ule <4 x i32> %z, %x
2416 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ab
2420 define <4 x i32> @notted_umax_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
2421 ; CHECK-LABEL: notted_umax_bc_ba_eq_swap_pred:
2423 ; CHECK-NEXT: mvn v0.16b, v0.16b
2424 ; CHECK-NEXT: mvn v1.16b, v1.16b
2425 ; CHECK-NEXT: mvn v2.16b, v2.16b
2426 ; CHECK-NEXT: umax v2.4s, v1.4s, v2.4s
2427 ; CHECK-NEXT: umax v0.4s, v1.4s, v0.4s
2428 ; CHECK-NEXT: umax v0.4s, v2.4s, v0.4s
2430 %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1>
2431 %b = xor <4 x i32> %y, <i32 -1, i32 -1, i32 -1, i32 -1>
2432 %c = xor <4 x i32> %z, <i32 -1, i32 -1, i32 -1, i32 -1>
2433 %cmp_bc = icmp ugt <4 x i32> %b, %c
2434 %min_bc = select <4 x i1> %cmp_bc, <4 x i32> %b, <4 x i32> %c
2435 %cmp_ba = icmp ugt <4 x i32> %b, %a
2436 %min_ba = select <4 x i1> %cmp_ba, <4 x i32> %b, <4 x i32> %a
2437 %cmp_ca = icmp ule <4 x i32> %z, %x
2438 %r = select <4 x i1> %cmp_ca, <4 x i32> %min_bc, <4 x i32> %min_ba