1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @and_i1() {entry: ret void}
6 define void @and_i8() {entry: ret void}
7 define void @and_i16() {entry: ret void}
8 define void @and_i32() {entry: ret void}
9 define void @and_i64() {entry: ret void}
10 define void @or_i1() {entry: ret void}
11 define void @or_i8() {entry: ret void}
12 define void @or_i16() {entry: ret void}
13 define void @or_i32() {entry: ret void}
14 define void @or_i64() {entry: ret void}
15 define void @xor_i1() {entry: ret void}
16 define void @xor_i8() {entry: ret void}
17 define void @xor_i16() {entry: ret void}
18 define void @xor_i32() {entry: ret void}
19 define void @xor_i64() {entry: ret void}
20 define void @shl(i32) {entry: ret void}
21 define void @ashr(i32) {entry: ret void}
22 define void @lshr(i32) {entry: ret void}
23 define void @lshr_i64_shift_amount(i32) {entry: ret void}
24 define void @shlv(i32, i32) {entry: ret void}
25 define void @ashrv(i32, i32) {entry: ret void}
26 define void @lshrv(i32, i32) {entry: ret void}
27 define void @shl_i16() {entry: ret void}
28 define void @ashr_i8() {entry: ret void}
29 define void @lshr_i16() {entry: ret void}
30 define void @shl_i64() {entry: ret void}
31 define void @ashl_i64() {entry: ret void}
32 define void @lshr_i64() {entry: ret void}
38 tracksRegLiveness: true
43 ; MIPS32-LABEL: name: and_i1
44 ; MIPS32: liveins: $a0, $a1
45 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
46 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
47 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
48 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
49 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
50 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
51 ; MIPS32: $v0 = COPY [[COPY4]](s32)
52 ; MIPS32: RetRA implicit $v0
54 %0:_(s1) = G_TRUNC %2(s32)
56 %1:_(s1) = G_TRUNC %3(s32)
57 %4:_(s1) = G_AND %1, %0
58 %5:_(s32) = G_ANYEXT %4(s1)
66 tracksRegLiveness: true
71 ; MIPS32-LABEL: name: and_i8
72 ; MIPS32: liveins: $a0, $a1
73 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
74 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
75 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
76 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
77 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
78 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
79 ; MIPS32: $v0 = COPY [[COPY4]](s32)
80 ; MIPS32: RetRA implicit $v0
82 %0:_(s8) = G_TRUNC %2(s32)
84 %1:_(s8) = G_TRUNC %3(s32)
85 %4:_(s8) = G_AND %1, %0
86 %5:_(s32) = G_ANYEXT %4(s8)
94 tracksRegLiveness: true
99 ; MIPS32-LABEL: name: and_i16
100 ; MIPS32: liveins: $a0, $a1
101 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
102 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
103 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
104 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
105 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY3]]
106 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[AND]](s32)
107 ; MIPS32: $v0 = COPY [[COPY4]](s32)
108 ; MIPS32: RetRA implicit $v0
110 %0:_(s16) = G_TRUNC %2(s32)
112 %1:_(s16) = G_TRUNC %3(s32)
113 %4:_(s16) = G_AND %1, %0
114 %5:_(s32) = G_ANYEXT %4(s16)
122 tracksRegLiveness: true
127 ; MIPS32-LABEL: name: and_i32
128 ; MIPS32: liveins: $a0, $a1
129 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
130 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
131 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[COPY]]
132 ; MIPS32: $v0 = COPY [[AND]](s32)
133 ; MIPS32: RetRA implicit $v0
136 %2:_(s32) = G_AND %1, %0
144 tracksRegLiveness: true
147 liveins: $a0, $a1, $a2, $a3
149 ; MIPS32-LABEL: name: and_i64
150 ; MIPS32: liveins: $a0, $a1, $a2, $a3
151 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
152 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
153 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
154 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
155 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[COPY]]
156 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY3]], [[COPY1]]
157 ; MIPS32: $v0 = COPY [[AND]](s32)
158 ; MIPS32: $v1 = COPY [[AND1]](s32)
159 ; MIPS32: RetRA implicit $v0, implicit $v1
162 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
165 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
166 %6:_(s64) = G_AND %1, %0
167 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
170 RetRA implicit $v0, implicit $v1
176 tracksRegLiveness: true
181 ; MIPS32-LABEL: name: or_i1
182 ; MIPS32: liveins: $a0, $a1
183 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
184 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
185 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
186 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
187 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
188 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
189 ; MIPS32: $v0 = COPY [[COPY4]](s32)
190 ; MIPS32: RetRA implicit $v0
192 %0:_(s1) = G_TRUNC %2(s32)
194 %1:_(s1) = G_TRUNC %3(s32)
195 %4:_(s1) = G_OR %1, %0
196 %5:_(s32) = G_ANYEXT %4(s1)
204 tracksRegLiveness: true
209 ; MIPS32-LABEL: name: or_i8
210 ; MIPS32: liveins: $a0, $a1
211 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
212 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
213 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
214 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
215 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
216 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
217 ; MIPS32: $v0 = COPY [[COPY4]](s32)
218 ; MIPS32: RetRA implicit $v0
220 %0:_(s8) = G_TRUNC %2(s32)
222 %1:_(s8) = G_TRUNC %3(s32)
223 %4:_(s8) = G_OR %1, %0
224 %5:_(s32) = G_ANYEXT %4(s8)
232 tracksRegLiveness: true
237 ; MIPS32-LABEL: name: or_i16
238 ; MIPS32: liveins: $a0, $a1
239 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
240 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
241 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
242 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
243 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY3]]
244 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[OR]](s32)
245 ; MIPS32: $v0 = COPY [[COPY4]](s32)
246 ; MIPS32: RetRA implicit $v0
248 %0:_(s16) = G_TRUNC %2(s32)
250 %1:_(s16) = G_TRUNC %3(s32)
251 %4:_(s16) = G_OR %1, %0
252 %5:_(s32) = G_ANYEXT %4(s16)
260 tracksRegLiveness: true
265 ; MIPS32-LABEL: name: or_i32
266 ; MIPS32: liveins: $a0, $a1
267 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
268 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
269 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY1]], [[COPY]]
270 ; MIPS32: $v0 = COPY [[OR]](s32)
271 ; MIPS32: RetRA implicit $v0
274 %2:_(s32) = G_OR %1, %0
282 tracksRegLiveness: true
285 liveins: $a0, $a1, $a2, $a3
287 ; MIPS32-LABEL: name: or_i64
288 ; MIPS32: liveins: $a0, $a1, $a2, $a3
289 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
290 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
291 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
292 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
293 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY2]], [[COPY]]
294 ; MIPS32: [[OR1:%[0-9]+]]:_(s32) = G_OR [[COPY3]], [[COPY1]]
295 ; MIPS32: $v0 = COPY [[OR]](s32)
296 ; MIPS32: $v1 = COPY [[OR1]](s32)
297 ; MIPS32: RetRA implicit $v0, implicit $v1
300 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
303 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
304 %6:_(s64) = G_OR %1, %0
305 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
308 RetRA implicit $v0, implicit $v1
314 tracksRegLiveness: true
319 ; MIPS32-LABEL: name: xor_i1
320 ; MIPS32: liveins: $a0, $a1
321 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
322 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
323 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
324 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
325 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY3]]
326 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[XOR]](s32)
327 ; MIPS32: $v0 = COPY [[COPY4]](s32)
328 ; MIPS32: RetRA implicit $v0
330 %0:_(s1) = G_TRUNC %2(s32)
332 %1:_(s1) = G_TRUNC %3(s32)
333 %4:_(s1) = G_XOR %1, %0
334 %5:_(s32) = G_ANYEXT %4(s1)
342 tracksRegLiveness: true
347 ; MIPS32-LABEL: name: xor_i8
348 ; MIPS32: liveins: $a0, $a1
349 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
350 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
351 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
352 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
353 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY3]]
354 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[XOR]](s32)
355 ; MIPS32: $v0 = COPY [[COPY4]](s32)
356 ; MIPS32: RetRA implicit $v0
358 %0:_(s8) = G_TRUNC %2(s32)
360 %1:_(s8) = G_TRUNC %3(s32)
361 %4:_(s8) = G_XOR %1, %0
362 %5:_(s32) = G_ANYEXT %4(s8)
370 tracksRegLiveness: true
375 ; MIPS32-LABEL: name: xor_i16
376 ; MIPS32: liveins: $a0, $a1
377 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
378 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
379 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
380 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
381 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY3]]
382 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[XOR]](s32)
383 ; MIPS32: $v0 = COPY [[COPY4]](s32)
384 ; MIPS32: RetRA implicit $v0
386 %0:_(s16) = G_TRUNC %2(s32)
388 %1:_(s16) = G_TRUNC %3(s32)
389 %4:_(s16) = G_XOR %1, %0
390 %5:_(s32) = G_ANYEXT %4(s16)
398 tracksRegLiveness: true
403 ; MIPS32-LABEL: name: xor_i32
404 ; MIPS32: liveins: $a0, $a1
405 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
406 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
407 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY]]
408 ; MIPS32: $v0 = COPY [[XOR]](s32)
409 ; MIPS32: RetRA implicit $v0
412 %2:_(s32) = G_XOR %1, %0
420 tracksRegLiveness: true
423 liveins: $a0, $a1, $a2, $a3
425 ; MIPS32-LABEL: name: xor_i64
426 ; MIPS32: liveins: $a0, $a1, $a2, $a3
427 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
428 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
429 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
430 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
431 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY2]], [[COPY]]
432 ; MIPS32: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY3]], [[COPY1]]
433 ; MIPS32: $v0 = COPY [[XOR]](s32)
434 ; MIPS32: $v1 = COPY [[XOR1]](s32)
435 ; MIPS32: RetRA implicit $v0, implicit $v1
438 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
441 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
442 %6:_(s64) = G_XOR %1, %0
443 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
446 RetRA implicit $v0, implicit $v1
452 tracksRegLiveness: true
457 ; MIPS32-LABEL: name: shl
458 ; MIPS32: liveins: $a0
459 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
460 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
461 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
462 ; MIPS32: $v0 = COPY [[SHL]](s32)
463 ; MIPS32: RetRA implicit $v0
465 %1:_(s32) = G_CONSTANT i32 1
466 %2:_(s32) = G_SHL %0, %1
474 tracksRegLiveness: true
479 ; MIPS32-LABEL: name: ashr
480 ; MIPS32: liveins: $a0
481 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
482 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
483 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s32)
484 ; MIPS32: $v0 = COPY [[ASHR]](s32)
485 ; MIPS32: RetRA implicit $v0
487 %1:_(s32) = G_CONSTANT i32 1
488 %2:_(s32) = G_ASHR %0, %1
496 tracksRegLiveness: true
501 ; MIPS32-LABEL: name: lshr
502 ; MIPS32: liveins: $a0
503 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
504 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
505 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32)
506 ; MIPS32: $v0 = COPY [[LSHR]](s32)
507 ; MIPS32: RetRA implicit $v0
509 %1:_(s32) = G_CONSTANT i32 1
510 %2:_(s32) = G_LSHR %0, %1
516 name: lshr_i64_shift_amount
518 tracksRegLiveness: true
523 ; MIPS32-LABEL: name: lshr_i64_shift_amount
524 ; MIPS32: liveins: $a0
525 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
526 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
527 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
528 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
529 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[COPY1]](s32)
530 ; MIPS32: $v0 = COPY [[LSHR]](s32)
531 ; MIPS32: RetRA implicit $v0
533 %1:_(s64) = G_CONSTANT i64 1
534 %2:_(s32) = G_LSHR %0, %1
542 tracksRegLiveness: true
547 ; MIPS32-LABEL: name: shlv
548 ; MIPS32: liveins: $a0, $a1
549 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
550 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
551 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[COPY1]](s32)
552 ; MIPS32: $v0 = COPY [[SHL]](s32)
553 ; MIPS32: RetRA implicit $v0
556 %2:_(s32) = G_SHL %0, %1
564 tracksRegLiveness: true
569 ; MIPS32-LABEL: name: ashrv
570 ; MIPS32: liveins: $a0, $a1
571 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
572 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
573 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[COPY1]](s32)
574 ; MIPS32: $v0 = COPY [[ASHR]](s32)
575 ; MIPS32: RetRA implicit $v0
578 %2:_(s32) = G_ASHR %0, %1
586 tracksRegLiveness: true
591 ; MIPS32-LABEL: name: lshrv
592 ; MIPS32: liveins: $a0, $a1
593 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
594 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
595 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[COPY1]](s32)
596 ; MIPS32: $v0 = COPY [[LSHR]](s32)
597 ; MIPS32: RetRA implicit $v0
600 %2:_(s32) = G_LSHR %0, %1
608 tracksRegLiveness: true
613 ; MIPS32-LABEL: name: shl_i16
614 ; MIPS32: liveins: $a0
615 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
616 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
617 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
618 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
619 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
620 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
621 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY2]], [[AND]](s32)
622 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[SHL]](s32)
623 ; MIPS32: $v0 = COPY [[COPY3]](s32)
624 ; MIPS32: RetRA implicit $v0
626 %0:_(s16) = G_TRUNC %1(s32)
627 %2:_(s16) = G_CONSTANT i16 2
628 %3:_(s16) = G_SHL %0, %2(s16)
629 %4:_(s32) = G_ANYEXT %3(s16)
637 tracksRegLiveness: true
642 ; MIPS32-LABEL: name: ashr_i8
643 ; MIPS32: liveins: $a0
644 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
645 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
646 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
647 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
648 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
649 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
650 ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
651 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY2]], [[C2]](s32)
652 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C2]](s32)
653 ; MIPS32: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[ASHR]], [[AND]](s32)
654 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[ASHR1]](s32)
655 ; MIPS32: $v0 = COPY [[COPY3]](s32)
656 ; MIPS32: RetRA implicit $v0
658 %0:_(s8) = G_TRUNC %1(s32)
659 %2:_(s8) = G_CONSTANT i8 2
660 %3:_(s8) = G_ASHR %0, %2(s8)
661 %4:_(s32) = G_ANYEXT %3(s8)
669 tracksRegLiveness: true
674 ; MIPS32-LABEL: name: lshr_i16
675 ; MIPS32: liveins: $a0
676 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
677 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
678 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
679 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[C]](s32)
680 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]]
681 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[COPY]](s32)
682 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C1]]
683 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND1]], [[AND]](s32)
684 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY [[LSHR]](s32)
685 ; MIPS32: $v0 = COPY [[COPY3]](s32)
686 ; MIPS32: RetRA implicit $v0
688 %0:_(s16) = G_TRUNC %1(s32)
689 %2:_(s16) = G_CONSTANT i16 2
690 %3:_(s16) = G_LSHR %0, %2(s16)
691 %4:_(s32) = G_ANYEXT %3(s16)
699 tracksRegLiveness: true
702 liveins: $a0, $a1, $a2, $a3
704 ; MIPS32-LABEL: name: shl_i64
705 ; MIPS32: liveins: $a0, $a1, $a2, $a3
706 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
707 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
708 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
709 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
710 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
711 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
712 ; MIPS32: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY4]], [[C]]
713 ; MIPS32: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY4]]
714 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
715 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[C]]
716 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY4]](s32), [[C1]]
717 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[COPY4]](s32)
718 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[SUB1]](s32)
719 ; MIPS32: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[COPY4]](s32)
720 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL1]]
721 ; MIPS32: [[SHL2:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[SUB]](s32)
722 ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
723 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
724 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C2]]
725 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[SHL]], [[C1]]
726 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
727 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
728 ; MIPS32: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[AND1]](s32), [[OR]], [[SHL2]]
729 ; MIPS32: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ICMP1]](s32)
730 ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C2]]
731 ; MIPS32: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[AND2]](s32), [[COPY1]], [[SELECT1]]
732 ; MIPS32: $v0 = COPY [[SELECT]](s32)
733 ; MIPS32: $v1 = COPY [[SELECT2]](s32)
734 ; MIPS32: RetRA implicit $v0, implicit $v1
737 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
740 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
741 %6:_(s64) = G_SHL %0, %1(s64)
742 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
745 RetRA implicit $v0, implicit $v1
751 tracksRegLiveness: true
754 liveins: $a0, $a1, $a2, $a3
756 ; MIPS32-LABEL: name: ashl_i64
757 ; MIPS32: liveins: $a0, $a1, $a2, $a3
758 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
759 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
760 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
761 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
762 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
763 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
764 ; MIPS32: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY4]], [[C]]
765 ; MIPS32: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY4]]
766 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
767 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[C]]
768 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY4]](s32), [[C1]]
769 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY1]], [[COPY4]](s32)
770 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[COPY4]](s32)
771 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[SUB1]](s32)
772 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL]]
773 ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 31
774 ; MIPS32: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[COPY1]], [[C2]](s32)
775 ; MIPS32: [[ASHR2:%[0-9]+]]:_(s32) = G_ASHR [[COPY1]], [[SUB]](s32)
776 ; MIPS32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
777 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
778 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C3]]
779 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[OR]], [[ASHR2]]
780 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ICMP1]](s32)
781 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C3]]
782 ; MIPS32: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[AND1]](s32), [[COPY]], [[SELECT]]
783 ; MIPS32: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
784 ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C3]]
785 ; MIPS32: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[AND2]](s32), [[ASHR]], [[ASHR1]]
786 ; MIPS32: $v0 = COPY [[SELECT1]](s32)
787 ; MIPS32: $v1 = COPY [[SELECT2]](s32)
788 ; MIPS32: RetRA implicit $v0, implicit $v1
791 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
794 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
795 %6:_(s64) = G_ASHR %0, %1(s64)
796 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
799 RetRA implicit $v0, implicit $v1
805 tracksRegLiveness: true
808 liveins: $a0, $a1, $a2, $a3
810 ; MIPS32-LABEL: name: lshr_i64
811 ; MIPS32: liveins: $a0, $a1, $a2, $a3
812 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
813 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
814 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
815 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
816 ; MIPS32: [[COPY4:%[0-9]+]]:_(s32) = COPY [[COPY2]](s32)
817 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
818 ; MIPS32: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY4]], [[C]]
819 ; MIPS32: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY4]]
820 ; MIPS32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
821 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY4]](s32), [[C]]
822 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY4]](s32), [[C1]]
823 ; MIPS32: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[COPY4]](s32)
824 ; MIPS32: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[COPY4]](s32)
825 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[SUB1]](s32)
826 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR1]], [[SHL]]
827 ; MIPS32: [[LSHR2:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[SUB]](s32)
828 ; MIPS32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
829 ; MIPS32: [[COPY5:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
830 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY5]], [[C2]]
831 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[OR]], [[LSHR2]]
832 ; MIPS32: [[COPY6:%[0-9]+]]:_(s32) = COPY [[ICMP1]](s32)
833 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY6]], [[C2]]
834 ; MIPS32: [[SELECT1:%[0-9]+]]:_(s32) = G_SELECT [[AND1]](s32), [[COPY]], [[SELECT]]
835 ; MIPS32: [[COPY7:%[0-9]+]]:_(s32) = COPY [[ICMP]](s32)
836 ; MIPS32: [[AND2:%[0-9]+]]:_(s32) = G_AND [[COPY7]], [[C2]]
837 ; MIPS32: [[SELECT2:%[0-9]+]]:_(s32) = G_SELECT [[AND2]](s32), [[LSHR]], [[C1]]
838 ; MIPS32: $v0 = COPY [[SELECT1]](s32)
839 ; MIPS32: $v1 = COPY [[SELECT2]](s32)
840 ; MIPS32: RetRA implicit $v0, implicit $v1
843 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
846 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
847 %6:_(s64) = G_LSHR %0, %1(s64)
848 %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64)
851 RetRA implicit $v0, implicit $v1