1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=aarch64 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3 ; RUN: llc -mtriple=aarch64 -global-isel -global-isel-abort=2 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
5 define i64 @i64_i64(i64 %a, i64 %b, i64 %d, i64 %e) {
6 ; CHECK-LABEL: i64_i64:
7 ; CHECK: // %bb.0: // %entry
8 ; CHECK-NEXT: cmp x0, x1
9 ; CHECK-NEXT: csel x0, x2, x3, lt
12 %c = icmp slt i64 %a, %b
13 %s = select i1 %c, i64 %d, i64 %e
17 define i32 @i32_i32(i32 %a, i32 %b, i32 %d, i32 %e) {
18 ; CHECK-LABEL: i32_i32:
19 ; CHECK: // %bb.0: // %entry
20 ; CHECK-NEXT: cmp w0, w1
21 ; CHECK-NEXT: csel w0, w2, w3, lt
24 %c = icmp slt i32 %a, %b
25 %s = select i1 %c, i32 %d, i32 %e
29 define i16 @i16_i16(i16 %a, i16 %b, i16 %d, i16 %e) {
30 ; CHECK-LABEL: i16_i16:
31 ; CHECK: // %bb.0: // %entry
32 ; CHECK-NEXT: sxth w8, w0
33 ; CHECK-NEXT: cmp w8, w1, sxth
34 ; CHECK-NEXT: csel w0, w2, w3, lt
37 %c = icmp slt i16 %a, %b
38 %s = select i1 %c, i16 %d, i16 %e
42 define i8 @i8_i8(i8 %a, i8 %b, i8 %d, i8 %e) {
44 ; CHECK: // %bb.0: // %entry
45 ; CHECK-NEXT: sxtb w8, w0
46 ; CHECK-NEXT: cmp w8, w1, sxtb
47 ; CHECK-NEXT: csel w0, w2, w3, lt
50 %c = icmp slt i8 %a, %b
51 %s = select i1 %c, i8 %d, i8 %e
55 define <2 x i1> @test_v2i64_eq(<2 x i64> %v1, <2 x i64> %v2) {
56 ; CHECK-LABEL: test_v2i64_eq:
58 ; CHECK-NEXT: cmeq v0.2d, v0.2d, v1.2d
59 ; CHECK-NEXT: xtn v0.2s, v0.2d
61 %cmp = icmp eq <2 x i64> %v1, %v2
65 define <4 x i1> @test_v4i64_eq(<4 x i64> %v1, <4 x i64> %v2) {
66 ; CHECK-SD-LABEL: test_v4i64_eq:
67 ; CHECK-SD: // %bb.0: // %entry
68 ; CHECK-SD-NEXT: cmeq v1.2d, v1.2d, v3.2d
69 ; CHECK-SD-NEXT: cmeq v0.2d, v0.2d, v2.2d
70 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
71 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
74 ; CHECK-GI-LABEL: test_v4i64_eq:
75 ; CHECK-GI: // %bb.0: // %entry
76 ; CHECK-GI-NEXT: cmeq v0.2d, v0.2d, v2.2d
77 ; CHECK-GI-NEXT: cmeq v1.2d, v1.2d, v3.2d
78 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
79 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
82 %cmp = icmp eq <4 x i64> %v1, %v2
86 define <4 x i1> @test_v4i32_eq(<4 x i32> %v1, <4 x i32> %v2) {
87 ; CHECK-LABEL: test_v4i32_eq:
89 ; CHECK-NEXT: cmeq v0.4s, v0.4s, v1.4s
90 ; CHECK-NEXT: xtn v0.4h, v0.4s
92 %cmp = icmp eq <4 x i32> %v1, %v2
96 define <2 x i1> @test_v2i32_eq(<2 x i32> %v1, <2 x i32> %v2) {
97 ; CHECK-LABEL: test_v2i32_eq:
99 ; CHECK-NEXT: cmeq v0.2s, v0.2s, v1.2s
101 %cmp = icmp eq <2 x i32> %v1, %v2
105 define <2 x i1> @test_v2i16_eq(<2 x i16> %v1, <2 x i16> %v2) {
106 ; CHECK-SD-LABEL: test_v2i16_eq:
107 ; CHECK-SD: // %bb.0:
108 ; CHECK-SD-NEXT: movi d2, #0x00ffff0000ffff
109 ; CHECK-SD-NEXT: and v1.8b, v1.8b, v2.8b
110 ; CHECK-SD-NEXT: and v0.8b, v0.8b, v2.8b
111 ; CHECK-SD-NEXT: cmeq v0.2s, v0.2s, v1.2s
114 ; CHECK-GI-LABEL: test_v2i16_eq:
115 ; CHECK-GI: // %bb.0:
116 ; CHECK-GI-NEXT: movi d2, #0x00ffff0000ffff
117 ; CHECK-GI-NEXT: and v0.8b, v0.8b, v2.8b
118 ; CHECK-GI-NEXT: and v1.8b, v1.8b, v2.8b
119 ; CHECK-GI-NEXT: cmeq v0.2s, v0.2s, v1.2s
121 %cmp = icmp eq <2 x i16> %v1, %v2
125 define <8 x i1> @test_v8i16_eq(<8 x i16> %v1, <8 x i16> %v2) {
126 ; CHECK-LABEL: test_v8i16_eq:
128 ; CHECK-NEXT: cmeq v0.8h, v0.8h, v1.8h
129 ; CHECK-NEXT: xtn v0.8b, v0.8h
131 %cmp = icmp eq <8 x i16> %v1, %v2
135 define <4 x i1> @test_v4i16_eq(<4 x i16> %v1, <4 x i16> %v2) {
136 ; CHECK-LABEL: test_v4i16_eq:
138 ; CHECK-NEXT: cmeq v0.4h, v0.4h, v1.4h
140 %cmp = icmp eq <4 x i16> %v1, %v2
144 define <16 x i1> @test_v16i8_eq(<16 x i8> %v1, <16 x i8> %v2) {
145 ; CHECK-LABEL: test_v16i8_eq:
147 ; CHECK-NEXT: cmeq v0.16b, v0.16b, v1.16b
149 %cmp = icmp eq <16 x i8> %v1, %v2
153 define <8 x i1> @test_v8i8_eq(<8 x i8> %v1, <8 x i8> %v2) {
154 ; CHECK-LABEL: test_v8i8_eq:
156 ; CHECK-NEXT: cmeq v0.8b, v0.8b, v1.8b
158 %cmp = icmp eq <8 x i8> %v1, %v2
162 define <2 x i1> @test_v2i64_ne(<2 x i64> %v1, <2 x i64> %v2) {
163 ; CHECK-LABEL: test_v2i64_ne:
165 ; CHECK-NEXT: cmeq v0.2d, v0.2d, v1.2d
166 ; CHECK-NEXT: mvn v0.16b, v0.16b
167 ; CHECK-NEXT: xtn v0.2s, v0.2d
169 %cmp = icmp ne <2 x i64> %v1, %v2
173 define <4 x i1> @test_v4i64_ne(<4 x i64> %v1, <4 x i64> %v2) {
174 ; CHECK-SD-LABEL: test_v4i64_ne:
175 ; CHECK-SD: // %bb.0: // %entry
176 ; CHECK-SD-NEXT: cmeq v1.2d, v1.2d, v3.2d
177 ; CHECK-SD-NEXT: cmeq v0.2d, v0.2d, v2.2d
178 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
179 ; CHECK-SD-NEXT: mvn v0.16b, v0.16b
180 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
183 ; CHECK-GI-LABEL: test_v4i64_ne:
184 ; CHECK-GI: // %bb.0: // %entry
185 ; CHECK-GI-NEXT: cmeq v0.2d, v0.2d, v2.2d
186 ; CHECK-GI-NEXT: cmeq v1.2d, v1.2d, v3.2d
187 ; CHECK-GI-NEXT: mvn v0.16b, v0.16b
188 ; CHECK-GI-NEXT: mvn v1.16b, v1.16b
189 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
190 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
193 %cmp = icmp ne <4 x i64> %v1, %v2
197 define <4 x i1> @test_v4i32_ne(<4 x i32> %v1, <4 x i32> %v2) {
198 ; CHECK-LABEL: test_v4i32_ne:
200 ; CHECK-NEXT: cmeq v0.4s, v0.4s, v1.4s
201 ; CHECK-NEXT: mvn v0.16b, v0.16b
202 ; CHECK-NEXT: xtn v0.4h, v0.4s
204 %cmp = icmp ne <4 x i32> %v1, %v2
208 define <2 x i1> @test_v2i32_ne(<2 x i32> %v1, <2 x i32> %v2) {
209 ; CHECK-LABEL: test_v2i32_ne:
211 ; CHECK-NEXT: cmeq v0.2s, v0.2s, v1.2s
212 ; CHECK-NEXT: mvn v0.8b, v0.8b
214 %cmp = icmp ne <2 x i32> %v1, %v2
218 define <2 x i1> @test_v2i16_ne(<2 x i16> %v1, <2 x i16> %v2) {
219 ; CHECK-SD-LABEL: test_v2i16_ne:
220 ; CHECK-SD: // %bb.0:
221 ; CHECK-SD-NEXT: movi d2, #0x00ffff0000ffff
222 ; CHECK-SD-NEXT: and v1.8b, v1.8b, v2.8b
223 ; CHECK-SD-NEXT: and v0.8b, v0.8b, v2.8b
224 ; CHECK-SD-NEXT: cmeq v0.2s, v0.2s, v1.2s
225 ; CHECK-SD-NEXT: mvn v0.8b, v0.8b
228 ; CHECK-GI-LABEL: test_v2i16_ne:
229 ; CHECK-GI: // %bb.0:
230 ; CHECK-GI-NEXT: movi d2, #0x00ffff0000ffff
231 ; CHECK-GI-NEXT: and v0.8b, v0.8b, v2.8b
232 ; CHECK-GI-NEXT: and v1.8b, v1.8b, v2.8b
233 ; CHECK-GI-NEXT: cmeq v0.2s, v0.2s, v1.2s
234 ; CHECK-GI-NEXT: mvn v0.8b, v0.8b
236 %cmp = icmp ne <2 x i16> %v1, %v2
240 define <8 x i1> @test_v8i16_ne(<8 x i16> %v1, <8 x i16> %v2) {
241 ; CHECK-LABEL: test_v8i16_ne:
243 ; CHECK-NEXT: cmeq v0.8h, v0.8h, v1.8h
244 ; CHECK-NEXT: mvn v0.16b, v0.16b
245 ; CHECK-NEXT: xtn v0.8b, v0.8h
247 %cmp = icmp ne <8 x i16> %v1, %v2
251 define <4 x i1> @test_v4i16_ne(<4 x i16> %v1, <4 x i16> %v2) {
252 ; CHECK-LABEL: test_v4i16_ne:
254 ; CHECK-NEXT: cmeq v0.4h, v0.4h, v1.4h
255 ; CHECK-NEXT: mvn v0.8b, v0.8b
257 %cmp = icmp ne <4 x i16> %v1, %v2
261 define <16 x i1> @test_v16i8_ne(<16 x i8> %v1, <16 x i8> %v2) {
262 ; CHECK-LABEL: test_v16i8_ne:
264 ; CHECK-NEXT: cmeq v0.16b, v0.16b, v1.16b
265 ; CHECK-NEXT: mvn v0.16b, v0.16b
267 %cmp = icmp ne <16 x i8> %v1, %v2
271 define <8 x i1> @test_v8i8_ne(<8 x i8> %v1, <8 x i8> %v2) {
272 ; CHECK-LABEL: test_v8i8_ne:
274 ; CHECK-NEXT: cmeq v0.8b, v0.8b, v1.8b
275 ; CHECK-NEXT: mvn v0.8b, v0.8b
277 %cmp = icmp ne <8 x i8> %v1, %v2
281 define <2 x i1> @test_v2i64_ugt(<2 x i64> %v1, <2 x i64> %v2) {
282 ; CHECK-LABEL: test_v2i64_ugt:
284 ; CHECK-NEXT: cmhi v0.2d, v0.2d, v1.2d
285 ; CHECK-NEXT: xtn v0.2s, v0.2d
287 %cmp = icmp ugt <2 x i64> %v1, %v2
291 define <4 x i1> @test_v4i64_ugt(<4 x i64> %v1, <4 x i64> %v2) {
292 ; CHECK-SD-LABEL: test_v4i64_ugt:
293 ; CHECK-SD: // %bb.0: // %entry
294 ; CHECK-SD-NEXT: cmhi v1.2d, v1.2d, v3.2d
295 ; CHECK-SD-NEXT: cmhi v0.2d, v0.2d, v2.2d
296 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
297 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
300 ; CHECK-GI-LABEL: test_v4i64_ugt:
301 ; CHECK-GI: // %bb.0: // %entry
302 ; CHECK-GI-NEXT: cmhi v0.2d, v0.2d, v2.2d
303 ; CHECK-GI-NEXT: cmhi v1.2d, v1.2d, v3.2d
304 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
305 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
308 %cmp = icmp ugt <4 x i64> %v1, %v2
312 define <4 x i1> @test_v4i32_ugt(<4 x i32> %v1, <4 x i32> %v2) {
313 ; CHECK-LABEL: test_v4i32_ugt:
315 ; CHECK-NEXT: cmhi v0.4s, v0.4s, v1.4s
316 ; CHECK-NEXT: xtn v0.4h, v0.4s
318 %cmp = icmp ugt <4 x i32> %v1, %v2
322 define <2 x i1> @test_v2i32_ugt(<2 x i32> %v1, <2 x i32> %v2) {
323 ; CHECK-LABEL: test_v2i32_ugt:
325 ; CHECK-NEXT: cmhi v0.2s, v0.2s, v1.2s
327 %cmp = icmp ugt <2 x i32> %v1, %v2
331 define <2 x i1> @test_v2i16_ugt(<2 x i16> %v1, <2 x i16> %v2) {
332 ; CHECK-SD-LABEL: test_v2i16_ugt:
333 ; CHECK-SD: // %bb.0:
334 ; CHECK-SD-NEXT: movi d2, #0x00ffff0000ffff
335 ; CHECK-SD-NEXT: and v1.8b, v1.8b, v2.8b
336 ; CHECK-SD-NEXT: and v0.8b, v0.8b, v2.8b
337 ; CHECK-SD-NEXT: cmhi v0.2s, v0.2s, v1.2s
340 ; CHECK-GI-LABEL: test_v2i16_ugt:
341 ; CHECK-GI: // %bb.0:
342 ; CHECK-GI-NEXT: movi d2, #0x00ffff0000ffff
343 ; CHECK-GI-NEXT: and v0.8b, v0.8b, v2.8b
344 ; CHECK-GI-NEXT: and v1.8b, v1.8b, v2.8b
345 ; CHECK-GI-NEXT: cmhi v0.2s, v0.2s, v1.2s
347 %cmp = icmp ugt <2 x i16> %v1, %v2
351 define <8 x i1> @test_v8i16_ugt(<8 x i16> %v1, <8 x i16> %v2) {
352 ; CHECK-LABEL: test_v8i16_ugt:
354 ; CHECK-NEXT: cmhi v0.8h, v0.8h, v1.8h
355 ; CHECK-NEXT: xtn v0.8b, v0.8h
357 %cmp = icmp ugt <8 x i16> %v1, %v2
361 define <4 x i1> @test_v4i16_ugt(<4 x i16> %v1, <4 x i16> %v2) {
362 ; CHECK-LABEL: test_v4i16_ugt:
364 ; CHECK-NEXT: cmhi v0.4h, v0.4h, v1.4h
366 %cmp = icmp ugt <4 x i16> %v1, %v2
370 define <16 x i1> @test_v16i8_ugt(<16 x i8> %v1, <16 x i8> %v2) {
371 ; CHECK-LABEL: test_v16i8_ugt:
373 ; CHECK-NEXT: cmhi v0.16b, v0.16b, v1.16b
375 %cmp = icmp ugt <16 x i8> %v1, %v2
379 define <8 x i1> @test_v8i8_ugt(<8 x i8> %v1, <8 x i8> %v2) {
380 ; CHECK-LABEL: test_v8i8_ugt:
382 ; CHECK-NEXT: cmhi v0.8b, v0.8b, v1.8b
384 %cmp = icmp ugt <8 x i8> %v1, %v2
388 define <2 x i1> @test_v2i64_uge(<2 x i64> %v1, <2 x i64> %v2) {
389 ; CHECK-LABEL: test_v2i64_uge:
391 ; CHECK-NEXT: cmhs v0.2d, v0.2d, v1.2d
392 ; CHECK-NEXT: xtn v0.2s, v0.2d
394 %cmp = icmp uge <2 x i64> %v1, %v2
398 define <4 x i1> @test_v4i64_uge(<4 x i64> %v1, <4 x i64> %v2) {
399 ; CHECK-SD-LABEL: test_v4i64_uge:
400 ; CHECK-SD: // %bb.0: // %entry
401 ; CHECK-SD-NEXT: cmhs v1.2d, v1.2d, v3.2d
402 ; CHECK-SD-NEXT: cmhs v0.2d, v0.2d, v2.2d
403 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
404 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
407 ; CHECK-GI-LABEL: test_v4i64_uge:
408 ; CHECK-GI: // %bb.0: // %entry
409 ; CHECK-GI-NEXT: cmhs v0.2d, v0.2d, v2.2d
410 ; CHECK-GI-NEXT: cmhs v1.2d, v1.2d, v3.2d
411 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
412 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
415 %cmp = icmp uge <4 x i64> %v1, %v2
419 define <4 x i1> @test_v4i32_uge(<4 x i32> %v1, <4 x i32> %v2) {
420 ; CHECK-LABEL: test_v4i32_uge:
422 ; CHECK-NEXT: cmhs v0.4s, v0.4s, v1.4s
423 ; CHECK-NEXT: xtn v0.4h, v0.4s
425 %cmp = icmp uge <4 x i32> %v1, %v2
429 define <2 x i1> @test_v2i32_uge(<2 x i32> %v1, <2 x i32> %v2) {
430 ; CHECK-LABEL: test_v2i32_uge:
432 ; CHECK-NEXT: cmhs v0.2s, v0.2s, v1.2s
434 %cmp = icmp uge <2 x i32> %v1, %v2
438 define <2 x i1> @test_v2i16_uge(<2 x i16> %v1, <2 x i16> %v2) {
439 ; CHECK-SD-LABEL: test_v2i16_uge:
440 ; CHECK-SD: // %bb.0:
441 ; CHECK-SD-NEXT: movi d2, #0x00ffff0000ffff
442 ; CHECK-SD-NEXT: and v1.8b, v1.8b, v2.8b
443 ; CHECK-SD-NEXT: and v0.8b, v0.8b, v2.8b
444 ; CHECK-SD-NEXT: cmhs v0.2s, v0.2s, v1.2s
447 ; CHECK-GI-LABEL: test_v2i16_uge:
448 ; CHECK-GI: // %bb.0:
449 ; CHECK-GI-NEXT: movi d2, #0x00ffff0000ffff
450 ; CHECK-GI-NEXT: and v0.8b, v0.8b, v2.8b
451 ; CHECK-GI-NEXT: and v1.8b, v1.8b, v2.8b
452 ; CHECK-GI-NEXT: cmhs v0.2s, v0.2s, v1.2s
454 %cmp = icmp uge <2 x i16> %v1, %v2
458 define <8 x i1> @test_v8i16_uge(<8 x i16> %v1, <8 x i16> %v2) {
459 ; CHECK-LABEL: test_v8i16_uge:
461 ; CHECK-NEXT: cmhs v0.8h, v0.8h, v1.8h
462 ; CHECK-NEXT: xtn v0.8b, v0.8h
464 %cmp = icmp uge <8 x i16> %v1, %v2
468 define <4 x i1> @test_v4i16_uge(<4 x i16> %v1, <4 x i16> %v2) {
469 ; CHECK-LABEL: test_v4i16_uge:
471 ; CHECK-NEXT: cmhs v0.4h, v0.4h, v1.4h
473 %cmp = icmp uge <4 x i16> %v1, %v2
477 define <16 x i1> @test_v16i8_uge(<16 x i8> %v1, <16 x i8> %v2) {
478 ; CHECK-LABEL: test_v16i8_uge:
480 ; CHECK-NEXT: cmhs v0.16b, v0.16b, v1.16b
482 %cmp = icmp uge <16 x i8> %v1, %v2
486 define <8 x i1> @test_v8i8_uge(<8 x i8> %v1, <8 x i8> %v2) {
487 ; CHECK-LABEL: test_v8i8_uge:
489 ; CHECK-NEXT: cmhs v0.8b, v0.8b, v1.8b
491 %cmp = icmp uge <8 x i8> %v1, %v2
495 define <2 x i1> @test_v2i64_ult(<2 x i64> %v1, <2 x i64> %v2) {
496 ; CHECK-LABEL: test_v2i64_ult:
498 ; CHECK-NEXT: cmhi v0.2d, v1.2d, v0.2d
499 ; CHECK-NEXT: xtn v0.2s, v0.2d
501 %cmp = icmp ult <2 x i64> %v1, %v2
505 define <4 x i1> @test_v4i64_ult(<4 x i64> %v1, <4 x i64> %v2) {
506 ; CHECK-SD-LABEL: test_v4i64_ult:
507 ; CHECK-SD: // %bb.0: // %entry
508 ; CHECK-SD-NEXT: cmhi v1.2d, v3.2d, v1.2d
509 ; CHECK-SD-NEXT: cmhi v0.2d, v2.2d, v0.2d
510 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
511 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
514 ; CHECK-GI-LABEL: test_v4i64_ult:
515 ; CHECK-GI: // %bb.0: // %entry
516 ; CHECK-GI-NEXT: cmhi v0.2d, v2.2d, v0.2d
517 ; CHECK-GI-NEXT: cmhi v1.2d, v3.2d, v1.2d
518 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
519 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
522 %cmp = icmp ult <4 x i64> %v1, %v2
526 define <4 x i1> @test_v4i32_ult(<4 x i32> %v1, <4 x i32> %v2) {
527 ; CHECK-LABEL: test_v4i32_ult:
529 ; CHECK-NEXT: cmhi v0.4s, v1.4s, v0.4s
530 ; CHECK-NEXT: xtn v0.4h, v0.4s
532 %cmp = icmp ult <4 x i32> %v1, %v2
536 define <2 x i1> @test_v2i32_ult(<2 x i32> %v1, <2 x i32> %v2) {
537 ; CHECK-LABEL: test_v2i32_ult:
539 ; CHECK-NEXT: cmhi v0.2s, v1.2s, v0.2s
541 %cmp = icmp ult <2 x i32> %v1, %v2
545 define <2 x i1> @test_v2i16_ult(<2 x i16> %v1, <2 x i16> %v2) {
546 ; CHECK-LABEL: test_v2i16_ult:
548 ; CHECK-NEXT: movi d2, #0x00ffff0000ffff
549 ; CHECK-NEXT: and v0.8b, v0.8b, v2.8b
550 ; CHECK-NEXT: and v1.8b, v1.8b, v2.8b
551 ; CHECK-NEXT: cmhi v0.2s, v1.2s, v0.2s
553 %cmp = icmp ult <2 x i16> %v1, %v2
557 define <8 x i1> @test_v8i16_ult(<8 x i16> %v1, <8 x i16> %v2) {
558 ; CHECK-LABEL: test_v8i16_ult:
560 ; CHECK-NEXT: cmhi v0.8h, v1.8h, v0.8h
561 ; CHECK-NEXT: xtn v0.8b, v0.8h
563 %cmp = icmp ult <8 x i16> %v1, %v2
567 define <4 x i1> @test_v4i16_ult(<4 x i16> %v1, <4 x i16> %v2) {
568 ; CHECK-LABEL: test_v4i16_ult:
570 ; CHECK-NEXT: cmhi v0.4h, v1.4h, v0.4h
572 %cmp = icmp ult <4 x i16> %v1, %v2
576 define <16 x i1> @test_v16i8_ult(<16 x i8> %v1, <16 x i8> %v2) {
577 ; CHECK-LABEL: test_v16i8_ult:
579 ; CHECK-NEXT: cmhi v0.16b, v1.16b, v0.16b
581 %cmp = icmp ult <16 x i8> %v1, %v2
585 define <8 x i1> @test_v8i8_ult(<8 x i8> %v1, <8 x i8> %v2) {
586 ; CHECK-LABEL: test_v8i8_ult:
588 ; CHECK-NEXT: cmhi v0.8b, v1.8b, v0.8b
590 %cmp = icmp ult <8 x i8> %v1, %v2
594 define <2 x i1> @test_v2i64_ule(<2 x i64> %v1, <2 x i64> %v2) {
595 ; CHECK-LABEL: test_v2i64_ule:
597 ; CHECK-NEXT: cmhs v0.2d, v1.2d, v0.2d
598 ; CHECK-NEXT: xtn v0.2s, v0.2d
600 %cmp = icmp ule <2 x i64> %v1, %v2
604 define <4 x i1> @test_v4i64_ule(<4 x i64> %v1, <4 x i64> %v2) {
605 ; CHECK-SD-LABEL: test_v4i64_ule:
606 ; CHECK-SD: // %bb.0: // %entry
607 ; CHECK-SD-NEXT: cmhs v1.2d, v3.2d, v1.2d
608 ; CHECK-SD-NEXT: cmhs v0.2d, v2.2d, v0.2d
609 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
610 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
613 ; CHECK-GI-LABEL: test_v4i64_ule:
614 ; CHECK-GI: // %bb.0: // %entry
615 ; CHECK-GI-NEXT: cmhs v0.2d, v2.2d, v0.2d
616 ; CHECK-GI-NEXT: cmhs v1.2d, v3.2d, v1.2d
617 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
618 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
621 %cmp = icmp ule <4 x i64> %v1, %v2
625 define <4 x i1> @test_v4i32_ule(<4 x i32> %v1, <4 x i32> %v2) {
626 ; CHECK-LABEL: test_v4i32_ule:
628 ; CHECK-NEXT: cmhs v0.4s, v1.4s, v0.4s
629 ; CHECK-NEXT: xtn v0.4h, v0.4s
631 %cmp = icmp ule <4 x i32> %v1, %v2
635 define <2 x i1> @test_v2i32_ule(<2 x i32> %v1, <2 x i32> %v2) {
636 ; CHECK-LABEL: test_v2i32_ule:
638 ; CHECK-NEXT: cmhs v0.2s, v1.2s, v0.2s
640 %cmp = icmp ule <2 x i32> %v1, %v2
644 define <2 x i1> @test_v2i16_ule(<2 x i16> %v1, <2 x i16> %v2) {
645 ; CHECK-LABEL: test_v2i16_ule:
647 ; CHECK-NEXT: movi d2, #0x00ffff0000ffff
648 ; CHECK-NEXT: and v0.8b, v0.8b, v2.8b
649 ; CHECK-NEXT: and v1.8b, v1.8b, v2.8b
650 ; CHECK-NEXT: cmhs v0.2s, v1.2s, v0.2s
652 %cmp = icmp ule <2 x i16> %v1, %v2
656 define <8 x i1> @test_v8i16_ule(<8 x i16> %v1, <8 x i16> %v2) {
657 ; CHECK-LABEL: test_v8i16_ule:
659 ; CHECK-NEXT: cmhs v0.8h, v1.8h, v0.8h
660 ; CHECK-NEXT: xtn v0.8b, v0.8h
662 %cmp = icmp ule <8 x i16> %v1, %v2
666 define <4 x i1> @test_v4i16_ule(<4 x i16> %v1, <4 x i16> %v2) {
667 ; CHECK-LABEL: test_v4i16_ule:
669 ; CHECK-NEXT: cmhs v0.4h, v1.4h, v0.4h
671 %cmp = icmp ule <4 x i16> %v1, %v2
675 define <16 x i1> @test_v16i8_ule(<16 x i8> %v1, <16 x i8> %v2) {
676 ; CHECK-LABEL: test_v16i8_ule:
678 ; CHECK-NEXT: cmhs v0.16b, v1.16b, v0.16b
680 %cmp = icmp ule <16 x i8> %v1, %v2
684 define <8 x i1> @test_v8i8_ule(<8 x i8> %v1, <8 x i8> %v2) {
685 ; CHECK-LABEL: test_v8i8_ule:
687 ; CHECK-NEXT: cmhs v0.8b, v1.8b, v0.8b
689 %cmp = icmp ule <8 x i8> %v1, %v2
693 define <2 x i1> @test_v2i64_sgt(<2 x i64> %v1, <2 x i64> %v2) {
694 ; CHECK-LABEL: test_v2i64_sgt:
696 ; CHECK-NEXT: cmgt v0.2d, v0.2d, v1.2d
697 ; CHECK-NEXT: xtn v0.2s, v0.2d
699 %cmp = icmp sgt <2 x i64> %v1, %v2
703 define <4 x i1> @test_v4i64_sgt(<4 x i64> %v1, <4 x i64> %v2) {
704 ; CHECK-SD-LABEL: test_v4i64_sgt:
705 ; CHECK-SD: // %bb.0: // %entry
706 ; CHECK-SD-NEXT: cmgt v1.2d, v1.2d, v3.2d
707 ; CHECK-SD-NEXT: cmgt v0.2d, v0.2d, v2.2d
708 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
709 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
712 ; CHECK-GI-LABEL: test_v4i64_sgt:
713 ; CHECK-GI: // %bb.0: // %entry
714 ; CHECK-GI-NEXT: cmgt v0.2d, v0.2d, v2.2d
715 ; CHECK-GI-NEXT: cmgt v1.2d, v1.2d, v3.2d
716 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
717 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
720 %cmp = icmp sgt <4 x i64> %v1, %v2
724 define <4 x i1> @test_v4i32_sgt(<4 x i32> %v1, <4 x i32> %v2) {
725 ; CHECK-LABEL: test_v4i32_sgt:
727 ; CHECK-NEXT: cmgt v0.4s, v0.4s, v1.4s
728 ; CHECK-NEXT: xtn v0.4h, v0.4s
730 %cmp = icmp sgt <4 x i32> %v1, %v2
734 define <2 x i1> @test_v2i32_sgt(<2 x i32> %v1, <2 x i32> %v2) {
735 ; CHECK-LABEL: test_v2i32_sgt:
737 ; CHECK-NEXT: cmgt v0.2s, v0.2s, v1.2s
739 %cmp = icmp sgt <2 x i32> %v1, %v2
743 define <2 x i1> @test_v2i16_sgt(<2 x i16> %v1, <2 x i16> %v2) {
744 ; CHECK-SD-LABEL: test_v2i16_sgt:
745 ; CHECK-SD: // %bb.0:
746 ; CHECK-SD-NEXT: shl v1.2s, v1.2s, #16
747 ; CHECK-SD-NEXT: shl v0.2s, v0.2s, #16
748 ; CHECK-SD-NEXT: sshr v1.2s, v1.2s, #16
749 ; CHECK-SD-NEXT: sshr v0.2s, v0.2s, #16
750 ; CHECK-SD-NEXT: cmgt v0.2s, v0.2s, v1.2s
753 ; CHECK-GI-LABEL: test_v2i16_sgt:
754 ; CHECK-GI: // %bb.0:
755 ; CHECK-GI-NEXT: shl v0.2s, v0.2s, #16
756 ; CHECK-GI-NEXT: shl v1.2s, v1.2s, #16
757 ; CHECK-GI-NEXT: sshr v0.2s, v0.2s, #16
758 ; CHECK-GI-NEXT: sshr v1.2s, v1.2s, #16
759 ; CHECK-GI-NEXT: cmgt v0.2s, v0.2s, v1.2s
761 %cmp = icmp sgt <2 x i16> %v1, %v2
765 define <8 x i1> @test_v8i16_sgt(<8 x i16> %v1, <8 x i16> %v2) {
766 ; CHECK-LABEL: test_v8i16_sgt:
768 ; CHECK-NEXT: cmgt v0.8h, v0.8h, v1.8h
769 ; CHECK-NEXT: xtn v0.8b, v0.8h
771 %cmp = icmp sgt <8 x i16> %v1, %v2
775 define <4 x i1> @test_v4i16_sgt(<4 x i16> %v1, <4 x i16> %v2) {
776 ; CHECK-LABEL: test_v4i16_sgt:
778 ; CHECK-NEXT: cmgt v0.4h, v0.4h, v1.4h
780 %cmp = icmp sgt <4 x i16> %v1, %v2
784 define <16 x i1> @test_v16i8_sgt(<16 x i8> %v1, <16 x i8> %v2) {
785 ; CHECK-LABEL: test_v16i8_sgt:
787 ; CHECK-NEXT: cmgt v0.16b, v0.16b, v1.16b
789 %cmp = icmp sgt <16 x i8> %v1, %v2
793 define <8 x i1> @test_v8i8_sgt(<8 x i8> %v1, <8 x i8> %v2) {
794 ; CHECK-LABEL: test_v8i8_sgt:
796 ; CHECK-NEXT: cmgt v0.8b, v0.8b, v1.8b
798 %cmp = icmp sgt <8 x i8> %v1, %v2
802 define <2 x i1> @test_v2i64_sge(<2 x i64> %v1, <2 x i64> %v2) {
803 ; CHECK-LABEL: test_v2i64_sge:
805 ; CHECK-NEXT: cmge v0.2d, v0.2d, v1.2d
806 ; CHECK-NEXT: xtn v0.2s, v0.2d
808 %cmp = icmp sge <2 x i64> %v1, %v2
812 define <4 x i1> @test_v4i64_sge(<4 x i64> %v1, <4 x i64> %v2) {
813 ; CHECK-SD-LABEL: test_v4i64_sge:
814 ; CHECK-SD: // %bb.0: // %entry
815 ; CHECK-SD-NEXT: cmge v1.2d, v1.2d, v3.2d
816 ; CHECK-SD-NEXT: cmge v0.2d, v0.2d, v2.2d
817 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
818 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
821 ; CHECK-GI-LABEL: test_v4i64_sge:
822 ; CHECK-GI: // %bb.0: // %entry
823 ; CHECK-GI-NEXT: cmge v0.2d, v0.2d, v2.2d
824 ; CHECK-GI-NEXT: cmge v1.2d, v1.2d, v3.2d
825 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
826 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
829 %cmp = icmp sge <4 x i64> %v1, %v2
833 define <4 x i1> @test_v4i32_sge(<4 x i32> %v1, <4 x i32> %v2) {
834 ; CHECK-LABEL: test_v4i32_sge:
836 ; CHECK-NEXT: cmge v0.4s, v0.4s, v1.4s
837 ; CHECK-NEXT: xtn v0.4h, v0.4s
839 %cmp = icmp sge <4 x i32> %v1, %v2
843 define <2 x i1> @test_v2i32_sge(<2 x i32> %v1, <2 x i32> %v2) {
844 ; CHECK-LABEL: test_v2i32_sge:
846 ; CHECK-NEXT: cmge v0.2s, v0.2s, v1.2s
848 %cmp = icmp sge <2 x i32> %v1, %v2
852 define <2 x i1> @test_v2i16_sge(<2 x i16> %v1, <2 x i16> %v2) {
853 ; CHECK-SD-LABEL: test_v2i16_sge:
854 ; CHECK-SD: // %bb.0:
855 ; CHECK-SD-NEXT: shl v1.2s, v1.2s, #16
856 ; CHECK-SD-NEXT: shl v0.2s, v0.2s, #16
857 ; CHECK-SD-NEXT: sshr v1.2s, v1.2s, #16
858 ; CHECK-SD-NEXT: sshr v0.2s, v0.2s, #16
859 ; CHECK-SD-NEXT: cmge v0.2s, v0.2s, v1.2s
862 ; CHECK-GI-LABEL: test_v2i16_sge:
863 ; CHECK-GI: // %bb.0:
864 ; CHECK-GI-NEXT: shl v0.2s, v0.2s, #16
865 ; CHECK-GI-NEXT: shl v1.2s, v1.2s, #16
866 ; CHECK-GI-NEXT: sshr v0.2s, v0.2s, #16
867 ; CHECK-GI-NEXT: sshr v1.2s, v1.2s, #16
868 ; CHECK-GI-NEXT: cmge v0.2s, v0.2s, v1.2s
870 %cmp = icmp sge <2 x i16> %v1, %v2
874 define <8 x i1> @test_v8i16_sge(<8 x i16> %v1, <8 x i16> %v2) {
875 ; CHECK-LABEL: test_v8i16_sge:
877 ; CHECK-NEXT: cmge v0.8h, v0.8h, v1.8h
878 ; CHECK-NEXT: xtn v0.8b, v0.8h
880 %cmp = icmp sge <8 x i16> %v1, %v2
884 define <4 x i1> @test_v4i16_sge(<4 x i16> %v1, <4 x i16> %v2) {
885 ; CHECK-LABEL: test_v4i16_sge:
887 ; CHECK-NEXT: cmge v0.4h, v0.4h, v1.4h
889 %cmp = icmp sge <4 x i16> %v1, %v2
893 define <16 x i1> @test_v16i8_sge(<16 x i8> %v1, <16 x i8> %v2) {
894 ; CHECK-LABEL: test_v16i8_sge:
896 ; CHECK-NEXT: cmge v0.16b, v0.16b, v1.16b
898 %cmp = icmp sge <16 x i8> %v1, %v2
902 define <8 x i1> @test_v8i8_sge(<8 x i8> %v1, <8 x i8> %v2) {
903 ; CHECK-LABEL: test_v8i8_sge:
905 ; CHECK-NEXT: cmge v0.8b, v0.8b, v1.8b
907 %cmp = icmp sge <8 x i8> %v1, %v2
911 define <2 x i1> @test_v2i64_slt(<2 x i64> %v1, <2 x i64> %v2) {
912 ; CHECK-LABEL: test_v2i64_slt:
914 ; CHECK-NEXT: cmgt v0.2d, v1.2d, v0.2d
915 ; CHECK-NEXT: xtn v0.2s, v0.2d
917 %cmp = icmp slt <2 x i64> %v1, %v2
921 define <4 x i1> @test_v4i64_slt(<4 x i64> %v1, <4 x i64> %v2) {
922 ; CHECK-SD-LABEL: test_v4i64_slt:
923 ; CHECK-SD: // %bb.0: // %entry
924 ; CHECK-SD-NEXT: cmgt v1.2d, v3.2d, v1.2d
925 ; CHECK-SD-NEXT: cmgt v0.2d, v2.2d, v0.2d
926 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
927 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
930 ; CHECK-GI-LABEL: test_v4i64_slt:
931 ; CHECK-GI: // %bb.0: // %entry
932 ; CHECK-GI-NEXT: cmgt v0.2d, v2.2d, v0.2d
933 ; CHECK-GI-NEXT: cmgt v1.2d, v3.2d, v1.2d
934 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
935 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
938 %cmp = icmp slt <4 x i64> %v1, %v2
942 define <4 x i1> @test_v4i32_slt(<4 x i32> %v1, <4 x i32> %v2) {
943 ; CHECK-LABEL: test_v4i32_slt:
945 ; CHECK-NEXT: cmgt v0.4s, v1.4s, v0.4s
946 ; CHECK-NEXT: xtn v0.4h, v0.4s
948 %cmp = icmp slt <4 x i32> %v1, %v2
952 define <2 x i1> @test_v2i32_slt(<2 x i32> %v1, <2 x i32> %v2) {
953 ; CHECK-LABEL: test_v2i32_slt:
955 ; CHECK-NEXT: cmgt v0.2s, v1.2s, v0.2s
957 %cmp = icmp slt <2 x i32> %v1, %v2
961 define <2 x i1> @test_v2i16_slt(<2 x i16> %v1, <2 x i16> %v2) {
962 ; CHECK-LABEL: test_v2i16_slt:
964 ; CHECK-NEXT: shl v0.2s, v0.2s, #16
965 ; CHECK-NEXT: shl v1.2s, v1.2s, #16
966 ; CHECK-NEXT: sshr v0.2s, v0.2s, #16
967 ; CHECK-NEXT: sshr v1.2s, v1.2s, #16
968 ; CHECK-NEXT: cmgt v0.2s, v1.2s, v0.2s
970 %cmp = icmp slt <2 x i16> %v1, %v2
974 define <8 x i1> @test_v8i16_slt(<8 x i16> %v1, <8 x i16> %v2) {
975 ; CHECK-LABEL: test_v8i16_slt:
977 ; CHECK-NEXT: cmgt v0.8h, v1.8h, v0.8h
978 ; CHECK-NEXT: xtn v0.8b, v0.8h
980 %cmp = icmp slt <8 x i16> %v1, %v2
984 define <4 x i1> @test_v4i16_slt(<4 x i16> %v1, <4 x i16> %v2) {
985 ; CHECK-LABEL: test_v4i16_slt:
987 ; CHECK-NEXT: cmgt v0.4h, v1.4h, v0.4h
989 %cmp = icmp slt <4 x i16> %v1, %v2
993 define <16 x i1> @test_v16i8_slt(<16 x i8> %v1, <16 x i8> %v2) {
994 ; CHECK-LABEL: test_v16i8_slt:
996 ; CHECK-NEXT: cmgt v0.16b, v1.16b, v0.16b
998 %cmp = icmp slt <16 x i8> %v1, %v2
1002 define <8 x i1> @test_v8i8_slt(<8 x i8> %v1, <8 x i8> %v2) {
1003 ; CHECK-LABEL: test_v8i8_slt:
1005 ; CHECK-NEXT: cmgt v0.8b, v1.8b, v0.8b
1007 %cmp = icmp slt <8 x i8> %v1, %v2
1011 define <2 x i1> @test_v2i64_sle(<2 x i64> %v1, <2 x i64> %v2) {
1012 ; CHECK-LABEL: test_v2i64_sle:
1014 ; CHECK-NEXT: cmge v0.2d, v1.2d, v0.2d
1015 ; CHECK-NEXT: xtn v0.2s, v0.2d
1017 %cmp = icmp sle <2 x i64> %v1, %v2
1021 define <4 x i1> @test_v4i64_sle(<4 x i64> %v1, <4 x i64> %v2) {
1022 ; CHECK-SD-LABEL: test_v4i64_sle:
1023 ; CHECK-SD: // %bb.0: // %entry
1024 ; CHECK-SD-NEXT: cmge v1.2d, v3.2d, v1.2d
1025 ; CHECK-SD-NEXT: cmge v0.2d, v2.2d, v0.2d
1026 ; CHECK-SD-NEXT: uzp1 v0.4s, v0.4s, v1.4s
1027 ; CHECK-SD-NEXT: xtn v0.4h, v0.4s
1028 ; CHECK-SD-NEXT: ret
1030 ; CHECK-GI-LABEL: test_v4i64_sle:
1031 ; CHECK-GI: // %bb.0: // %entry
1032 ; CHECK-GI-NEXT: cmge v0.2d, v2.2d, v0.2d
1033 ; CHECK-GI-NEXT: cmge v1.2d, v3.2d, v1.2d
1034 ; CHECK-GI-NEXT: uzp1 v0.4s, v0.4s, v1.4s
1035 ; CHECK-GI-NEXT: xtn v0.4h, v0.4s
1036 ; CHECK-GI-NEXT: ret
1038 %cmp = icmp sle <4 x i64> %v1, %v2
1042 define <4 x i1> @test_v4i32_sle(<4 x i32> %v1, <4 x i32> %v2) {
1043 ; CHECK-LABEL: test_v4i32_sle:
1045 ; CHECK-NEXT: cmge v0.4s, v1.4s, v0.4s
1046 ; CHECK-NEXT: xtn v0.4h, v0.4s
1048 %cmp = icmp sle <4 x i32> %v1, %v2
1052 define <2 x i1> @test_v2i32_sle(<2 x i32> %v1, <2 x i32> %v2) {
1053 ; CHECK-LABEL: test_v2i32_sle:
1055 ; CHECK-NEXT: cmge v0.2s, v1.2s, v0.2s
1057 %cmp = icmp sle <2 x i32> %v1, %v2
1061 define <2 x i1> @test_v2i16_sle(<2 x i16> %v1, <2 x i16> %v2) {
1062 ; CHECK-LABEL: test_v2i16_sle:
1064 ; CHECK-NEXT: shl v0.2s, v0.2s, #16
1065 ; CHECK-NEXT: shl v1.2s, v1.2s, #16
1066 ; CHECK-NEXT: sshr v0.2s, v0.2s, #16
1067 ; CHECK-NEXT: sshr v1.2s, v1.2s, #16
1068 ; CHECK-NEXT: cmge v0.2s, v1.2s, v0.2s
1070 %cmp = icmp sle <2 x i16> %v1, %v2
1074 define <8 x i1> @test_v8i16_sle(<8 x i16> %v1, <8 x i16> %v2) {
1075 ; CHECK-LABEL: test_v8i16_sle:
1077 ; CHECK-NEXT: cmge v0.8h, v1.8h, v0.8h
1078 ; CHECK-NEXT: xtn v0.8b, v0.8h
1080 %cmp = icmp sle <8 x i16> %v1, %v2
1084 define <4 x i1> @test_v4i16_sle(<4 x i16> %v1, <4 x i16> %v2) {
1085 ; CHECK-LABEL: test_v4i16_sle:
1087 ; CHECK-NEXT: cmge v0.4h, v1.4h, v0.4h
1089 %cmp = icmp sle <4 x i16> %v1, %v2
1093 define <16 x i1> @test_v16i8_sle(<16 x i8> %v1, <16 x i8> %v2) {
1094 ; CHECK-LABEL: test_v16i8_sle:
1096 ; CHECK-NEXT: cmge v0.16b, v1.16b, v0.16b
1098 %cmp = icmp sle <16 x i8> %v1, %v2
1102 define <8 x i1> @test_v8i8_sle(<8 x i8> %v1, <8 x i8> %v2) {
1103 ; CHECK-LABEL: test_v8i8_sle:
1105 ; CHECK-NEXT: cmge v0.8b, v1.8b, v0.8b
1107 %cmp = icmp sle <8 x i8> %v1, %v2
1111 define <2 x i64> @v2i64_i64(<2 x i64> %a, <2 x i64> %b, <2 x i64> %d, <2 x i64> %e) {
1112 ; CHECK-LABEL: v2i64_i64:
1113 ; CHECK: // %bb.0: // %entry
1114 ; CHECK-NEXT: cmgt v0.2d, v1.2d, v0.2d
1115 ; CHECK-NEXT: bsl v0.16b, v2.16b, v3.16b
1118 %c = icmp slt <2 x i64> %a, %b
1119 %s = select <2 x i1> %c, <2 x i64> %d, <2 x i64> %e
1123 define <3 x i64> @v3i64_i64(<3 x i64> %a, <3 x i64> %b, <3 x i64> %d, <3 x i64> %e) {
1124 ; CHECK-SD-LABEL: v3i64_i64:
1125 ; CHECK-SD: // %bb.0: // %entry
1126 ; CHECK-SD-NEXT: // kill: def $d4 killed $d4 def $q4
1127 ; CHECK-SD-NEXT: // kill: def $d3 killed $d3 def $q3
1128 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 def $q1
1129 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 def $q0
1130 ; CHECK-SD-NEXT: // kill: def $d6 killed $d6 def $q6
1131 ; CHECK-SD-NEXT: // kill: def $d7 killed $d7 def $q7
1132 ; CHECK-SD-NEXT: // kill: def $d5 killed $d5 def $q5
1133 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 def $q2
1134 ; CHECK-SD-NEXT: ldr d16, [sp, #24]
1135 ; CHECK-SD-NEXT: ldr d17, [sp]
1136 ; CHECK-SD-NEXT: mov v3.d[1], v4.d[0]
1137 ; CHECK-SD-NEXT: mov v0.d[1], v1.d[0]
1138 ; CHECK-SD-NEXT: mov v6.d[1], v7.d[0]
1139 ; CHECK-SD-NEXT: ldp d1, d4, [sp, #8]
1140 ; CHECK-SD-NEXT: mov v1.d[1], v4.d[0]
1141 ; CHECK-SD-NEXT: cmgt v0.2d, v3.2d, v0.2d
1142 ; CHECK-SD-NEXT: bsl v0.16b, v6.16b, v1.16b
1143 ; CHECK-SD-NEXT: cmgt v1.2d, v5.2d, v2.2d
1144 ; CHECK-SD-NEXT: mov v2.16b, v1.16b
1145 ; CHECK-SD-NEXT: ext v1.16b, v0.16b, v0.16b, #8
1146 ; CHECK-SD-NEXT: // kill: def $d0 killed $d0 killed $q0
1147 ; CHECK-SD-NEXT: // kill: def $d1 killed $d1 killed $q1
1148 ; CHECK-SD-NEXT: bsl v2.16b, v17.16b, v16.16b
1149 ; CHECK-SD-NEXT: // kill: def $d2 killed $d2 killed $q2
1150 ; CHECK-SD-NEXT: ret
1152 ; CHECK-GI-LABEL: v3i64_i64:
1153 ; CHECK-GI: // %bb.0: // %entry
1154 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 def $q0
1155 ; CHECK-GI-NEXT: // kill: def $d1 killed $d1 def $q1
1156 ; CHECK-GI-NEXT: // kill: def $d3 killed $d3 def $q3
1157 ; CHECK-GI-NEXT: // kill: def $d4 killed $d4 def $q4
1158 ; CHECK-GI-NEXT: // kill: def $d2 killed $d2 def $q2
1159 ; CHECK-GI-NEXT: // kill: def $d6 killed $d6 def $q6
1160 ; CHECK-GI-NEXT: // kill: def $d5 killed $d5 def $q5
1161 ; CHECK-GI-NEXT: // kill: def $d7 killed $d7 def $q7
1162 ; CHECK-GI-NEXT: ldr x8, [sp]
1163 ; CHECK-GI-NEXT: ldr x10, [sp, #24]
1164 ; CHECK-GI-NEXT: mov v0.d[1], v1.d[0]
1165 ; CHECK-GI-NEXT: mov v3.d[1], v4.d[0]
1166 ; CHECK-GI-NEXT: cmgt v2.2d, v5.2d, v2.2d
1167 ; CHECK-GI-NEXT: ldp d1, d4, [sp, #8]
1168 ; CHECK-GI-NEXT: mov v6.d[1], v7.d[0]
1169 ; CHECK-GI-NEXT: fmov x9, d2
1170 ; CHECK-GI-NEXT: mov v1.d[1], v4.d[0]
1171 ; CHECK-GI-NEXT: cmgt v0.2d, v3.2d, v0.2d
1172 ; CHECK-GI-NEXT: sbfx x9, x9, #0, #1
1173 ; CHECK-GI-NEXT: bsl v0.16b, v6.16b, v1.16b
1174 ; CHECK-GI-NEXT: and x8, x8, x9
1175 ; CHECK-GI-NEXT: bic x9, x10, x9
1176 ; CHECK-GI-NEXT: orr x8, x8, x9
1177 ; CHECK-GI-NEXT: fmov d2, x8
1178 ; CHECK-GI-NEXT: mov d1, v0.d[1]
1179 ; CHECK-GI-NEXT: // kill: def $d0 killed $d0 killed $q0
1180 ; CHECK-GI-NEXT: ret
1182 %c = icmp slt <3 x i64> %a, %b
1183 %s = select <3 x i1> %c, <3 x i64> %d, <3 x i64> %e
1187 define <4 x i64> @v4i64_i64(<4 x i64> %a, <4 x i64> %b, <4 x i64> %d, <4 x i64> %e) {
1188 ; CHECK-SD-LABEL: v4i64_i64:
1189 ; CHECK-SD: // %bb.0: // %entry
1190 ; CHECK-SD-NEXT: cmgt v1.2d, v3.2d, v1.2d
1191 ; CHECK-SD-NEXT: cmgt v0.2d, v2.2d, v0.2d
1192 ; CHECK-SD-NEXT: bsl v1.16b, v5.16b, v7.16b
1193 ; CHECK-SD-NEXT: bsl v0.16b, v4.16b, v6.16b
1194 ; CHECK-SD-NEXT: ret
1196 ; CHECK-GI-LABEL: v4i64_i64:
1197 ; CHECK-GI: // %bb.0: // %entry
1198 ; CHECK-GI-NEXT: cmgt v0.2d, v2.2d, v0.2d
1199 ; CHECK-GI-NEXT: cmgt v1.2d, v3.2d, v1.2d
1200 ; CHECK-GI-NEXT: bsl v0.16b, v4.16b, v6.16b
1201 ; CHECK-GI-NEXT: bsl v1.16b, v5.16b, v7.16b
1202 ; CHECK-GI-NEXT: ret
1204 %c = icmp slt <4 x i64> %a, %b
1205 %s = select <4 x i1> %c, <4 x i64> %d, <4 x i64> %e
1209 define <2 x i32> @v2i32_i32(<2 x i32> %a, <2 x i32> %b, <2 x i32> %d, <2 x i32> %e) {
1210 ; CHECK-LABEL: v2i32_i32:
1211 ; CHECK: // %bb.0: // %entry
1212 ; CHECK-NEXT: cmgt v0.2s, v1.2s, v0.2s
1213 ; CHECK-NEXT: bsl v0.8b, v2.8b, v3.8b
1216 %c = icmp slt <2 x i32> %a, %b
1217 %s = select <2 x i1> %c, <2 x i32> %d, <2 x i32> %e
1221 define <3 x i32> @v3i32_i32(<3 x i32> %a, <3 x i32> %b, <3 x i32> %d, <3 x i32> %e) {
1222 ; CHECK-SD-LABEL: v3i32_i32:
1223 ; CHECK-SD: // %bb.0: // %entry
1224 ; CHECK-SD-NEXT: cmgt v0.4s, v1.4s, v0.4s
1225 ; CHECK-SD-NEXT: bsl v0.16b, v2.16b, v3.16b
1226 ; CHECK-SD-NEXT: ret
1228 ; CHECK-GI-LABEL: v3i32_i32:
1229 ; CHECK-GI: // %bb.0: // %entry
1230 ; CHECK-GI-NEXT: mov w8, #31 // =0x1f
1231 ; CHECK-GI-NEXT: cmgt v0.4s, v1.4s, v0.4s
1232 ; CHECK-GI-NEXT: fmov s4, w8
1233 ; CHECK-GI-NEXT: mov v4.s[1], w8
1234 ; CHECK-GI-NEXT: mov v4.s[2], w8
1235 ; CHECK-GI-NEXT: mov w8, #-1 // =0xffffffff
1236 ; CHECK-GI-NEXT: fmov s1, w8
1237 ; CHECK-GI-NEXT: mov v1.s[1], w8
1238 ; CHECK-GI-NEXT: ushl v0.4s, v0.4s, v4.4s
1239 ; CHECK-GI-NEXT: neg v4.4s, v4.4s
1240 ; CHECK-GI-NEXT: sshl v0.4s, v0.4s, v4.4s
1241 ; CHECK-GI-NEXT: mov v1.s[2], w8
1242 ; CHECK-GI-NEXT: eor v1.16b, v0.16b, v1.16b
1243 ; CHECK-GI-NEXT: and v0.16b, v2.16b, v0.16b
1244 ; CHECK-GI-NEXT: and v1.16b, v3.16b, v1.16b
1245 ; CHECK-GI-NEXT: orr v0.16b, v0.16b, v1.16b
1246 ; CHECK-GI-NEXT: ret
1248 %c = icmp slt <3 x i32> %a, %b
1249 %s = select <3 x i1> %c, <3 x i32> %d, <3 x i32> %e
1253 define <4 x i32> @v4i32_i32(<4 x i32> %a, <4 x i32> %b, <4 x i32> %d, <4 x i32> %e) {
1254 ; CHECK-LABEL: v4i32_i32:
1255 ; CHECK: // %bb.0: // %entry
1256 ; CHECK-NEXT: cmgt v0.4s, v1.4s, v0.4s
1257 ; CHECK-NEXT: bsl v0.16b, v2.16b, v3.16b
1260 %c = icmp slt <4 x i32> %a, %b
1261 %s = select <4 x i1> %c, <4 x i32> %d, <4 x i32> %e
1265 define <8 x i32> @v8i32_i32(<8 x i32> %a, <8 x i32> %b, <8 x i32> %d, <8 x i32> %e) {
1266 ; CHECK-SD-LABEL: v8i32_i32:
1267 ; CHECK-SD: // %bb.0: // %entry
1268 ; CHECK-SD-NEXT: cmgt v1.4s, v3.4s, v1.4s
1269 ; CHECK-SD-NEXT: cmgt v0.4s, v2.4s, v0.4s
1270 ; CHECK-SD-NEXT: bsl v1.16b, v5.16b, v7.16b
1271 ; CHECK-SD-NEXT: bsl v0.16b, v4.16b, v6.16b
1272 ; CHECK-SD-NEXT: ret
1274 ; CHECK-GI-LABEL: v8i32_i32:
1275 ; CHECK-GI: // %bb.0: // %entry
1276 ; CHECK-GI-NEXT: cmgt v0.4s, v2.4s, v0.4s
1277 ; CHECK-GI-NEXT: cmgt v1.4s, v3.4s, v1.4s
1278 ; CHECK-GI-NEXT: bsl v0.16b, v4.16b, v6.16b
1279 ; CHECK-GI-NEXT: bsl v1.16b, v5.16b, v7.16b
1280 ; CHECK-GI-NEXT: ret
1282 %c = icmp slt <8 x i32> %a, %b
1283 %s = select <8 x i1> %c, <8 x i32> %d, <8 x i32> %e
1287 define <4 x i16> @v4i16_i16(<4 x i16> %a, <4 x i16> %b, <4 x i16> %d, <4 x i16> %e) {
1288 ; CHECK-LABEL: v4i16_i16:
1289 ; CHECK: // %bb.0: // %entry
1290 ; CHECK-NEXT: cmgt v0.4h, v1.4h, v0.4h
1291 ; CHECK-NEXT: bsl v0.8b, v2.8b, v3.8b
1294 %c = icmp slt <4 x i16> %a, %b
1295 %s = select <4 x i1> %c, <4 x i16> %d, <4 x i16> %e
1299 define <8 x i16> @v8i16_i16(<8 x i16> %a, <8 x i16> %b, <8 x i16> %d, <8 x i16> %e) {
1300 ; CHECK-LABEL: v8i16_i16:
1301 ; CHECK: // %bb.0: // %entry
1302 ; CHECK-NEXT: cmgt v0.8h, v1.8h, v0.8h
1303 ; CHECK-NEXT: bsl v0.16b, v2.16b, v3.16b
1306 %c = icmp slt <8 x i16> %a, %b
1307 %s = select <8 x i1> %c, <8 x i16> %d, <8 x i16> %e
1311 define <16 x i16> @v16i16_i16(<16 x i16> %a, <16 x i16> %b, <16 x i16> %d, <16 x i16> %e) {
1312 ; CHECK-SD-LABEL: v16i16_i16:
1313 ; CHECK-SD: // %bb.0: // %entry
1314 ; CHECK-SD-NEXT: cmgt v1.8h, v3.8h, v1.8h
1315 ; CHECK-SD-NEXT: cmgt v0.8h, v2.8h, v0.8h
1316 ; CHECK-SD-NEXT: bsl v1.16b, v5.16b, v7.16b
1317 ; CHECK-SD-NEXT: bsl v0.16b, v4.16b, v6.16b
1318 ; CHECK-SD-NEXT: ret
1320 ; CHECK-GI-LABEL: v16i16_i16:
1321 ; CHECK-GI: // %bb.0: // %entry
1322 ; CHECK-GI-NEXT: cmgt v0.8h, v2.8h, v0.8h
1323 ; CHECK-GI-NEXT: cmgt v1.8h, v3.8h, v1.8h
1324 ; CHECK-GI-NEXT: bsl v0.16b, v4.16b, v6.16b
1325 ; CHECK-GI-NEXT: bsl v1.16b, v5.16b, v7.16b
1326 ; CHECK-GI-NEXT: ret
1328 %c = icmp slt <16 x i16> %a, %b
1329 %s = select <16 x i1> %c, <16 x i16> %d, <16 x i16> %e
1333 define <8 x i8> @v8i8_i8(<8 x i8> %a, <8 x i8> %b, <8 x i8> %d, <8 x i8> %e) {
1334 ; CHECK-LABEL: v8i8_i8:
1335 ; CHECK: // %bb.0: // %entry
1336 ; CHECK-NEXT: cmgt v0.8b, v1.8b, v0.8b
1337 ; CHECK-NEXT: bsl v0.8b, v2.8b, v3.8b
1340 %c = icmp slt <8 x i8> %a, %b
1341 %s = select <8 x i1> %c, <8 x i8> %d, <8 x i8> %e
1345 define <16 x i8> @v16i8_i8(<16 x i8> %a, <16 x i8> %b, <16 x i8> %d, <16 x i8> %e) {
1346 ; CHECK-LABEL: v16i8_i8:
1347 ; CHECK: // %bb.0: // %entry
1348 ; CHECK-NEXT: cmgt v0.16b, v1.16b, v0.16b
1349 ; CHECK-NEXT: bsl v0.16b, v2.16b, v3.16b
1352 %c = icmp slt <16 x i8> %a, %b
1353 %s = select <16 x i1> %c, <16 x i8> %d, <16 x i8> %e
1357 define <32 x i8> @v32i8_i8(<32 x i8> %a, <32 x i8> %b, <32 x i8> %d, <32 x i8> %e) {
1358 ; CHECK-SD-LABEL: v32i8_i8:
1359 ; CHECK-SD: // %bb.0: // %entry
1360 ; CHECK-SD-NEXT: cmgt v1.16b, v3.16b, v1.16b
1361 ; CHECK-SD-NEXT: cmgt v0.16b, v2.16b, v0.16b
1362 ; CHECK-SD-NEXT: bsl v1.16b, v5.16b, v7.16b
1363 ; CHECK-SD-NEXT: bsl v0.16b, v4.16b, v6.16b
1364 ; CHECK-SD-NEXT: ret
1366 ; CHECK-GI-LABEL: v32i8_i8:
1367 ; CHECK-GI: // %bb.0: // %entry
1368 ; CHECK-GI-NEXT: cmgt v0.16b, v2.16b, v0.16b
1369 ; CHECK-GI-NEXT: cmgt v1.16b, v3.16b, v1.16b
1370 ; CHECK-GI-NEXT: bsl v0.16b, v4.16b, v6.16b
1371 ; CHECK-GI-NEXT: bsl v1.16b, v5.16b, v7.16b
1372 ; CHECK-GI-NEXT: ret
1374 %c = icmp slt <32 x i8> %a, %b
1375 %s = select <32 x i1> %c, <32 x i8> %d, <32 x i8> %e
1379 ; ===== ICMP Zero RHS =====
1381 define <8 x i1> @icmp_eq_v8i8_Zero_RHS(<8 x i8> %a) {
1382 ; CHECK-LABEL: icmp_eq_v8i8_Zero_RHS:
1384 ; CHECK-NEXT: cmeq v0.8b, v0.8b, #0
1386 %c = icmp eq <8 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1390 define <16 x i1> @icmp_eq_v16i8_Zero_RHS(<16 x i8> %a) {
1391 ; CHECK-LABEL: icmp_eq_v16i8_Zero_RHS:
1393 ; CHECK-NEXT: cmeq v0.16b, v0.16b, #0
1395 %c = icmp eq <16 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1399 define <4 x i1> @icmp_eq_v4i16_Zero_RHS(<4 x i16> %a) {
1400 ; CHECK-LABEL: icmp_eq_v4i16_Zero_RHS:
1402 ; CHECK-NEXT: cmeq v0.4h, v0.4h, #0
1404 %c = icmp eq <4 x i16> %a, <i16 0, i16 0, i16 0, i16 0>
1408 define <8 x i1> @icmp_eq_v8i16_Zero_RHS(<8 x i16> %a) {
1409 ; CHECK-LABEL: icmp_eq_v8i16_Zero_RHS:
1411 ; CHECK-NEXT: cmeq v0.8h, v0.8h, #0
1412 ; CHECK-NEXT: xtn v0.8b, v0.8h
1414 %c = icmp eq <8 x i16> %a, <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
1418 define <2 x i1> @icmp_eq_v2i32_Zero_RHS(<2 x i32> %a) {
1419 ; CHECK-LABEL: icmp_eq_v2i32_Zero_RHS:
1421 ; CHECK-NEXT: cmeq v0.2s, v0.2s, #0
1423 %c = icmp eq <2 x i32> %a, <i32 0, i32 0>
1427 define <4 x i1> @icmp_eq_v4i32_Zero_RHS(<4 x i32> %a) {
1428 ; CHECK-LABEL: icmp_eq_v4i32_Zero_RHS:
1430 ; CHECK-NEXT: cmeq v0.4s, v0.4s, #0
1431 ; CHECK-NEXT: xtn v0.4h, v0.4s
1433 %c = icmp eq <4 x i32> %a, <i32 0, i32 0, i32 0, i32 0>
1437 define <2 x i1> @icmp_eq_v2i64_Zero_RHS(<2 x i64> %a) {
1438 ; CHECK-LABEL: icmp_eq_v2i64_Zero_RHS:
1440 ; CHECK-NEXT: cmeq v0.2d, v0.2d, #0
1441 ; CHECK-NEXT: xtn v0.2s, v0.2d
1443 %c = icmp eq <2 x i64> %a, <i64 0, i64 0>
1447 define <8 x i1> @icmp_sge_v8i8_Zero_RHS(<8 x i8> %a) {
1448 ; CHECK-LABEL: icmp_sge_v8i8_Zero_RHS:
1450 ; CHECK-NEXT: cmge v0.8b, v0.8b, #0
1452 %c = icmp sge <8 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1456 define <16 x i1> @icmp_sge_v16i8_Zero_RHS(<16 x i8> %a) {
1457 ; CHECK-LABEL: icmp_sge_v16i8_Zero_RHS:
1459 ; CHECK-NEXT: cmge v0.16b, v0.16b, #0
1461 %c = icmp sge <16 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1465 define <4 x i1> @icmp_sge_v4i16_Zero_RHS(<4 x i16> %a) {
1466 ; CHECK-LABEL: icmp_sge_v4i16_Zero_RHS:
1468 ; CHECK-NEXT: cmge v0.4h, v0.4h, #0
1470 %c = icmp sge <4 x i16> %a, <i16 0, i16 0, i16 0, i16 0>
1474 define <8 x i1> @icmp_sge_v8i16_Zero_RHS(<8 x i16> %a) {
1475 ; CHECK-LABEL: icmp_sge_v8i16_Zero_RHS:
1477 ; CHECK-NEXT: cmge v0.8h, v0.8h, #0
1478 ; CHECK-NEXT: xtn v0.8b, v0.8h
1480 %c = icmp sge <8 x i16> %a, <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
1484 define <2 x i1> @icmp_sge_v2i32_Zero_RHS(<2 x i32> %a) {
1485 ; CHECK-LABEL: icmp_sge_v2i32_Zero_RHS:
1487 ; CHECK-NEXT: cmge v0.2s, v0.2s, #0
1489 %c = icmp sge <2 x i32> %a, <i32 0, i32 0>
1493 define <4 x i1> @icmp_sge_v4i32_Zero_RHS(<4 x i32> %a) {
1494 ; CHECK-LABEL: icmp_sge_v4i32_Zero_RHS:
1496 ; CHECK-NEXT: cmge v0.4s, v0.4s, #0
1497 ; CHECK-NEXT: xtn v0.4h, v0.4s
1499 %c = icmp sge <4 x i32> %a, <i32 0, i32 0, i32 0, i32 0>
1503 define <2 x i1> @icmp_sge_v2i64_Zero_RHS(<2 x i64> %a) {
1504 ; CHECK-LABEL: icmp_sge_v2i64_Zero_RHS:
1506 ; CHECK-NEXT: cmge v0.2d, v0.2d, #0
1507 ; CHECK-NEXT: xtn v0.2s, v0.2d
1509 %c = icmp sge <2 x i64> %a, <i64 0, i64 0>
1513 define <8 x i1> @icmp_sgt_v8i8_Zero_RHS(<8 x i8> %a) {
1514 ; CHECK-LABEL: icmp_sgt_v8i8_Zero_RHS:
1516 ; CHECK-NEXT: cmgt v0.8b, v0.8b, #0
1518 %c = icmp sgt <8 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1522 define <16 x i1> @icmp_sgt_v16i8_Zero_RHS(<16 x i8> %a) {
1523 ; CHECK-LABEL: icmp_sgt_v16i8_Zero_RHS:
1525 ; CHECK-NEXT: cmgt v0.16b, v0.16b, #0
1527 %c = icmp sgt <16 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1531 define <4 x i1> @icmp_sgt_v4i16_Zero_RHS(<4 x i16> %a) {
1532 ; CHECK-LABEL: icmp_sgt_v4i16_Zero_RHS:
1534 ; CHECK-NEXT: cmgt v0.4h, v0.4h, #0
1536 %c = icmp sgt <4 x i16> %a, <i16 0, i16 0, i16 0, i16 0>
1540 define <8 x i1> @icmp_sgt_v8i16_Zero_RHS(<8 x i16> %a) {
1541 ; CHECK-LABEL: icmp_sgt_v8i16_Zero_RHS:
1543 ; CHECK-NEXT: cmgt v0.8h, v0.8h, #0
1544 ; CHECK-NEXT: xtn v0.8b, v0.8h
1546 %c = icmp sgt <8 x i16> %a, <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
1550 define <2 x i1> @icmp_sgt_v2i32_Zero_RHS(<2 x i32> %a) {
1551 ; CHECK-LABEL: icmp_sgt_v2i32_Zero_RHS:
1553 ; CHECK-NEXT: cmgt v0.2s, v0.2s, #0
1555 %c = icmp sgt <2 x i32> %a, <i32 0, i32 0>
1559 define <4 x i1> @icmp_sgt_v4i32_Zero_RHS(<4 x i32> %a) {
1560 ; CHECK-LABEL: icmp_sgt_v4i32_Zero_RHS:
1562 ; CHECK-NEXT: cmgt v0.4s, v0.4s, #0
1563 ; CHECK-NEXT: xtn v0.4h, v0.4s
1565 %c = icmp sgt <4 x i32> %a, <i32 0, i32 0, i32 0, i32 0>
1569 define <2 x i1> @icmp_sgt_v2i64_Zero_RHS(<2 x i64> %a) {
1570 ; CHECK-LABEL: icmp_sgt_v2i64_Zero_RHS:
1572 ; CHECK-NEXT: cmgt v0.2d, v0.2d, #0
1573 ; CHECK-NEXT: xtn v0.2s, v0.2d
1575 %c = icmp sgt <2 x i64> %a, <i64 0, i64 0>
1579 define <8 x i1> @icmp_sle_v8i8_Zero_RHS(<8 x i8> %a) {
1580 ; CHECK-LABEL: icmp_sle_v8i8_Zero_RHS:
1582 ; CHECK-NEXT: cmle v0.8b, v0.8b, #0
1584 %c = icmp sle <8 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1588 define <16 x i1> @icmp_sle_v16i8_Zero_RHS(<16 x i8> %a) {
1589 ; CHECK-LABEL: icmp_sle_v16i8_Zero_RHS:
1591 ; CHECK-NEXT: cmle v0.16b, v0.16b, #0
1593 %c = icmp sle <16 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1597 define <4 x i1> @icmp_sle_v4i16_Zero_RHS(<4 x i16> %a) {
1598 ; CHECK-LABEL: icmp_sle_v4i16_Zero_RHS:
1600 ; CHECK-NEXT: cmle v0.4h, v0.4h, #0
1602 %c = icmp sle <4 x i16> %a, <i16 0, i16 0, i16 0, i16 0>
1606 define <8 x i1> @icmp_sle_v8i16_Zero_RHS(<8 x i16> %a) {
1607 ; CHECK-LABEL: icmp_sle_v8i16_Zero_RHS:
1609 ; CHECK-NEXT: cmle v0.8h, v0.8h, #0
1610 ; CHECK-NEXT: xtn v0.8b, v0.8h
1612 %c = icmp sle <8 x i16> %a, <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
1616 define <2 x i1> @icmp_sle_v2i32_Zero_RHS(<2 x i32> %a) {
1617 ; CHECK-LABEL: icmp_sle_v2i32_Zero_RHS:
1619 ; CHECK-NEXT: cmle v0.2s, v0.2s, #0
1621 %c = icmp sle <2 x i32> %a, <i32 0, i32 0>
1625 define <4 x i1> @icmp_sle_v4i32_Zero_RHS(<4 x i32> %a) {
1626 ; CHECK-LABEL: icmp_sle_v4i32_Zero_RHS:
1628 ; CHECK-NEXT: cmle v0.4s, v0.4s, #0
1629 ; CHECK-NEXT: xtn v0.4h, v0.4s
1631 %c = icmp sle <4 x i32> %a, <i32 0, i32 0, i32 0, i32 0>
1635 define <2 x i1> @icmp_sle_v2i64_Zero_RHS(<2 x i64> %a) {
1636 ; CHECK-LABEL: icmp_sle_v2i64_Zero_RHS:
1638 ; CHECK-NEXT: cmle v0.2d, v0.2d, #0
1639 ; CHECK-NEXT: xtn v0.2s, v0.2d
1641 %c = icmp sle <2 x i64> %a, <i64 0, i64 0>
1645 define <8 x i1> @icmp_slt_v8i8_Zero_RHS(<8 x i8> %a) {
1646 ; CHECK-LABEL: icmp_slt_v8i8_Zero_RHS:
1648 ; CHECK-NEXT: cmlt v0.8b, v0.8b, #0
1650 %c = icmp slt <8 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1654 define <16 x i1> @icmp_slt_v16i8_Zero_RHS(<16 x i8> %a) {
1655 ; CHECK-LABEL: icmp_slt_v16i8_Zero_RHS:
1657 ; CHECK-NEXT: cmlt v0.16b, v0.16b, #0
1659 %c = icmp slt <16 x i8> %a, <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>
1663 define <4 x i1> @icmp_slt_v4i16_Zero_RHS(<4 x i16> %a) {
1664 ; CHECK-LABEL: icmp_slt_v4i16_Zero_RHS:
1666 ; CHECK-NEXT: cmlt v0.4h, v0.4h, #0
1668 %c = icmp slt <4 x i16> %a, <i16 0, i16 0, i16 0, i16 0>
1672 define <8 x i1> @icmp_slt_v8i16_Zero_RHS(<8 x i16> %a) {
1673 ; CHECK-LABEL: icmp_slt_v8i16_Zero_RHS:
1675 ; CHECK-NEXT: cmlt v0.8h, v0.8h, #0
1676 ; CHECK-NEXT: xtn v0.8b, v0.8h
1678 %c = icmp slt <8 x i16> %a, <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>
1682 define <2 x i1> @icmp_slt_v2i32_Zero_RHS(<2 x i32> %a) {
1683 ; CHECK-LABEL: icmp_slt_v2i32_Zero_RHS:
1685 ; CHECK-NEXT: cmlt v0.2s, v0.2s, #0
1687 %c = icmp slt <2 x i32> %a, <i32 0, i32 0>
1691 define <4 x i1> @icmp_slt_v4i32_Zero_RHS(<4 x i32> %a) {
1692 ; CHECK-LABEL: icmp_slt_v4i32_Zero_RHS:
1694 ; CHECK-NEXT: cmlt v0.4s, v0.4s, #0
1695 ; CHECK-NEXT: xtn v0.4h, v0.4s
1697 %c = icmp slt <4 x i32> %a, <i32 0, i32 0, i32 0, i32 0>
1701 define <2 x i1> @icmp_slt_v2i64_Zero_RHS(<2 x i64> %a) {
1702 ; CHECK-LABEL: icmp_slt_v2i64_Zero_RHS:
1704 ; CHECK-NEXT: cmlt v0.2d, v0.2d, #0
1705 ; CHECK-NEXT: xtn v0.2s, v0.2d
1707 %c = icmp slt <2 x i64> %a, <i64 0, i64 0>
1711 ; ===== ICMP Zero LHS =====
1713 define <8 x i1> @icmp_eq_v8i8_Zero_LHS(<8 x i8> %a) {
1714 ; CHECK-LABEL: icmp_eq_v8i8_Zero_LHS:
1716 ; CHECK-NEXT: cmeq v0.8b, v0.8b, #0
1718 %c = icmp eq <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1722 define <16 x i1> @icmp_eq_v16i8_Zero_LHS(<16 x i8> %a) {
1723 ; CHECK-LABEL: icmp_eq_v16i8_Zero_LHS:
1725 ; CHECK-NEXT: cmeq v0.16b, v0.16b, #0
1727 %c = icmp eq <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1731 define <4 x i1> @icmp_eq_v4i16_Zero_LHS(<4 x i16> %a) {
1732 ; CHECK-LABEL: icmp_eq_v4i16_Zero_LHS:
1734 ; CHECK-NEXT: cmeq v0.4h, v0.4h, #0
1736 %c = icmp eq <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %a
1740 define <8 x i1> @icmp_eq_v8i16_Zero_LHS(<8 x i16> %a) {
1741 ; CHECK-LABEL: icmp_eq_v8i16_Zero_LHS:
1743 ; CHECK-NEXT: cmeq v0.8h, v0.8h, #0
1744 ; CHECK-NEXT: xtn v0.8b, v0.8h
1746 %c = icmp eq <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, %a
1750 define <2 x i1> @icmp_eq_v2i32_Zero_LHS(<2 x i32> %a) {
1751 ; CHECK-LABEL: icmp_eq_v2i32_Zero_LHS:
1753 ; CHECK-NEXT: cmeq v0.2s, v0.2s, #0
1755 %c = icmp eq <2 x i32> <i32 0, i32 0>, %a
1759 define <4 x i1> @icmp_eq_v4i32_Zero_LHS(<4 x i32> %a) {
1760 ; CHECK-LABEL: icmp_eq_v4i32_Zero_LHS:
1762 ; CHECK-NEXT: cmeq v0.4s, v0.4s, #0
1763 ; CHECK-NEXT: xtn v0.4h, v0.4s
1765 %c = icmp eq <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %a
1769 define <2 x i1> @icmp_eq_v2i64_Zero_LHS(<2 x i64> %a) {
1770 ; CHECK-LABEL: icmp_eq_v2i64_Zero_LHS:
1772 ; CHECK-NEXT: cmeq v0.2d, v0.2d, #0
1773 ; CHECK-NEXT: xtn v0.2s, v0.2d
1775 %c = icmp eq <2 x i64> <i64 0, i64 0>, %a
1779 define <8 x i1> @icmp_sge_v8i8_Zero_LHS(<8 x i8> %a) {
1780 ; CHECK-LABEL: icmp_sge_v8i8_Zero_LHS:
1782 ; CHECK-NEXT: cmle v0.8b, v0.8b, #0
1784 %c = icmp sge <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1788 define <16 x i1> @icmp_sge_v16i8_Zero_LHS(<16 x i8> %a) {
1789 ; CHECK-LABEL: icmp_sge_v16i8_Zero_LHS:
1791 ; CHECK-NEXT: cmle v0.16b, v0.16b, #0
1793 %c = icmp sge <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1797 define <4 x i1> @icmp_sge_v4i16_Zero_LHS(<4 x i16> %a) {
1798 ; CHECK-LABEL: icmp_sge_v4i16_Zero_LHS:
1800 ; CHECK-NEXT: cmle v0.4h, v0.4h, #0
1802 %c = icmp sge <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %a
1806 define <8 x i1> @icmp_sge_v8i16_Zero_LHS(<8 x i16> %a) {
1807 ; CHECK-LABEL: icmp_sge_v8i16_Zero_LHS:
1809 ; CHECK-NEXT: cmle v0.8h, v0.8h, #0
1810 ; CHECK-NEXT: xtn v0.8b, v0.8h
1812 %c = icmp sge <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, %a
1816 define <2 x i1> @icmp_sge_v2i32_Zero_LHS(<2 x i32> %a) {
1817 ; CHECK-LABEL: icmp_sge_v2i32_Zero_LHS:
1819 ; CHECK-NEXT: cmle v0.2s, v0.2s, #0
1821 %c = icmp sge <2 x i32> <i32 0, i32 0>, %a
1825 define <4 x i1> @icmp_sge_v4i32_Zero_LHS(<4 x i32> %a) {
1826 ; CHECK-LABEL: icmp_sge_v4i32_Zero_LHS:
1828 ; CHECK-NEXT: cmle v0.4s, v0.4s, #0
1829 ; CHECK-NEXT: xtn v0.4h, v0.4s
1831 %c = icmp sge <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %a
1835 define <2 x i1> @icmp_sge_v2i64_Zero_LHS(<2 x i64> %a) {
1836 ; CHECK-LABEL: icmp_sge_v2i64_Zero_LHS:
1838 ; CHECK-NEXT: cmle v0.2d, v0.2d, #0
1839 ; CHECK-NEXT: xtn v0.2s, v0.2d
1841 %c = icmp sge <2 x i64> <i64 0, i64 0>, %a
1845 define <8 x i1> @icmp_sgt_v8i8_Zero_LHS(<8 x i8> %a) {
1846 ; CHECK-LABEL: icmp_sgt_v8i8_Zero_LHS:
1848 ; CHECK-NEXT: cmlt v0.8b, v0.8b, #0
1850 %c = icmp sgt <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1854 define <16 x i1> @icmp_sgt_v16i8_Zero_LHS(<16 x i8> %a) {
1855 ; CHECK-LABEL: icmp_sgt_v16i8_Zero_LHS:
1857 ; CHECK-NEXT: cmlt v0.16b, v0.16b, #0
1859 %c = icmp sgt <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1863 define <4 x i1> @icmp_sgt_v4i16_Zero_LHS(<4 x i16> %a) {
1864 ; CHECK-LABEL: icmp_sgt_v4i16_Zero_LHS:
1866 ; CHECK-NEXT: cmlt v0.4h, v0.4h, #0
1868 %c = icmp sgt <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %a
1872 define <8 x i1> @icmp_sgt_v8i16_Zero_LHS(<8 x i16> %a) {
1873 ; CHECK-LABEL: icmp_sgt_v8i16_Zero_LHS:
1875 ; CHECK-NEXT: cmlt v0.8h, v0.8h, #0
1876 ; CHECK-NEXT: xtn v0.8b, v0.8h
1878 %c = icmp sgt <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, %a
1882 define <2 x i1> @icmp_sgt_v2i32_Zero_LHS(<2 x i32> %a) {
1883 ; CHECK-LABEL: icmp_sgt_v2i32_Zero_LHS:
1885 ; CHECK-NEXT: cmlt v0.2s, v0.2s, #0
1887 %c = icmp sgt <2 x i32> <i32 0, i32 0>, %a
1891 define <4 x i1> @icmp_sgt_v4i32_Zero_LHS(<4 x i32> %a) {
1892 ; CHECK-LABEL: icmp_sgt_v4i32_Zero_LHS:
1894 ; CHECK-NEXT: cmlt v0.4s, v0.4s, #0
1895 ; CHECK-NEXT: xtn v0.4h, v0.4s
1897 %c = icmp sgt <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %a
1901 define <2 x i1> @icmp_sgt_v2i64_Zero_LHS(<2 x i64> %a) {
1902 ; CHECK-LABEL: icmp_sgt_v2i64_Zero_LHS:
1904 ; CHECK-NEXT: cmlt v0.2d, v0.2d, #0
1905 ; CHECK-NEXT: xtn v0.2s, v0.2d
1907 %c = icmp sgt <2 x i64> <i64 0, i64 0>, %a
1911 define <8 x i1> @icmp_sle_v8i8_Zero_LHS(<8 x i8> %a) {
1912 ; CHECK-LABEL: icmp_sle_v8i8_Zero_LHS:
1914 ; CHECK-NEXT: cmge v0.8b, v0.8b, #0
1916 %c = icmp sle <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1920 define <16 x i1> @icmp_sle_v16i8_Zero_LHS(<16 x i8> %a) {
1921 ; CHECK-LABEL: icmp_sle_v16i8_Zero_LHS:
1923 ; CHECK-NEXT: cmge v0.16b, v0.16b, #0
1925 %c = icmp sle <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1929 define <4 x i1> @icmp_sle_v4i16_Zero_LHS(<4 x i16> %a) {
1930 ; CHECK-LABEL: icmp_sle_v4i16_Zero_LHS:
1932 ; CHECK-NEXT: cmge v0.4h, v0.4h, #0
1934 %c = icmp sle <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %a
1938 define <8 x i1> @icmp_sle_v8i16_Zero_LHS(<8 x i16> %a) {
1939 ; CHECK-LABEL: icmp_sle_v8i16_Zero_LHS:
1941 ; CHECK-NEXT: cmge v0.8h, v0.8h, #0
1942 ; CHECK-NEXT: xtn v0.8b, v0.8h
1944 %c = icmp sle <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, %a
1948 define <2 x i1> @icmp_sle_v2i32_Zero_LHS(<2 x i32> %a) {
1949 ; CHECK-LABEL: icmp_sle_v2i32_Zero_LHS:
1951 ; CHECK-NEXT: cmge v0.2s, v0.2s, #0
1953 %c = icmp sle <2 x i32> <i32 0, i32 0>, %a
1957 define <4 x i1> @icmp_sle_v4i32_Zero_LHS(<4 x i32> %a) {
1958 ; CHECK-LABEL: icmp_sle_v4i32_Zero_LHS:
1960 ; CHECK-NEXT: cmge v0.4s, v0.4s, #0
1961 ; CHECK-NEXT: xtn v0.4h, v0.4s
1963 %c = icmp sle <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %a
1967 define <2 x i1> @icmp_sle_v2i64_Zero_LHS(<2 x i64> %a) {
1968 ; CHECK-LABEL: icmp_sle_v2i64_Zero_LHS:
1970 ; CHECK-NEXT: cmge v0.2d, v0.2d, #0
1971 ; CHECK-NEXT: xtn v0.2s, v0.2d
1973 %c = icmp sle <2 x i64> <i64 0, i64 0>, %a
1977 define <8 x i1> @icmp_slt_v8i8_Zero_LHS(<8 x i8> %a) {
1978 ; CHECK-LABEL: icmp_slt_v8i8_Zero_LHS:
1980 ; CHECK-NEXT: cmgt v0.8b, v0.8b, #0
1982 %c = icmp slt <8 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1986 define <16 x i1> @icmp_slt_v16i8_Zero_LHS(<16 x i8> %a) {
1987 ; CHECK-LABEL: icmp_slt_v16i8_Zero_LHS:
1989 ; CHECK-NEXT: cmgt v0.16b, v0.16b, #0
1991 %c = icmp slt <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, %a
1995 define <4 x i1> @icmp_slt_v4i16_Zero_LHS(<4 x i16> %a) {
1996 ; CHECK-LABEL: icmp_slt_v4i16_Zero_LHS:
1998 ; CHECK-NEXT: cmgt v0.4h, v0.4h, #0
2000 %c = icmp slt <4 x i16> <i16 0, i16 0, i16 0, i16 0>, %a
2004 define <8 x i1> @icmp_slt_v8i16_Zero_LHS(<8 x i16> %a) {
2005 ; CHECK-LABEL: icmp_slt_v8i16_Zero_LHS:
2007 ; CHECK-NEXT: cmgt v0.8h, v0.8h, #0
2008 ; CHECK-NEXT: xtn v0.8b, v0.8h
2010 %c = icmp slt <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, %a
2014 define <2 x i1> @icmp_slt_v2i32_Zero_LHS(<2 x i32> %a) {
2015 ; CHECK-LABEL: icmp_slt_v2i32_Zero_LHS:
2017 ; CHECK-NEXT: cmgt v0.2s, v0.2s, #0
2019 %c = icmp slt <2 x i32> <i32 0, i32 0>, %a
2023 define <4 x i1> @icmp_slt_v4i32_Zero_LHS(<4 x i32> %a) {
2024 ; CHECK-LABEL: icmp_slt_v4i32_Zero_LHS:
2026 ; CHECK-NEXT: cmgt v0.4s, v0.4s, #0
2027 ; CHECK-NEXT: xtn v0.4h, v0.4s
2029 %c = icmp slt <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %a
2033 define <2 x i1> @icmp_slt_v2i64_Zero_LHS(<2 x i64> %a) {
2034 ; CHECK-LABEL: icmp_slt_v2i64_Zero_LHS:
2036 ; CHECK-NEXT: cmgt v0.2d, v0.2d, #0
2037 ; CHECK-NEXT: xtn v0.2s, v0.2d
2039 %c = icmp slt <2 x i64> <i64 0, i64 0>, %a