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_uadde_s128
8 ; CHECK-LABEL: name: narrow_scalar_uadde_s128
9 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
10 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
11 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
12 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
13 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
14 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)
15 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
16 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
17 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY]], [[COPY2]], [[AND]]
18 ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY3]], [[UADDE1]]
19 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE3]](s32)
20 ; CHECK-NEXT: $x0 = COPY [[UADDE]](s64)
21 ; CHECK-NEXT: $x1 = COPY [[UADDE2]](s64)
22 ; CHECK-NEXT: $x2 = COPY %carry_out_ext(s64)
28 %lhs:_(s128) = G_MERGE_VALUES %0, %1
29 %rhs:_(s128) = G_MERGE_VALUES %2, %3
30 %carry_in:_(s1) = G_TRUNC %4
31 %add:_(s128), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
32 %add0:_(s64), %add1:_(s64) = G_UNMERGE_VALUES %add
33 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
36 $x2 = COPY %carry_out_ext
40 name: narrow_scalar_uadde_big_nonpow2
43 ; CHECK-LABEL: name: narrow_scalar_uadde_big_nonpow2
44 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
45 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
46 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
47 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
48 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(s64) = COPY $x4
49 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY4]](s64)
50 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
51 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
52 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[COPY]], [[COPY1]], [[AND]]
53 ; CHECK-NEXT: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s32) = G_UADDE [[COPY1]], [[COPY2]], [[UADDE1]]
54 ; CHECK-NEXT: [[UADDE4:%[0-9]+]]:_(s64), [[UADDE5:%[0-9]+]]:_(s32) = G_UADDE [[COPY2]], [[COPY3]], [[UADDE3]]
55 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[UADDE5]](s32)
56 ; CHECK-NEXT: $x0 = COPY [[UADDE]](s64)
57 ; CHECK-NEXT: $x1 = COPY [[UADDE2]](s64)
58 ; CHECK-NEXT: $x2 = COPY [[UADDE4]](s64)
59 ; CHECK-NEXT: $x3 = COPY %carry_out_ext(s64)
65 %lhs:_(s192) = G_MERGE_VALUES %0, %1, %2
66 %rhs:_(s192) = G_MERGE_VALUES %1, %2, %3
67 %carry_in:_(s1) = G_TRUNC %4
68 %add:_(s192), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
69 %add0:_(s64), %add1:_(s64), %add2:_(s64) = G_UNMERGE_VALUES %add
70 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
74 $x3 = COPY %carry_out_ext
78 name: widen_scalar_uadde_s8
81 ; CHECK-LABEL: name: widen_scalar_uadde_s8
82 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
83 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
84 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
85 ; CHECK-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
86 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
87 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[TRUNC]], [[C]]
88 ; CHECK-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
89 ; CHECK-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[TRUNC1]], [[C]]
90 ; CHECK-NEXT: [[TRUNC2:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s64)
91 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
92 ; CHECK-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[TRUNC2]], [[C1]]
93 ; CHECK-NEXT: [[UADDE:%[0-9]+]]:_(s32), [[UADDE1:%[0-9]+]]:_(s32) = G_UADDE [[AND]], [[AND1]], [[AND2]]
94 ; CHECK-NEXT: [[AND3:%[0-9]+]]:_(s32) = G_AND [[UADDE]], [[C]]
95 ; CHECK-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[UADDE]](s32), [[AND3]]
96 ; CHECK-NEXT: %add_ext:_(s64) = G_ANYEXT [[UADDE]](s32)
97 ; CHECK-NEXT: %carry_out_ext:_(s64) = G_ANYEXT [[ICMP]](s32)
98 ; CHECK-NEXT: $x0 = COPY %add_ext(s64)
99 ; CHECK-NEXT: $x1 = COPY %carry_out_ext(s64)
103 %lhs:_(s8) = G_TRUNC %0
104 %rhs:_(s8) = G_TRUNC %1
105 %carry_in:_(s1) = G_TRUNC %2
106 %add:_(s8), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
107 %add_ext:_(s64) = G_ANYEXT %add
108 %carry_out_ext:_(s64) = G_ANYEXT %carry_out
110 $x1 = COPY %carry_out_ext
114 name: test_scalar_uadde_32
117 ; CHECK-LABEL: name: test_scalar_uadde_32
118 ; CHECK: %lhs:_(s32) = COPY $w0
119 ; CHECK-NEXT: %rhs:_(s32) = COPY $w1
120 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $w2
121 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
122 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
123 ; CHECK-NEXT: %add:_(s32), %8:_(s32) = G_UADDE %lhs, %rhs, [[AND]]
124 ; CHECK-NEXT: $w0 = COPY %add(s32)
125 ; CHECK-NEXT: $w1 = COPY %8(s32)
126 %lhs:_(s32) = COPY $w0
127 %rhs:_(s32) = COPY $w1
129 %carry_in:_(s1) = G_TRUNC %2
130 %add:_(s32), %carry_out:_(s1) = G_UADDE %lhs, %rhs, %carry_in
131 %carry_out_ext:_(s32) = G_ANYEXT %carry_out
133 $w1 = COPY %carry_out_ext