1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
8 tracksRegLiveness: true
12 ; CHECK-LABEL: name: add_shl_s64_rhs
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
16 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64 = ADDXrs [[COPY]], [[COPY]], 8
17 ; CHECK-NEXT: $x0 = COPY [[ADDXrs]]
18 ; CHECK-NEXT: RET_ReallyLR implicit $x0
19 %0:gpr(s64) = COPY $x0
20 %1:gpr(s64) = G_CONSTANT i64 8
21 %2:gpr(s64) = G_SHL %0, %1:gpr(s64)
22 %3:gpr(s64) = G_ADD %0, %2:gpr(s64)
23 $x0 = COPY %3:gpr(s64)
24 RET_ReallyLR implicit $x0
31 tracksRegLiveness: true
35 ; CHECK-LABEL: name: add_shl_s64_lhs
36 ; CHECK: liveins: $x0, $x1
38 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
39 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
40 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64 = ADDXrs [[COPY1]], [[COPY]], 8
41 ; CHECK-NEXT: $x0 = COPY [[ADDXrs]]
42 ; CHECK-NEXT: RET_ReallyLR implicit $x0
43 %0:gpr(s64) = COPY $x0
44 %4:gpr(s64) = COPY $x1
45 %1:gpr(s64) = G_CONSTANT i64 8
46 %2:gpr(s64) = G_SHL %0, %1:gpr(s64)
47 %3:gpr(s64) = G_ADD %2, %4:gpr(s64)
48 $x0 = COPY %3:gpr(s64)
49 RET_ReallyLR implicit $x0
56 tracksRegLiveness: true
60 ; CHECK-LABEL: name: sub_shl_s64_rhs
63 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
64 ; CHECK-NEXT: [[SUBSXrs:%[0-9]+]]:gpr64 = SUBSXrs [[COPY]], [[COPY]], 8, implicit-def dead $nzcv
65 ; CHECK-NEXT: $x0 = COPY [[SUBSXrs]]
66 ; CHECK-NEXT: RET_ReallyLR implicit $x0
67 %0:gpr(s64) = COPY $x0
68 %1:gpr(s64) = G_CONSTANT i64 8
69 %2:gpr(s64) = G_SHL %0, %1:gpr(s64)
70 %3:gpr(s64) = G_SUB %0, %2:gpr(s64)
71 $x0 = COPY %3:gpr(s64)
72 RET_ReallyLR implicit $x0
75 name: add_lshr_s64_rhs
78 tracksRegLiveness: true
82 %0:gpr(s64) = COPY $x0
83 %1:gpr(s64) = G_CONSTANT i64 8
84 %2:gpr(s64) = G_LSHR %0, %1:gpr(s64)
85 %3:gpr(s64) = G_ADD %0, %2:gpr(s64)
86 $x0 = COPY %3:gpr(s64)
87 RET_ReallyLR implicit $x0
91 name: add_lshr_s64_lhs
94 tracksRegLiveness: true
98 ; CHECK-LABEL: name: add_lshr_s64_lhs
99 ; CHECK: liveins: $x0, $x1
101 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
102 ; CHECK-NEXT: %param2:gpr64 = COPY $x1
103 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64 = ADDXrs %param2, [[COPY]], 72
104 ; CHECK-NEXT: $x0 = COPY [[ADDXrs]]
105 ; CHECK-NEXT: RET_ReallyLR implicit $x0
106 %0:gpr(s64) = COPY $x0
107 %param2:gpr(s64) = COPY $x1
108 %1:gpr(s64) = G_CONSTANT i64 8
109 %2:gpr(s64) = G_LSHR %0, %1:gpr(s64)
110 %3:gpr(s64) = G_ADD %2, %param2:gpr(s64)
111 $x0 = COPY %3:gpr(s64)
112 RET_ReallyLR implicit $x0
116 name: sub_lshr_s64_rhs
118 regBankSelected: true
119 tracksRegLiveness: true
123 ; CHECK-LABEL: name: sub_lshr_s64_rhs
124 ; CHECK: liveins: $x0
126 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
127 ; CHECK-NEXT: [[SUBSXrs:%[0-9]+]]:gpr64 = SUBSXrs [[COPY]], [[COPY]], 72, implicit-def dead $nzcv
128 ; CHECK-NEXT: $x0 = COPY [[SUBSXrs]]
129 ; CHECK-NEXT: RET_ReallyLR implicit $x0
130 %0:gpr(s64) = COPY $x0
131 %1:gpr(s64) = G_CONSTANT i64 8
132 %2:gpr(s64) = G_LSHR %0, %1:gpr(s64)
133 %3:gpr(s64) = G_SUB %0, %2:gpr(s64)
134 $x0 = COPY %3:gpr(s64)
135 RET_ReallyLR implicit $x0
139 name: add_ashr_s64_rhs
141 regBankSelected: true
142 tracksRegLiveness: true
146 ; CHECK-LABEL: name: add_ashr_s64_rhs
147 ; CHECK: liveins: $x0
149 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
150 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64 = ADDXrs [[COPY]], [[COPY]], 136
151 ; CHECK-NEXT: $x0 = COPY [[ADDXrs]]
152 ; CHECK-NEXT: RET_ReallyLR implicit $x0
153 %0:gpr(s64) = COPY $x0
154 %1:gpr(s64) = G_CONSTANT i64 8
155 %2:gpr(s64) = G_ASHR %0, %1:gpr(s64)
156 %3:gpr(s64) = G_ADD %0, %2:gpr(s64)
157 $x0 = COPY %3:gpr(s64)
158 RET_ReallyLR implicit $x0
162 name: add_ashr_s64_lhs
164 regBankSelected: true
165 tracksRegLiveness: true
169 ; CHECK-LABEL: name: add_ashr_s64_lhs
170 ; CHECK: liveins: $x0, $x1
172 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
173 ; CHECK-NEXT: %param2:gpr64 = COPY $x1
174 ; CHECK-NEXT: [[ADDXrs:%[0-9]+]]:gpr64 = ADDXrs %param2, [[COPY]], 136
175 ; CHECK-NEXT: $x0 = COPY [[ADDXrs]]
176 ; CHECK-NEXT: RET_ReallyLR implicit $x0
177 %0:gpr(s64) = COPY $x0
178 %param2:gpr(s64) = COPY $x1
179 %1:gpr(s64) = G_CONSTANT i64 8
180 %2:gpr(s64) = G_ASHR %0, %1:gpr(s64)
181 %3:gpr(s64) = G_ADD %2, %param2:gpr(s64)
182 $x0 = COPY %3:gpr(s64)
183 RET_ReallyLR implicit $x0
187 name: sub_ashr_s64_rhs
189 regBankSelected: true
190 tracksRegLiveness: true
194 ; CHECK-LABEL: name: sub_ashr_s64_rhs
195 ; CHECK: liveins: $x0
197 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
198 ; CHECK-NEXT: [[SUBSXrs:%[0-9]+]]:gpr64 = SUBSXrs [[COPY]], [[COPY]], 136, implicit-def dead $nzcv
199 ; CHECK-NEXT: $x0 = COPY [[SUBSXrs]]
200 ; CHECK-NEXT: RET_ReallyLR implicit $x0
201 %0:gpr(s64) = COPY $x0
202 %1:gpr(s64) = G_CONSTANT i64 8
203 %2:gpr(s64) = G_ASHR %0, %1:gpr(s64)
204 %3:gpr(s64) = G_SUB %0, %2:gpr(s64)
205 $x0 = COPY %3:gpr(s64)
206 RET_ReallyLR implicit $x0
209 name: add_shl_s32_rhs
211 regBankSelected: true
212 tracksRegLiveness: true
216 %0:gpr(s32) = COPY $w0
217 %1:gpr(s32) = G_CONSTANT i32 8
218 %2:gpr(s32) = G_SHL %0, %1:gpr(s32)
219 %3:gpr(s32) = G_ADD %0, %2:gpr(s32)
220 $w0 = COPY %3:gpr(s32)
221 RET_ReallyLR implicit $w0
225 name: add_shl_s32_lhs
227 regBankSelected: true
228 tracksRegLiveness: true
232 ; CHECK-LABEL: name: add_shl_s32_lhs
233 ; CHECK: liveins: $w0, $w1
235 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
236 ; CHECK-NEXT: %param2:gpr32 = COPY $w1
237 ; CHECK-NEXT: [[ADDWrs:%[0-9]+]]:gpr32 = ADDWrs %param2, [[COPY]], 8
238 ; CHECK-NEXT: $w0 = COPY [[ADDWrs]]
239 ; CHECK-NEXT: RET_ReallyLR implicit $w0
240 %0:gpr(s32) = COPY $w0
241 %param2:gpr(s32) = COPY $w1
242 %1:gpr(s32) = G_CONSTANT i32 8
243 %2:gpr(s32) = G_SHL %0, %1:gpr(s32)
244 %3:gpr(s32) = G_ADD %2, %param2:gpr(s32)
245 $w0 = COPY %3:gpr(s32)
246 RET_ReallyLR implicit $w0
250 name: sub_shl_s32_rhs
252 regBankSelected: true
253 tracksRegLiveness: true
257 ; CHECK-LABEL: name: sub_shl_s32_rhs
258 ; CHECK: liveins: $w0
260 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
261 ; CHECK-NEXT: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs [[COPY]], [[COPY]], 8, implicit-def dead $nzcv
262 ; CHECK-NEXT: $w0 = COPY [[SUBSWrs]]
263 ; CHECK-NEXT: RET_ReallyLR implicit $w0
264 %0:gpr(s32) = COPY $w0
265 %1:gpr(s32) = G_CONSTANT i32 8
266 %2:gpr(s32) = G_SHL %0, %1:gpr(s32)
267 %3:gpr(s32) = G_SUB %0, %2:gpr(s32)
268 $w0 = COPY %3:gpr(s32)
269 RET_ReallyLR implicit $w0
273 name: add_lshr_s32_rhs
275 regBankSelected: true
276 tracksRegLiveness: true
280 ; CHECK-LABEL: name: add_lshr_s32_rhs
281 ; CHECK: liveins: $w0
283 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
284 ; CHECK-NEXT: [[ADDWrs:%[0-9]+]]:gpr32 = ADDWrs [[COPY]], [[COPY]], 72
285 ; CHECK-NEXT: $w0 = COPY [[ADDWrs]]
286 ; CHECK-NEXT: RET_ReallyLR implicit $w0
287 %0:gpr(s32) = COPY $w0
288 %1:gpr(s32) = G_CONSTANT i32 8
289 %2:gpr(s32) = G_LSHR %0, %1:gpr(s32)
290 %3:gpr(s32) = G_ADD %0, %2:gpr(s32)
291 $w0 = COPY %3:gpr(s32)
292 RET_ReallyLR implicit $w0
296 name: add_lshr_s32_lhs
298 regBankSelected: true
299 tracksRegLiveness: true
303 ; CHECK-LABEL: name: add_lshr_s32_lhs
304 ; CHECK: liveins: $w0, $w1
306 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
307 ; CHECK-NEXT: %param2:gpr32 = COPY $w1
308 ; CHECK-NEXT: [[ADDWrs:%[0-9]+]]:gpr32 = ADDWrs %param2, [[COPY]], 72
309 ; CHECK-NEXT: $w0 = COPY [[ADDWrs]]
310 ; CHECK-NEXT: RET_ReallyLR implicit $w0
311 %0:gpr(s32) = COPY $w0
312 %param2:gpr(s32) = COPY $w1
313 %1:gpr(s32) = G_CONSTANT i32 8
314 %2:gpr(s32) = G_LSHR %0, %1:gpr(s32)
315 %3:gpr(s32) = G_ADD %2, %param2:gpr(s32)
316 $w0 = COPY %3:gpr(s32)
317 RET_ReallyLR implicit $w0
321 name: sub_lshr_s32_rhs
323 regBankSelected: true
324 tracksRegLiveness: true
328 ; CHECK-LABEL: name: sub_lshr_s32_rhs
329 ; CHECK: liveins: $w0
331 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
332 ; CHECK-NEXT: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs [[COPY]], [[COPY]], 72, implicit-def dead $nzcv
333 ; CHECK-NEXT: $w0 = COPY [[SUBSWrs]]
334 ; CHECK-NEXT: RET_ReallyLR implicit $w0
335 %0:gpr(s32) = COPY $w0
336 %1:gpr(s32) = G_CONSTANT i32 8
337 %2:gpr(s32) = G_LSHR %0, %1:gpr(s32)
338 %3:gpr(s32) = G_SUB %0, %2:gpr(s32)
339 $w0 = COPY %3:gpr(s32)
340 RET_ReallyLR implicit $w0
344 name: add_ashr_s32_rhs
346 regBankSelected: true
347 tracksRegLiveness: true
351 ; CHECK-LABEL: name: add_ashr_s32_rhs
352 ; CHECK: liveins: $w0
354 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
355 ; CHECK-NEXT: [[ADDWrs:%[0-9]+]]:gpr32 = ADDWrs [[COPY]], [[COPY]], 136
356 ; CHECK-NEXT: $w0 = COPY [[ADDWrs]]
357 ; CHECK-NEXT: RET_ReallyLR implicit $w0
358 %0:gpr(s32) = COPY $w0
359 %1:gpr(s32) = G_CONSTANT i32 8
360 %2:gpr(s32) = G_ASHR %0, %1:gpr(s32)
361 %3:gpr(s32) = G_ADD %0, %2:gpr(s32)
362 $w0 = COPY %3:gpr(s32)
363 RET_ReallyLR implicit $w0
367 name: add_ashr_s32_lhs
369 regBankSelected: true
370 tracksRegLiveness: true
374 ; CHECK-LABEL: name: add_ashr_s32_lhs
375 ; CHECK: liveins: $w0, $w1
377 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
378 ; CHECK-NEXT: %param2:gpr32 = COPY $w1
379 ; CHECK-NEXT: [[ADDWrs:%[0-9]+]]:gpr32 = ADDWrs %param2, [[COPY]], 136
380 ; CHECK-NEXT: $w0 = COPY [[ADDWrs]]
381 ; CHECK-NEXT: RET_ReallyLR implicit $w0
382 %0:gpr(s32) = COPY $w0
383 %param2:gpr(s32) = COPY $w1
384 %1:gpr(s32) = G_CONSTANT i32 8
385 %2:gpr(s32) = G_ASHR %0, %1:gpr(s32)
386 %3:gpr(s32) = G_ADD %2, %param2:gpr(s32)
387 $w0 = COPY %3:gpr(s32)
388 RET_ReallyLR implicit $w0
392 name: sub_ashr_s32_rhs
394 regBankSelected: true
395 tracksRegLiveness: true
399 ; CHECK-LABEL: name: sub_ashr_s32_rhs
400 ; CHECK: liveins: $w0
402 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr32 = COPY $w0
403 ; CHECK-NEXT: [[SUBSWrs:%[0-9]+]]:gpr32 = SUBSWrs [[COPY]], [[COPY]], 136, implicit-def dead $nzcv
404 ; CHECK-NEXT: $w0 = COPY [[SUBSWrs]]
405 ; CHECK-NEXT: RET_ReallyLR implicit $w0
406 %0:gpr(s32) = COPY $w0
407 %1:gpr(s32) = G_CONSTANT i32 8
408 %2:gpr(s32) = G_ASHR %0, %1:gpr(s32)
409 %3:gpr(s32) = G_SUB %0, %2:gpr(s32)
410 $w0 = COPY %3:gpr(s32)
411 RET_ReallyLR implicit $w0