• Home
  • Raw
  • Download

Lines Matching full:4

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) {
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
23 ret <4 x i32> %r
26 define <4 x i32> @smin_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
39 ret <4 x i32> %r
42 define <4 x i32> @smin_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
55 ret <4 x i32> %r
58 define <4 x i32> @smin_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
71 ret <4 x i32> %r
74 define <4 x i32> @smin_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
87 ret <4 x i32> %r
90 define <4 x i32> @smin_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
103 ret <4 x i32> %r
106 define <4 x i32> @smin_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
119 ret <4 x i32> %r
122 define <4 x i32> @smin_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
135 ret <4 x i32> %r
138 define <4 x i32> @smin_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
151 ret <4 x i32> %r
154 define <4 x i32> @smin_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
167 ret <4 x i32> %r
170 define <4 x i32> @smin_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
183 ret <4 x i32> %r
186 define <4 x i32> @smin_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
199 ret <4 x i32> %r
202 define <4 x i32> @smin_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
215 ret <4 x i32> %r
218 define <4 x i32> @smin_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
231 ret <4 x i32> %r
234 define <4 x i32> @smin_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
247 ret <4 x i32> %r
250 define <4 x i32> @smin_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
263 ret <4 x i32> %r
266 define <4 x i32> @smax_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
279 ret <4 x i32> %r
282 define <4 x i32> @smax_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
295 ret <4 x i32> %r
298 define <4 x i32> @smax_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
311 ret <4 x i32> %r
314 define <4 x i32> @smax_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
327 ret <4 x i32> %r
330 define <4 x i32> @smax_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
343 ret <4 x i32> %r
346 define <4 x i32> @smax_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
359 ret <4 x i32> %r
362 define <4 x i32> @smax_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
375 ret <4 x i32> %r
378 define <4 x i32> @smax_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
391 ret <4 x i32> %r
394 define <4 x i32> @smax_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
407 ret <4 x i32> %r
410 define <4 x i32> @smax_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
423 ret <4 x i32> %r
426 define <4 x i32> @smax_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
439 ret <4 x i32> %r
442 define <4 x i32> @smax_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
455 ret <4 x i32> %r
458 define <4 x i32> @smax_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
471 ret <4 x i32> %r
474 define <4 x i32> @smax_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
487 ret <4 x i32> %r
490 define <4 x i32> @smax_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
503 ret <4 x i32> %r
506 define <4 x i32> @smax_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
519 ret <4 x i32> %r
522 define <4 x i32> @umin_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
535 ret <4 x i32> %r
538 define <4 x i32> @umin_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
551 ret <4 x i32> %r
554 define <4 x i32> @umin_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
567 ret <4 x i32> %r
570 define <4 x i32> @umin_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
583 ret <4 x i32> %r
586 define <4 x i32> @umin_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
599 ret <4 x i32> %r
602 define <4 x i32> @umin_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
615 ret <4 x i32> %r
618 define <4 x i32> @umin_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
631 ret <4 x i32> %r
634 define <4 x i32> @umin_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
647 ret <4 x i32> %r
650 define <4 x i32> @umin_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
663 ret <4 x i32> %r
666 define <4 x i32> @umin_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
679 ret <4 x i32> %r
682 define <4 x i32> @umin_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
695 ret <4 x i32> %r
698 define <4 x i32> @umin_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
711 ret <4 x i32> %r
714 define <4 x i32> @umin_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
727 ret <4 x i32> %r
730 define <4 x i32> @umin_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
743 ret <4 x i32> %r
746 define <4 x i32> @umin_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
759 ret <4 x i32> %r
762 define <4 x i32> @umin_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
775 ret <4 x i32> %r
778 define <4 x i32> @umax_ab_bc(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
791 ret <4 x i32> %r
794 define <4 x i32> @umax_ab_cb(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
807 ret <4 x i32> %r
810 define <4 x i32> @umax_bc_ab(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
823 ret <4 x i32> %r
826 define <4 x i32> @umax_bc_ba(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
839 ret <4 x i32> %r
842 define <4 x i32> @umax_ab_bc_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
855 ret <4 x i32> %r
858 define <4 x i32> @umax_ab_cb_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
871 ret <4 x i32> %r
874 define <4 x i32> @umax_bc_ab_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
887 ret <4 x i32> %r
890 define <4 x i32> @umax_bc_ba_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
903 ret <4 x i32> %r
906 define <4 x i32> @umax_ab_bc_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
919 ret <4 x i32> %r
922 define <4 x i32> @umax_ab_cb_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
935 ret <4 x i32> %r
938 define <4 x i32> @umax_bc_ab_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
951 ret <4 x i32> %r
954 define <4 x i32> @umax_bc_ba_eq_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
967 ret <4 x i32> %r
970 define <4 x i32> @umax_ab_bc_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
983 ret <4 x i32> %r
986 define <4 x i32> @umax_ab_cb_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
999 ret <4 x i32> %r
1002 define <4 x i32> @umax_bc_ab_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
1015 ret <4 x i32> %r
1018 define <4 x i32> @umax_bc_ba_eq_swap_pred(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c) {
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
1031 ret <4 x i32> %r
1034 define <4 x i32> @notted_smin_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1053 ret <4 x i32> %r
1056 define <4 x i32> @notted_smin_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1075 ret <4 x i32> %r
1078 define <4 x i32> @notted_smin_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1097 ret <4 x i32> %r
1100 define <4 x i32> @notted_smin_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1119 ret <4 x i32> %r
1122 define <4 x i32> @notted_smin_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1141 ret <4 x i32> %r
1144 define <4 x i32> @notted_smin_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1163 ret <4 x i32> %r
1166 define <4 x i32> @notted_smin_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1185 ret <4 x i32> %r
1188 define <4 x i32> @notted_smin_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1207 ret <4 x i32> %r
1210 define <4 x i32> @notted_smin_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1229 ret <4 x i32> %r
1232 define <4 x i32> @notted_smin_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1251 ret <4 x i32> %r
1254 define <4 x i32> @notted_smin_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1273 ret <4 x i32> %r
1276 define <4 x i32> @notted_smin_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1295 ret <4 x i32> %r
1298 define <4 x i32> @notted_smin_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1317 ret <4 x i32> %r
1320 define <4 x i32> @notted_smin_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1339 ret <4 x i32> %r
1342 define <4 x i32> @notted_smin_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1361 ret <4 x i32> %r
1364 define <4 x i32> @notted_smin_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1383 ret <4 x i32> %r
1386 define <4 x i32> @notted_smax_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1405 ret <4 x i32> %r
1408 define <4 x i32> @notted_smax_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1427 ret <4 x i32> %r
1430 define <4 x i32> @notted_smax_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1449 ret <4 x i32> %r
1452 define <4 x i32> @notted_smax_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1471 ret <4 x i32> %r
1474 define <4 x i32> @notted_smax_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1493 ret <4 x i32> %r
1496 define <4 x i32> @notted_smax_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1515 ret <4 x i32> %r
1518 define <4 x i32> @notted_smax_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1537 ret <4 x i32> %r
1540 define <4 x i32> @notted_smax_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1559 ret <4 x i32> %r
1562 define <4 x i32> @notted_smax_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1581 ret <4 x i32> %r
1584 define <4 x i32> @notted_smax_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1603 ret <4 x i32> %r
1606 define <4 x i32> @notted_smax_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1625 ret <4 x i32> %r
1628 define <4 x i32> @notted_smax_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1647 ret <4 x i32> %r
1650 define <4 x i32> @notted_smax_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1669 ret <4 x i32> %r
1672 define <4 x i32> @notted_smax_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1691 ret <4 x i32> %r
1694 define <4 x i32> @notted_smax_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1713 ret <4 x i32> %r
1716 define <4 x i32> @notted_smax_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1735 ret <4 x i32> %r
1738 define <4 x i32> @notted_umin_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1757 ret <4 x i32> %r
1760 define <4 x i32> @notted_umin_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1779 ret <4 x i32> %r
1782 define <4 x i32> @notted_umin_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1801 ret <4 x i32> %r
1804 define <4 x i32> @notted_umin_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1823 ret <4 x i32> %r
1826 define <4 x i32> @notted_umin_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1845 ret <4 x i32> %r
1848 define <4 x i32> @notted_umin_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1867 ret <4 x i32> %r
1870 define <4 x i32> @notted_umin_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1889 ret <4 x i32> %r
1892 define <4 x i32> @notted_umin_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1911 ret <4 x i32> %r
1914 define <4 x i32> @notted_umin_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1933 ret <4 x i32> %r
1936 define <4 x i32> @notted_umin_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1955 ret <4 x i32> %r
1958 define <4 x i32> @notted_umin_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1977 ret <4 x i32> %r
1980 define <4 x i32> @notted_umin_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
1999 ret <4 x i32> %r
2002 define <4 x i32> @notted_umin_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2021 ret <4 x i32> %r
2024 define <4 x i32> @notted_umin_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2043 ret <4 x i32> %r
2046 define <4 x i32> @notted_umin_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2065 ret <4 x i32> %r
2068 define <4 x i32> @notted_umin_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2087 ret <4 x i32> %r
2090 define <4 x i32> @notted_umax_ab_bc(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2109 ret <4 x i32> %r
2112 define <4 x i32> @notted_umax_ab_cb(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2131 ret <4 x i32> %r
2134 define <4 x i32> @notted_umax_bc_ab(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2153 ret <4 x i32> %r
2156 define <4 x i32> @notted_umax_bc_ba(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2175 ret <4 x i32> %r
2178 define <4 x i32> @notted_umax_ab_bc_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2197 ret <4 x i32> %r
2200 define <4 x i32> @notted_umax_ab_cb_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2219 ret <4 x i32> %r
2222 define <4 x i32> @notted_umax_bc_ab_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2241 ret <4 x i32> %r
2244 define <4 x i32> @notted_umax_bc_ba_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2263 ret <4 x i32> %r
2266 define <4 x i32> @notted_umax_ab_bc_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2285 ret <4 x i32> %r
2288 define <4 x i32> @notted_umax_ab_cb_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2307 ret <4 x i32> %r
2310 define <4 x i32> @notted_umax_bc_ab_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2329 ret <4 x i32> %r
2332 define <4 x i32> @notted_umax_bc_ba_eq_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2351 ret <4 x i32> %r
2354 define <4 x i32> @notted_umax_ab_bc_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2373 ret <4 x i32> %r
2376 define <4 x i32> @notted_umax_ab_cb_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2395 ret <4 x i32> %r
2398 define <4 x i32> @notted_umax_bc_ab_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2417 ret <4 x i32> %r
2420 define <4 x i32> @notted_umax_bc_ba_eq_swap_pred(<4 x i32> %x, <4 x i32> %y, <4 x i32> %z) {
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
2439 ret <4 x i32> %r