1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=aarch64 -run-pass=legalizer %s -o - | FileCheck %s
4 name: test_scalar_add_big
7 ; CHECK-LABEL: name: test_scalar_add_big
8 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
9 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
10 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
11 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
12 ; CHECK: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY2]]
13 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY3]], [[UADDO1]]
14 ; CHECK: $x0 = COPY [[UADDO]](s64)
15 ; CHECK: $x1 = COPY [[UADDE]](s64)
20 %4:_(s128) = G_MERGE_VALUES %0(s64), %1(s64)
21 %5:_(s128) = G_MERGE_VALUES %2(s64), %3(s64)
22 %6:_(s128) = G_ADD %4, %5
23 %7:_(s64), %8:_(s64) = G_UNMERGE_VALUES %6(s128)
29 name: test_scalar_add_big_nonpow2
32 ; CHECK-LABEL: name: test_scalar_add_big_nonpow2
33 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
34 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
35 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $x2
36 ; CHECK: [[COPY3:%[0-9]+]]:_(s64) = COPY $x3
37 ; CHECK: [[UADDO:%[0-9]+]]:_(s64), [[UADDO1:%[0-9]+]]:_(s1) = G_UADDO [[COPY]], [[COPY1]]
38 ; CHECK: [[UADDE:%[0-9]+]]:_(s64), [[UADDE1:%[0-9]+]]:_(s1) = G_UADDE [[COPY1]], [[COPY2]], [[UADDO1]]
39 ; CHECK: [[UADDE2:%[0-9]+]]:_(s64), [[UADDE3:%[0-9]+]]:_(s1) = G_UADDE [[COPY2]], [[COPY3]], [[UADDE1]]
40 ; CHECK: $x0 = COPY [[UADDO]](s64)
41 ; CHECK: $x1 = COPY [[UADDE]](s64)
42 ; CHECK: $x2 = COPY [[UADDE2]](s64)
47 %4:_(s192) = G_MERGE_VALUES %0(s64), %1(s64), %2(s64)
48 %5:_(s192) = G_MERGE_VALUES %1(s64), %2(s64), %3(s64)
49 %6:_(s192) = G_ADD %4, %5
50 %7:_(s64), %8:_(s64), %9:_(s64) = G_UNMERGE_VALUES %6(s192)
57 name: test_scalar_add_small
60 ; CHECK-LABEL: name: test_scalar_add_small
61 ; CHECK: [[COPY:%[0-9]+]]:_(s64) = COPY $x0
62 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $x1
63 ; CHECK: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64)
64 ; CHECK: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s64)
65 ; CHECK: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[TRUNC]], [[TRUNC1]]
66 ; CHECK: [[ANYEXT:%[0-9]+]]:_(s64) = G_ANYEXT [[ADD]](s32)
67 ; CHECK: $x0 = COPY [[ANYEXT]](s64)
70 %2:_(s8) = G_TRUNC %0(s64)
71 %3:_(s8) = G_TRUNC %1(s64)
72 %4:_(s8) = G_ADD %2, %3
73 %5:_(s64) = G_ANYEXT %4(s8)
81 ; CHECK-LABEL: name: test_vector_add
82 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
83 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
84 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
85 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
86 ; CHECK: [[ADD:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY]], [[COPY2]]
87 ; CHECK: [[ADD1:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY1]], [[COPY3]]
88 ; CHECK: $q0 = COPY [[ADD]](<2 x s64>)
89 ; CHECK: $q1 = COPY [[ADD1]](<2 x s64>)
90 %0:_(<2 x s64>) = COPY $q0
91 %1:_(<2 x s64>) = COPY $q1
92 %2:_(<2 x s64>) = COPY $q2
93 %3:_(<2 x s64>) = COPY $q3
94 %4:_(<4 x s64>) = G_CONCAT_VECTORS %0, %1
95 %5:_(<4 x s64>) = G_CONCAT_VECTORS %2, %3
96 %6:_(<4 x s64>) = G_ADD %4, %5
97 %7:_(<2 x s64>), %8:_(<2 x s64>) = G_UNMERGE_VALUES %6(<4 x s64>)
98 $q0 = COPY %7(<2 x s64>)
99 $q1 = COPY %8(<2 x s64>)
103 name: test_vector_add_nonpow2
106 ; CHECK-LABEL: name: test_vector_add_nonpow2
107 ; CHECK: [[COPY:%[0-9]+]]:_(<2 x s64>) = COPY $q0
108 ; CHECK: [[COPY1:%[0-9]+]]:_(<2 x s64>) = COPY $q1
109 ; CHECK: [[COPY2:%[0-9]+]]:_(<2 x s64>) = COPY $q2
110 ; CHECK: [[COPY3:%[0-9]+]]:_(<2 x s64>) = COPY $q3
111 ; CHECK: [[ADD:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY]], [[COPY1]]
112 ; CHECK: [[ADD1:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY1]], [[COPY2]]
113 ; CHECK: [[ADD2:%[0-9]+]]:_(<2 x s64>) = G_ADD [[COPY2]], [[COPY3]]
114 ; CHECK: $q0 = COPY [[ADD]](<2 x s64>)
115 ; CHECK: $q1 = COPY [[ADD1]](<2 x s64>)
116 ; CHECK: $q2 = COPY [[ADD2]](<2 x s64>)
117 %0:_(<2 x s64>) = COPY $q0
118 %1:_(<2 x s64>) = COPY $q1
119 %2:_(<2 x s64>) = COPY $q2
120 %3:_(<2 x s64>) = COPY $q3
121 %4:_(<6 x s64>) = G_CONCAT_VECTORS %0(<2 x s64>), %1(<2 x s64>), %2(<2 x s64>)
122 %5:_(<6 x s64>) = G_CONCAT_VECTORS %1(<2 x s64>), %2(<2 x s64>), %3(<2 x s64>)
123 %6:_(<6 x s64>) = G_ADD %4, %5
124 %7:_(<2 x s64>), %8:_(<2 x s64>), %9:_(<2 x s64>) = G_UNMERGE_VALUES %6(<6 x s64>)
125 $q0 = COPY %7(<2 x s64>)
126 $q1 = COPY %8(<2 x s64>)
127 $q2 = COPY %9(<2 x s64>)
132 tracksRegLiveness: true
133 machineFunctionInfo: {}
138 ; CHECK-LABEL: name: add_v8i16
139 ; CHECK: liveins: $q0, $q1
140 ; CHECK: [[COPY:%[0-9]+]]:_(<8 x s16>) = COPY $q0
141 ; CHECK: [[COPY1:%[0-9]+]]:_(<8 x s16>) = COPY $q1
142 ; CHECK: [[ADD:%[0-9]+]]:_(<8 x s16>) = G_ADD [[COPY]], [[COPY1]]
143 ; CHECK: $q0 = COPY [[ADD]](<8 x s16>)
144 ; CHECK: RET_ReallyLR implicit $q0
145 %0:_(<8 x s16>) = COPY $q0
146 %1:_(<8 x s16>) = COPY $q1
147 %2:_(<8 x s16>) = G_ADD %0, %1
148 $q0 = COPY %2(<8 x s16>)
149 RET_ReallyLR implicit $q0
155 tracksRegLiveness: true
156 machineFunctionInfo: {}
161 ; CHECK-LABEL: name: add_v16i8
162 ; CHECK: liveins: $q0, $q1
163 ; CHECK: [[COPY:%[0-9]+]]:_(<16 x s8>) = COPY $q0
164 ; CHECK: [[COPY1:%[0-9]+]]:_(<16 x s8>) = COPY $q1
165 ; CHECK: [[ADD:%[0-9]+]]:_(<16 x s8>) = G_ADD [[COPY]], [[COPY1]]
166 ; CHECK: $q0 = COPY [[ADD]](<16 x s8>)
167 ; CHECK: RET_ReallyLR implicit $q0
168 %0:_(<16 x s8>) = COPY $q0
169 %1:_(<16 x s8>) = COPY $q1
170 %2:_(<16 x s8>) = G_ADD %0, %1
171 $q0 = COPY %2(<16 x s8>)
172 RET_ReallyLR implicit $q0