| # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| # RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s |
| |
| --- |
| name: widen_scalar_usube_s8 |
| body: | |
| bb.0.entry: |
| ; CHECK-LABEL: name: widen_scalar_usube_s8 |
| ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0 |
| ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1 |
| ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2 |
| ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY2]](s64) |
| ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 |
| ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) |
| ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]] |
| ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64) |
| ; CHECK: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]] |
| ; CHECK: [[USUBE:%[0-9]+]]:_(s32), [[USUBE1:%[0-9]+]]:_(s1) = G_USUBE [[AND]], [[AND1]], %carry_in |
| ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[USUBE]](s32) |
| ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[USUBE]](s32) |
| ; CHECK: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[C]] |
| ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[USUBE]](s32), [[AND2]] |
| ; CHECK: %sub:_(s8) = COPY [[TRUNC2]](s8) |
| ; CHECK: %sub_ext:_(s64) = G_ANYEXT [[USUBE]](s32) |
| ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32) |
| ; CHECK: $x0 = COPY %sub_ext(s64) |
| ; CHECK: $x1 = COPY %carry_out_ext(s64) |
| %0:_(s64) = COPY $x0 |
| %1:_(s64) = COPY $x1 |
| %2:_(s64) = COPY $x2 |
| %lhs:_(s8) = G_TRUNC %0 |
| %rhs:_(s8) = G_TRUNC %1 |
| %carry_in:_(s1) = G_TRUNC %2 |
| %sub:_(s8), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in |
| %sub_ext:_(s64) = G_ANYEXT %sub |
| %carry_out_ext:_(s64) = G_ANYEXT %carry_out |
| $x0 = COPY %sub_ext |
| $x1 = COPY %carry_out_ext |
| |
| ... |
| --- |
| name: test_scalar_usube_32 |
| body: | |
| bb.0.entry: |
| ; CHECK-LABEL: name: test_scalar_usube_32 |
| ; CHECK: %lhs:_(s32) = COPY $w0 |
| ; CHECK: %rhs:_(s32) = COPY $w1 |
| ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w2 |
| ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY]](s32) |
| ; CHECK: %sub:_(s32), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in |
| ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1) |
| ; CHECK: $w0 = COPY %sub(s32) |
| ; CHECK: $w1 = COPY %carry_out_ext(s32) |
| %lhs:_(s32) = COPY $w0 |
| %rhs:_(s32) = COPY $w1 |
| %2:_(s32) = COPY $w2 |
| %carry_in:_(s1) = G_TRUNC %2 |
| %sub:_(s32), %carry_out:_(s1) = G_USUBE %lhs, %rhs, %carry_in |
| %carry_out_ext:_(s32) = G_ANYEXT %carry_out |
| $w0 = COPY %sub |
| $w1 = COPY %carry_out_ext |
| |
| ... |