2021-01-27 17:36:12 +08:00
|
|
|
# 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
|
|
|
|
|
2021-02-23 06:11:58 +08:00
|
|
|
---
|
|
|
|
name: narrow_scalar_sadde_s128
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
; CHECK-LABEL: name: narrow_scalar_sadde_s128
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
|
|
|
|
; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
|
|
|
|
; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
|
|
|
|
; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
|
|
|
|
; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
|
|
|
|
; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY2]], %carry_in
|
|
|
|
; CHECK: %19:_(s64), %carry_out:_(s1) = G_SADDE [[COPY1]], [[COPY3]], [[UADDE1]]
|
|
|
|
; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
|
|
|
|
; CHECK: $x0 = COPY [[UADDE]](s64)
|
|
|
|
; CHECK: $x1 = COPY %19(s64)
|
|
|
|
; CHECK: $x2 = COPY %carry_out_ext(s64)
|
|
|
|
%0:_(s64) = COPY $x0
|
|
|
|
%1:_(s64) = COPY $x1
|
|
|
|
%2:_(s64) = COPY $x2
|
|
|
|
%3:_(s64) = COPY $x3
|
|
|
|
%4:_(s64) = COPY $x4
|
|
|
|
%lhs:_(s128) = G_MERGE_VALUES %0, %1
|
|
|
|
%rhs:_(s128) = G_MERGE_VALUES %2, %3
|
|
|
|
%carry_in:_(s1) = G_TRUNC %4
|
|
|
|
%add:_(s128), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
|
|
|
|
%add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
|
|
|
|
%carry_out_ext:_(s64) = G_ANYEXT %carry_out
|
|
|
|
$x0 = COPY %add0
|
|
|
|
$x1 = COPY %add1
|
|
|
|
$x2 = COPY %carry_out_ext
|
|
|
|
|
|
|
|
...
|
|
|
|
---
|
|
|
|
name: narrow_scalar_sadde_big_nonpow2
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
; CHECK-LABEL: name: narrow_scalar_sadde_big_nonpow2
|
|
|
|
; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
|
|
|
|
; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
|
|
|
|
; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
|
|
|
|
; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
|
|
|
|
; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
|
|
|
|
; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
|
|
|
|
; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], %carry_in
|
|
|
|
; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
|
|
|
|
; CHECK: %24:_(s64), %carry_out:_(s1) = G_SADDE [[COPY2]], [[COPY3]], [[UADDE3]]
|
|
|
|
; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
|
|
|
|
; CHECK: $x0 = COPY [[UADDE]](s64)
|
|
|
|
; CHECK: $x1 = COPY [[UADDE2]](s64)
|
|
|
|
; CHECK: $x2 = COPY %24(s64)
|
|
|
|
; CHECK: $x3 = COPY %carry_out_ext(s64)
|
|
|
|
%0:_(s64) = COPY $x0
|
|
|
|
%1:_(s64) = COPY $x1
|
|
|
|
%2:_(s64) = COPY $x2
|
|
|
|
%3:_(s64) = COPY $x3
|
|
|
|
%4:_(s64) = COPY $x4
|
|
|
|
%lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
|
|
|
|
%rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
|
|
|
|
%carry_in:_(s1) = G_TRUNC %4
|
|
|
|
%add:_(s192), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
|
|
|
|
%add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
|
|
|
|
%carry_out_ext:_(s64) = G_ANYEXT %carry_out
|
|
|
|
$x0 = COPY %add0
|
|
|
|
$x1 = COPY %add1
|
|
|
|
$x2 = COPY %add2
|
|
|
|
$x3 = COPY %carry_out_ext
|
|
|
|
|
|
|
|
...
|
2021-01-29 02:20:35 +08:00
|
|
|
---
|
|
|
|
name: widen_scalar_sadde_s8
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
; CHECK-LABEL: name: widen_scalar_sadde_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: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
|
|
|
|
; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
|
|
|
|
; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
|
|
|
|
; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
|
|
|
|
; CHECK: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[SEXT_INREG]], [[SEXT_INREG1]], %carry_in
|
|
|
|
; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[UADDE]](s32)
|
|
|
|
; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UADDE]](s32)
|
|
|
|
; CHECK: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 8
|
|
|
|
; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UADDE]](s32), [[SEXT_INREG2]]
|
|
|
|
; CHECK: %add:_(s8) = COPY [[TRUNC2]](s8)
|
|
|
|
; CHECK: %add_ext:_(s64) = G_ANYEXT [[UADDE]](s32)
|
|
|
|
; CHECK: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
|
|
|
|
; CHECK: $x0 = COPY %add_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
|
|
|
|
%add:_(s8), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
|
|
|
|
%add_ext:_(s64) = G_ANYEXT %add
|
|
|
|
%carry_out_ext:_(s64) = G_ANYEXT %carry_out
|
|
|
|
$x0 = COPY %add_ext
|
|
|
|
$x1 = COPY %carry_out_ext
|
|
|
|
|
|
|
|
...
|
2021-01-27 17:36:12 +08:00
|
|
|
---
|
|
|
|
name: test_scalar_sadde_32
|
|
|
|
body: |
|
|
|
|
bb.0.entry:
|
|
|
|
; CHECK-LABEL: name: test_scalar_sadde_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: %add:_(s32), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
|
|
|
|
; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
|
|
|
|
; CHECK: $w0 = COPY %add(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
|
|
|
|
%add:_(s32), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
|
|
|
|
%carry_out_ext:_(s32) = G_ANYEXT %carry_out
|
|
|
|
$w0 = COPY %add
|
|
|
|
$w1 = COPY %carry_out_ext
|
|
|
|
|
|
|
|
...
|