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
5 name: add_sext_s32_to_s64
9 tracksRegLiveness: true
10 machineFunctionInfo: {}
14 ; CHECK-LABEL: name: add_sext_s32_to_s64
15 ; CHECK: liveins: $w1, $x2
16 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
17 ; CHECK: %add_lhs:gpr64sp = COPY $x2
18 ; CHECK: %res:gpr64sp = ADDXrx %add_lhs, [[COPY]], 48
19 ; CHECK: $x3 = COPY %res
20 ; CHECK: RET_ReallyLR implicit $x3
21 %1:gpr(s32) = COPY $w1
22 %ext:gpr(s64) = G_SEXT %1(s32)
23 %add_lhs:gpr(s64) = COPY $x2
24 %res:gpr(s64) = G_ADD %add_lhs, %ext
26 RET_ReallyLR implicit $x3
29 name: add_and_s32_to_s64
33 tracksRegLiveness: true
34 machineFunctionInfo: {}
38 ; CHECK-LABEL: name: add_and_s32_to_s64
39 ; CHECK: liveins: $x1, $x2
40 ; CHECK: [[COPY:%[0-9]+]]:gpr64all = COPY $x1
41 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[COPY]].sub_32
42 ; CHECK: [[COPY2:%[0-9]+]]:gpr32 = COPY [[COPY1]]
43 ; CHECK: %add_lhs:gpr64sp = COPY $x2
44 ; CHECK: %res:gpr64sp = ADDXrx %add_lhs, [[COPY2]], 16
45 ; CHECK: $x3 = COPY %res
46 ; CHECK: RET_ReallyLR implicit $x3
47 %1:gpr(s64) = COPY $x1
48 %mask:gpr(s64) = G_CONSTANT i64 4294967295 ; 0xffff
49 %ext:gpr(s64) = G_AND %1(s64), %mask
50 %add_lhs:gpr(s64) = COPY $x2
51 %res:gpr(s64) = G_ADD %add_lhs, %ext
53 RET_ReallyLR implicit $x3
56 name: add_sext_s16_to_s32
60 tracksRegLiveness: true
61 machineFunctionInfo: {}
64 liveins: $w1, $w2, $x2
65 ; CHECK-LABEL: name: add_sext_s16_to_s32
66 ; CHECK: liveins: $w1, $w2, $x2
67 ; CHECK: %wide_1:gpr32 = COPY $w1
68 ; CHECK: %add_lhs:gpr32sp = COPY $w2
69 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 40
70 ; CHECK: $w3 = COPY %res
71 ; CHECK: RET_ReallyLR implicit $w3
72 %wide_1:gpr(s32) = COPY $w1
73 %1:gpr(s16) = G_TRUNC %wide_1
74 %ext:gpr(s32) = G_SEXT %1(s16)
75 %add_lhs:gpr(s32) = COPY $w2
76 %res:gpr(s32) = G_ADD %add_lhs, %ext
78 RET_ReallyLR implicit $w3
81 name: add_zext_s16_to_s32
85 tracksRegLiveness: true
86 machineFunctionInfo: {}
89 liveins: $w1, $w2, $x2
90 ; CHECK-LABEL: name: add_zext_s16_to_s32
91 ; CHECK: liveins: $w1, $w2, $x2
92 ; CHECK: %wide_1:gpr32 = COPY $w1
93 ; CHECK: %add_lhs:gpr32sp = COPY $w2
94 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 8
95 ; CHECK: $w3 = COPY %res
96 ; CHECK: RET_ReallyLR implicit $w3
97 %wide_1:gpr(s32) = COPY $w1
98 %1:gpr(s16) = G_TRUNC %wide_1
99 %ext:gpr(s32) = G_ZEXT %1(s16)
100 %add_lhs:gpr(s32) = COPY $w2
101 %res:gpr(s32) = G_ADD %add_lhs, %ext
103 RET_ReallyLR implicit $w3
106 name: add_anyext_s16_to_s32
109 regBankSelected: true
110 tracksRegLiveness: true
111 machineFunctionInfo: {}
114 liveins: $w1, $w2, $x2
115 ; CHECK-LABEL: name: add_anyext_s16_to_s32
116 ; CHECK: liveins: $w1, $w2, $x2
117 ; CHECK: %wide_1:gpr32 = COPY $w1
118 ; CHECK: %add_lhs:gpr32sp = COPY $w2
119 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 8
120 ; CHECK: $w3 = COPY %res
121 ; CHECK: RET_ReallyLR implicit $w3
122 %wide_1:gpr(s32) = COPY $w1
123 %1:gpr(s16) = G_TRUNC %wide_1
124 %ext:gpr(s32) = G_ANYEXT %1(s16)
125 %add_lhs:gpr(s32) = COPY $w2
126 %res:gpr(s32) = G_ADD %add_lhs, %ext
128 RET_ReallyLR implicit $w3
131 name: add_and_s16_to_s32_uxtb
134 regBankSelected: true
135 tracksRegLiveness: true
136 machineFunctionInfo: {}
139 liveins: $w1, $w2, $x2
140 ; CHECK-LABEL: name: add_and_s16_to_s32_uxtb
141 ; CHECK: liveins: $w1, $w2, $x2
142 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
143 ; CHECK: %add_lhs:gpr32sp = COPY $w2
144 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, [[COPY]], 0
145 ; CHECK: $w3 = COPY %res
146 ; CHECK: RET_ReallyLR implicit $w3
147 %1:gpr(s32) = COPY $w1
148 %mask:gpr(s32) = G_CONSTANT i32 255 ; 0xff
149 %ext:gpr(s32) = G_AND %1(s32), %mask
150 %add_lhs:gpr(s32) = COPY $w2
151 %res:gpr(s32) = G_ADD %add_lhs, %ext
153 RET_ReallyLR implicit $w3
156 name: add_and_s16_to_s32_uxth
159 regBankSelected: true
160 tracksRegLiveness: true
161 machineFunctionInfo: {}
164 liveins: $w1, $w2, $x2
165 ; CHECK-LABEL: name: add_and_s16_to_s32_uxth
166 ; CHECK: liveins: $w1, $w2, $x2
167 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
168 ; CHECK: %add_lhs:gpr32sp = COPY $w2
169 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, [[COPY]], 8
170 ; CHECK: $w3 = COPY %res
171 ; CHECK: RET_ReallyLR implicit $w3
172 %1:gpr(s32) = COPY $w1
173 %mask:gpr(s32) = G_CONSTANT i32 65535 ; 0xffff
174 %ext:gpr(s32) = G_AND %1(s32), %mask
175 %add_lhs:gpr(s32) = COPY $w2
176 %res:gpr(s32) = G_ADD %add_lhs, %ext
178 RET_ReallyLR implicit $w3
181 name: add_sext_s8_to_s32
184 regBankSelected: true
185 tracksRegLiveness: true
186 machineFunctionInfo: {}
189 liveins: $w1, $w2, $x2
190 ; CHECK-LABEL: name: add_sext_s8_to_s32
191 ; CHECK: liveins: $w1, $w2, $x2
192 ; CHECK: %wide_1:gpr32 = COPY $w1
193 ; CHECK: %add_lhs:gpr32sp = COPY $w2
194 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 32
195 ; CHECK: $w3 = COPY %res
196 ; CHECK: RET_ReallyLR implicit $w3
197 %wide_1:gpr(s32) = COPY $w1
198 %1:gpr(s8) = G_TRUNC %wide_1
199 %ext:gpr(s32) = G_SEXT %1(s8)
200 %add_lhs:gpr(s32) = COPY $w2
201 %res:gpr(s32) = G_ADD %add_lhs, %ext
203 RET_ReallyLR implicit $w3
206 name: add_zext_s8_to_s32
209 regBankSelected: true
210 tracksRegLiveness: true
211 machineFunctionInfo: {}
214 liveins: $w1, $w2, $x2
215 ; CHECK-LABEL: name: add_zext_s8_to_s32
216 ; CHECK: liveins: $w1, $w2, $x2
217 ; CHECK: %wide_1:gpr32 = COPY $w1
218 ; CHECK: %add_lhs:gpr32sp = COPY $w2
219 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 0
220 ; CHECK: $w3 = COPY %res
221 ; CHECK: RET_ReallyLR implicit $w3
222 %wide_1:gpr(s32) = COPY $w1
223 %1:gpr(s8) = G_TRUNC %wide_1
224 %ext:gpr(s32) = G_ZEXT %1(s8)
225 %add_lhs:gpr(s32) = COPY $w2
226 %res:gpr(s32) = G_ADD %add_lhs, %ext
228 RET_ReallyLR implicit $w3
231 name: add_anyext_s8_to_s32
234 regBankSelected: true
235 tracksRegLiveness: true
236 machineFunctionInfo: {}
239 liveins: $w1, $w2, $x2
240 ; CHECK-LABEL: name: add_anyext_s8_to_s32
241 ; CHECK: liveins: $w1, $w2, $x2
242 ; CHECK: %wide_1:gpr32 = COPY $w1
243 ; CHECK: %add_lhs:gpr32sp = COPY $w2
244 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 0
245 ; CHECK: $w3 = COPY %res
246 ; CHECK: RET_ReallyLR implicit $w3
247 %wide_1:gpr(s32) = COPY $w1
248 %1:gpr(s8) = G_TRUNC %wide_1
249 %ext:gpr(s32) = G_ANYEXT %1(s8)
250 %add_lhs:gpr(s32) = COPY $w2
251 %res:gpr(s32) = G_ADD %add_lhs, %ext
253 RET_ReallyLR implicit $w3
256 name: add_sext_with_shl
259 regBankSelected: true
260 tracksRegLiveness: true
261 machineFunctionInfo: {}
264 liveins: $w1, $w2, $x2
265 ; CHECK-LABEL: name: add_sext_with_shl
266 ; CHECK: liveins: $w1, $w2, $x2
267 ; CHECK: %wide_1:gpr32 = COPY $w1
268 ; CHECK: %add_lhs:gpr32sp = COPY $w2
269 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, %wide_1, 43
270 ; CHECK: $w3 = COPY %res
271 ; CHECK: RET_ReallyLR implicit $w3
272 %wide_1:gpr(s32) = COPY $w1
273 %1:gpr(s16) = G_TRUNC %wide_1
274 %ext:gpr(s32) = G_SEXT %1(s16)
275 %imm:gpr(s32) = G_CONSTANT i32 3
276 %shl:gpr(s32) = G_SHL %ext, %imm
277 %add_lhs:gpr(s32) = COPY $w2
278 %res:gpr(s32) = G_ADD %add_lhs, %shl
280 RET_ReallyLR implicit $w3
283 name: add_and_with_shl
286 regBankSelected: true
287 tracksRegLiveness: true
288 machineFunctionInfo: {}
291 liveins: $w1, $w2, $x2
292 ; CHECK-LABEL: name: add_and_with_shl
293 ; CHECK: liveins: $w1, $w2, $x2
294 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
295 ; CHECK: %add_lhs:gpr32sp = COPY $w2
296 ; CHECK: %res:gpr32sp = ADDWrx %add_lhs, [[COPY]], 3
297 ; CHECK: $w3 = COPY %res
298 ; CHECK: RET_ReallyLR implicit $w3
299 %1:gpr(s32) = COPY $w1
300 %mask:gpr(s32) = G_CONSTANT i32 255 ; 0xff
301 %ext:gpr(s32) = G_AND %1(s32), %mask
302 %imm:gpr(s32) = G_CONSTANT i32 3
303 %shl:gpr(s32) = G_SHL %ext, %imm
304 %add_lhs:gpr(s32) = COPY $w2
305 %res:gpr(s32) = G_ADD %add_lhs, %shl
307 RET_ReallyLR implicit $w3
310 name: dont_fold_invalid_mask
313 regBankSelected: true
314 tracksRegLiveness: true
315 machineFunctionInfo: {}
318 ; Check that we only fold when we have a supported AND mask.
319 liveins: $w1, $w2, $x2
320 ; CHECK-LABEL: name: dont_fold_invalid_mask
321 ; CHECK: liveins: $w1, $w2, $x2
322 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
323 ; CHECK: %mask:gpr32 = MOVi32imm 42
324 ; CHECK: %ext:gpr32 = ANDWrr [[COPY]], %mask
325 ; CHECK: %add_lhs:gpr32 = COPY $w2
326 ; CHECK: %res:gpr32 = ADDWrr %add_lhs, %ext
327 ; CHECK: $w3 = COPY %res
328 ; CHECK: RET_ReallyLR implicit $w3
329 %1:gpr(s32) = COPY $w1
330 %mask:gpr(s32) = G_CONSTANT i32 42
331 %ext:gpr(s32) = G_AND %1(s32), %mask
332 %add_lhs:gpr(s32) = COPY $w2
333 %res:gpr(s32) = G_ADD %add_lhs, %ext
335 RET_ReallyLR implicit $w3
338 name: dont_fold_invalid_shl
341 regBankSelected: true
342 tracksRegLiveness: true
343 machineFunctionInfo: {}
346 liveins: $w1, $w2, $x2
347 ; CHECK-LABEL: name: dont_fold_invalid_shl
348 ; CHECK: liveins: $w1, $w2, $x2
349 ; CHECK: %wide_1:gpr32 = COPY $w1
350 ; CHECK: %ext:gpr32 = SBFMWri %wide_1, 0, 15
351 ; CHECK: %add_lhs:gpr32 = COPY $w2
352 ; CHECK: %res:gpr32 = ADDWrs %add_lhs, %ext, 5
353 ; CHECK: $w3 = COPY %res
354 ; CHECK: RET_ReallyLR implicit $w3
355 %wide_1:gpr(s32) = COPY $w1
356 %1:gpr(s16) = G_TRUNC %wide_1
357 %ext:gpr(s32) = G_SEXT %1(s16)
358 %imm:gpr(s32) = G_CONSTANT i32 5
359 %shl:gpr(s32) = G_SHL %ext, %imm
360 %add_lhs:gpr(s32) = COPY $w2
361 %res:gpr(s32) = G_ADD %add_lhs, %shl
363 RET_ReallyLR implicit $w3
366 name: sub_sext_s32_to_s64
369 regBankSelected: true
370 tracksRegLiveness: true
371 machineFunctionInfo: {}
375 ; CHECK-LABEL: name: sub_sext_s32_to_s64
376 ; CHECK: liveins: $w1, $x2
377 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
378 ; CHECK: %sub_lhs:gpr64sp = COPY $x2
379 ; CHECK: %res:gpr64 = SUBSXrx %sub_lhs, [[COPY]], 48, implicit-def $nzcv
380 ; CHECK: $x3 = COPY %res
381 ; CHECK: RET_ReallyLR implicit $x3
382 %1:gpr(s32) = COPY $w1
383 %ext:gpr(s64) = G_SEXT %1(s32)
384 %sub_lhs:gpr(s64) = COPY $x2
385 %res:gpr(s64) = G_SUB %sub_lhs, %ext
387 RET_ReallyLR implicit $x3
390 name: sub_sext_s16_to_s32
393 regBankSelected: true
394 tracksRegLiveness: true
395 machineFunctionInfo: {}
398 liveins: $w1, $w2, $x2
399 ; CHECK-LABEL: name: sub_sext_s16_to_s32
400 ; CHECK: liveins: $w1, $w2, $x2
401 ; CHECK: %wide_1:gpr32 = COPY $w1
402 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
403 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 40, implicit-def $nzcv
404 ; CHECK: $w3 = COPY %res
405 ; CHECK: RET_ReallyLR implicit $w3
406 %wide_1:gpr(s32) = COPY $w1
407 %1:gpr(s16) = G_TRUNC %wide_1
408 %ext:gpr(s32) = G_SEXT %1(s16)
409 %sub_lhs:gpr(s32) = COPY $w2
410 %res:gpr(s32) = G_SUB %sub_lhs, %ext
412 RET_ReallyLR implicit $w3
415 name: sub_zext_s16_to_s32
418 regBankSelected: true
419 tracksRegLiveness: true
420 machineFunctionInfo: {}
423 liveins: $w1, $w2, $x2
424 ; CHECK-LABEL: name: sub_zext_s16_to_s32
425 ; CHECK: liveins: $w1, $w2, $x2
426 ; CHECK: %wide_1:gpr32 = COPY $w1
427 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
428 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 8, implicit-def $nzcv
429 ; CHECK: $w3 = COPY %res
430 ; CHECK: RET_ReallyLR implicit $w3
431 %wide_1:gpr(s32) = COPY $w1
432 %1:gpr(s16) = G_TRUNC %wide_1
433 %ext:gpr(s32) = G_ZEXT %1(s16)
434 %sub_lhs:gpr(s32) = COPY $w2
435 %res:gpr(s32) = G_SUB %sub_lhs, %ext
437 RET_ReallyLR implicit $w3
440 name: sub_anyext_s16_to_s32
443 regBankSelected: true
444 tracksRegLiveness: true
445 machineFunctionInfo: {}
448 liveins: $w1, $w2, $x2
449 ; CHECK-LABEL: name: sub_anyext_s16_to_s32
450 ; CHECK: liveins: $w1, $w2, $x2
451 ; CHECK: %wide_1:gpr32 = COPY $w1
452 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
453 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 8, implicit-def $nzcv
454 ; CHECK: $w3 = COPY %res
455 ; CHECK: RET_ReallyLR implicit $w3
456 %wide_1:gpr(s32) = COPY $w1
457 %1:gpr(s16) = G_TRUNC %wide_1
458 %ext:gpr(s32) = G_ANYEXT %1(s16)
459 %sub_lhs:gpr(s32) = COPY $w2
460 %res:gpr(s32) = G_SUB %sub_lhs, %ext
462 RET_ReallyLR implicit $w3
465 name: sub_and_s16_to_s32_uxtb
468 regBankSelected: true
469 tracksRegLiveness: true
470 machineFunctionInfo: {}
473 liveins: $w1, $w2, $x2
474 ; CHECK-LABEL: name: sub_and_s16_to_s32_uxtb
475 ; CHECK: liveins: $w1, $w2, $x2
476 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
477 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
478 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, [[COPY]], 0, implicit-def $nzcv
479 ; CHECK: $w3 = COPY %res
480 ; CHECK: RET_ReallyLR implicit $w3
481 %1:gpr(s32) = COPY $w1
482 %mask:gpr(s32) = G_CONSTANT i32 255 ; 0xff
483 %ext:gpr(s32) = G_AND %1(s32), %mask
484 %sub_lhs:gpr(s32) = COPY $w2
485 %res:gpr(s32) = G_SUB %sub_lhs, %ext
487 RET_ReallyLR implicit $w3
490 name: sub_and_s16_to_s32_uxth
493 regBankSelected: true
494 tracksRegLiveness: true
495 machineFunctionInfo: {}
498 liveins: $w1, $w2, $x2
499 ; CHECK-LABEL: name: sub_and_s16_to_s32_uxth
500 ; CHECK: liveins: $w1, $w2, $x2
501 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
502 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
503 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, [[COPY]], 8, implicit-def $nzcv
504 ; CHECK: $w3 = COPY %res
505 ; CHECK: RET_ReallyLR implicit $w3
506 %1:gpr(s32) = COPY $w1
507 %mask:gpr(s32) = G_CONSTANT i32 65535 ; 0xffff
508 %ext:gpr(s32) = G_AND %1(s32), %mask
509 %sub_lhs:gpr(s32) = COPY $w2
510 %res:gpr(s32) = G_SUB %sub_lhs, %ext
512 RET_ReallyLR implicit $w3
514 name: sub_sext_s8_to_s32
517 regBankSelected: true
518 tracksRegLiveness: true
519 machineFunctionInfo: {}
522 liveins: $w1, $w2, $x2
523 %wide_1:gpr(s32) = COPY $w1
524 %1:gpr(s8) = G_TRUNC %wide_1
525 %ext:gpr(s32) = G_SEXT %1(s8)
526 %sub_lhs:gpr(s32) = COPY $w2
527 %res:gpr(s32) = G_SUB %sub_lhs, %ext
529 RET_ReallyLR implicit $w3
532 name: sub_zext_s8_to_s32
535 regBankSelected: true
536 tracksRegLiveness: true
537 machineFunctionInfo: {}
540 liveins: $w1, $w2, $x2
541 ; CHECK-LABEL: name: sub_zext_s8_to_s32
542 ; CHECK: liveins: $w1, $w2, $x2
543 ; CHECK: %wide_1:gpr32 = COPY $w1
544 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
545 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 0, implicit-def $nzcv
546 ; CHECK: $w3 = COPY %res
547 ; CHECK: RET_ReallyLR implicit $w3
548 %wide_1:gpr(s32) = COPY $w1
549 %1:gpr(s8) = G_TRUNC %wide_1
550 %ext:gpr(s32) = G_ZEXT %1(s8)
551 %sub_lhs:gpr(s32) = COPY $w2
552 %res:gpr(s32) = G_SUB %sub_lhs, %ext
554 RET_ReallyLR implicit $w3
557 name: sub_anyext_s8_to_s32
560 regBankSelected: true
561 tracksRegLiveness: true
562 machineFunctionInfo: {}
565 liveins: $w1, $w2, $x2
566 ; CHECK-LABEL: name: sub_anyext_s8_to_s32
567 ; CHECK: liveins: $w1, $w2, $x2
568 ; CHECK: %wide_1:gpr32 = COPY $w1
569 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
570 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 0, implicit-def $nzcv
571 ; CHECK: $w3 = COPY %res
572 ; CHECK: RET_ReallyLR implicit $w3
573 %wide_1:gpr(s32) = COPY $w1
574 %1:gpr(s8) = G_TRUNC %wide_1
575 %ext:gpr(s32) = G_ANYEXT %1(s8)
576 %sub_lhs:gpr(s32) = COPY $w2
577 %res:gpr(s32) = G_SUB %sub_lhs, %ext
579 RET_ReallyLR implicit $w3
583 name: sub_sext_with_shl
586 regBankSelected: true
587 tracksRegLiveness: true
588 machineFunctionInfo: {}
591 liveins: $w1, $w2, $x2
592 ; CHECK-LABEL: name: sub_sext_with_shl
593 ; CHECK: liveins: $w1, $w2, $x2
594 ; CHECK: %wide_1:gpr32 = COPY $w1
595 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
596 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, %wide_1, 43, implicit-def $nzcv
597 ; CHECK: $w3 = COPY %res
598 ; CHECK: RET_ReallyLR implicit $w3
599 %wide_1:gpr(s32) = COPY $w1
600 %1:gpr(s16) = G_TRUNC %wide_1
601 %ext:gpr(s32) = G_SEXT %1(s16)
602 %imm:gpr(s32) = G_CONSTANT i32 3
603 %shl:gpr(s32) = G_SHL %ext, %imm
604 %sub_lhs:gpr(s32) = COPY $w2
605 %res:gpr(s32) = G_SUB %sub_lhs, %shl
607 RET_ReallyLR implicit $w3
610 name: sub_and_with_shl
613 regBankSelected: true
614 tracksRegLiveness: true
615 machineFunctionInfo: {}
618 liveins: $w1, $w2, $x2
619 ; CHECK-LABEL: name: sub_and_with_shl
620 ; CHECK: liveins: $w1, $w2, $x2
621 ; CHECK: [[COPY:%[0-9]+]]:gpr32 = COPY $w1
622 ; CHECK: %sub_lhs:gpr32sp = COPY $w2
623 ; CHECK: %res:gpr32 = SUBSWrx %sub_lhs, [[COPY]], 3, implicit-def $nzcv
624 ; CHECK: $w3 = COPY %res
625 ; CHECK: RET_ReallyLR implicit $w3
626 %1:gpr(s32) = COPY $w1
627 %mask:gpr(s32) = G_CONSTANT i32 255 ; 0xff
628 %ext:gpr(s32) = G_AND %1(s32), %mask
629 %imm:gpr(s32) = G_CONSTANT i32 3
630 %shl:gpr(s32) = G_SHL %ext, %imm
631 %sub_lhs:gpr(s32) = COPY $w2
632 %res:gpr(s32) = G_SUB %sub_lhs, %shl
634 RET_ReallyLR implicit $w3