1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -verify-machineinstrs -run-pass=legalizer -debugify-and-strip-all-safe %s -o - | FileCheck %s
5 name: narrow_scalar_sadde_s128
8 ; CHECK-LABEL: name: narrow_scalar_sadde_s128
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
11 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
12 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
13 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
14 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
15 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY2]], %carry_in
16 ; CHECK: %19:_(s64), %carry_out:_(s1) = G_SADDE [[COPY1]], [[COPY3]], [[UADDE1]]
17 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
18 ; CHECK: $x0 = COPY [[UADDE]](s64)
19 ; CHECK: $x1 = COPY %19(s64)
20 ; CHECK: $x2 = COPY %carry_out_ext(s64)
26 %lhs:_(s128) = G_MERGE_VALUES %0, %1
27 %rhs:_(s128) = G_MERGE_VALUES %2, %3
28 %carry_in:_(s1) = G_TRUNC %4
29 %add:_(s128), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
30 %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
31 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
34 $x2 = COPY %carry_out_ext
38 name: narrow_scalar_sadde_big_nonpow2
41 ; CHECK-LABEL: name: narrow_scalar_sadde_big_nonpow2
42 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
43 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
44 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
45 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
46 ; CHECK: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
47 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY4]](s64)
48 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY]], [[COPY1]], %carry_in
49 ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
50 ; CHECK: %24:_(s64), %carry_out:_(s1) = G_SADDE [[COPY2]], [[COPY3]], [[UADDE3]]
51 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT %carry_out(s1)
52 ; CHECK: $x0 = COPY [[UADDE]](s64)
53 ; CHECK: $x1 = COPY [[UADDE2]](s64)
54 ; CHECK: $x2 = COPY %24(s64)
55 ; CHECK: $x3 = COPY %carry_out_ext(s64)
61 %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
62 %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
63 %carry_in:_(s1) = G_TRUNC %4
64 %add:_(s192), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
65 %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
66 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
70 $x3 = COPY %carry_out_ext
74 name: widen_scalar_sadde_s8
77 ; CHECK-LABEL: name: widen_scalar_sadde_s8
78 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
79 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
80 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
81 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY2]](s64)
82 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
83 ; CHECK: [[SEXT_INREG:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC]], 8
84 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
85 ; CHECK: [[SEXT_INREG1:%[0-9]+]]:_(s32) = G_SEXT_INREG [[TRUNC1]], 8
86 ; CHECK: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[SEXT_INREG]], [[SEXT_INREG1]], %carry_in
87 ; CHECK: [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[UADDE]](s32)
88 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[UADDE]](s32)
89 ; CHECK: [[SEXT_INREG2:%[0-9]+]]:_(s32) = G_SEXT_INREG [[COPY3]], 8
90 ; CHECK: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UADDE]](s32), [[SEXT_INREG2]]
91 ; CHECK: %add:_(s8) = COPY [[TRUNC2]](s8)
92 ; CHECK: %add_ext:_(s64) = G_ANYEXT [[UADDE]](s32)
93 ; CHECK: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
94 ; CHECK: $x0 = COPY %add_ext(s64)
95 ; CHECK: $x1 = COPY %carry_out_ext(s64)
99 %lhs:_(s8) = G_TRUNC %0
100 %rhs:_(s8) = G_TRUNC %1
101 %carry_in:_(s1) = G_TRUNC %2
102 %add:_(s8), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
103 %add_ext:_(s64) = G_ANYEXT %add
104 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
106 $x1 = COPY %carry_out_ext
110 name: test_scalar_sadde_32
113 ; CHECK-LABEL: name: test_scalar_sadde_32
114 ; CHECK: %lhs:_(s32) = COPY $w0
115 ; CHECK: %rhs:_(s32) = COPY $w1
116 ; CHECK: [[COPY:%[0-9]+]]:_(s32) = COPY $w2
117 ; CHECK: %carry_in:_(s1) = G_TRUNC [[COPY]](s32)
118 ; CHECK: %add:_(s32), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
119 ; CHECK: %carry_out_ext:_(s32) = G_ANYEXT %carry_out(s1)
120 ; CHECK: $w0 = COPY %add(s32)
121 ; CHECK: $w1 = COPY %carry_out_ext(s32)
122 %lhs:_(s32) = COPY $w0
123 %rhs:_(s32) = COPY $w1
125 %carry_in:_(s1) = G_TRUNC %2
126 %add:_(s32), %carry_out:_(s1) = G_SADDE %lhs, %rhs, %carry_in
127 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
129 $w1 = COPY %carry_out_ext