|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4 |
| 2 | +; RUN: llc -mtriple=aarch64-linux-gnu -O0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - 2>&1 | FileCheck %s |
| 3 | + |
| 4 | + |
| 5 | +define <2 x i1> @call_icmp_samesign_vector(<2 x i32> %a, <2 x i32> %b) { |
| 6 | + ; CHECK-LABEL: name: call_icmp_samesign_vector |
| 7 | + ; CHECK: bb.1.entry: |
| 8 | + ; CHECK-NEXT: liveins: $d0, $d1 |
| 9 | + ; CHECK-NEXT: {{ $}} |
| 10 | + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0 |
| 11 | + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $d1 |
| 12 | + ; CHECK-NEXT: %2:_(<2 x s1>) = samesign G_ICMP intpred(ult), [[COPY]](<2 x s32>), [[COPY1]] |
| 13 | + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<2 x s32>) = G_ANYEXT %2(<2 x s1>) |
| 14 | + ; CHECK-NEXT: $d0 = COPY [[ANYEXT]](<2 x s32>) |
| 15 | + ; CHECK-NEXT: RET_ReallyLR implicit $d0 |
| 16 | +entry: |
| 17 | + %result = icmp samesign ult <2 x i32> %a, %b |
| 18 | + ret <2 x i1> %result |
| 19 | +} |
| 20 | + |
| 21 | +define <2 x i1> @call_icmp_vector(<2 x i32> %a, <2 x i32> %b) { |
| 22 | + ; CHECK-LABEL: name: call_icmp_vector |
| 23 | + ; CHECK: bb.1.entry: |
| 24 | + ; CHECK-NEXT: liveins: $d0, $d1 |
| 25 | + ; CHECK-NEXT: {{ $}} |
| 26 | + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<2 x s32>) = COPY $d0 |
| 27 | + ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(<2 x s32>) = COPY $d1 |
| 28 | + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(<2 x s1>) = G_ICMP intpred(ult), [[COPY]](<2 x s32>), [[COPY1]] |
| 29 | + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(<2 x s32>) = G_ANYEXT [[ICMP]](<2 x s1>) |
| 30 | + ; CHECK-NEXT: $d0 = COPY [[ANYEXT]](<2 x s32>) |
| 31 | + ; CHECK-NEXT: RET_ReallyLR implicit $d0 |
| 32 | +entry: |
| 33 | + %result = icmp ult <2 x i32> %a, %b |
| 34 | + ret <2 x i1> %result |
| 35 | +} |
| 36 | + |
| 37 | +define i1 @call_icmp(i32 %a) { |
| 38 | + ; CHECK-LABEL: name: call_icmp |
| 39 | + ; CHECK: bb.1.entry: |
| 40 | + ; CHECK-NEXT: liveins: $w0 |
| 41 | + ; CHECK-NEXT: {{ $}} |
| 42 | + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 |
| 43 | + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 |
| 44 | + ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(ult), [[COPY]](s32), [[C]] |
| 45 | + ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s8) = G_ZEXT [[ICMP]](s1) |
| 46 | + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ZEXT]](s8) |
| 47 | + ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32) |
| 48 | + ; CHECK-NEXT: RET_ReallyLR implicit $w0 |
| 49 | +entry: |
| 50 | + %result = icmp ult i32 %a, 3 |
| 51 | + ret i1 %result |
| 52 | +} |
| 53 | + |
| 54 | +define i1 @call_icmp_samesign(i32 %a) { |
| 55 | + ; CHECK-LABEL: name: call_icmp_samesign |
| 56 | + ; CHECK: bb.1.entry: |
| 57 | + ; CHECK-NEXT: liveins: $w0 |
| 58 | + ; CHECK-NEXT: {{ $}} |
| 59 | + ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w0 |
| 60 | + ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 |
| 61 | + ; CHECK-NEXT: %2:_(s1) = samesign G_ICMP intpred(ult), [[COPY]](s32), [[C]] |
| 62 | + ; CHECK-NEXT: [[ZEXT:%[0-9]+]]:_(s8) = G_ZEXT %2(s1) |
| 63 | + ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[ZEXT]](s8) |
| 64 | + ; CHECK-NEXT: $w0 = COPY [[ANYEXT]](s32) |
| 65 | + ; CHECK-NEXT: RET_ReallyLR implicit $w0 |
| 66 | +entry: |
| 67 | + %result = icmp samesign ult i32 %a, 3 |
| 68 | + ret i1 %result |
| 69 | +} |
0 commit comments