1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=MIPS32
5 define void @add_i32() {entry: ret void}
6 define void @add_imm() {entry: ret void}
7 define void @add_negative_imm() {entry: ret void}
8 define void @add_not_imm32SExt16() {entry: ret void}
16 tracksRegLiveness: true
21 ; MIPS32-LABEL: name: add_i32
22 ; MIPS32: liveins: $a0, $a1
23 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
24 ; MIPS32: [[COPY1:%[0-9]+]]:gpr32 = COPY $a1
25 ; MIPS32: [[ADDu:%[0-9]+]]:gpr32 = ADDu [[COPY]], [[COPY1]]
26 ; MIPS32: $v0 = COPY [[ADDu]]
27 ; MIPS32: RetRA implicit $v0
28 %0:gprb(s32) = COPY $a0
29 %1:gprb(s32) = COPY $a1
30 %2:gprb(s32) = G_ADD %0, %1
40 tracksRegLiveness: true
45 ; MIPS32-LABEL: name: add_imm
46 ; MIPS32: liveins: $a0
47 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
48 ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu [[COPY]], 3
49 ; MIPS32: $v0 = COPY [[ADDiu]]
50 ; MIPS32: RetRA implicit $v0
51 %0:gprb(s32) = COPY $a0
52 %1:gprb(s32) = G_CONSTANT i32 3
53 %2:gprb(s32) = G_ADD %0, %1
59 name: add_negative_imm
63 tracksRegLiveness: true
68 ; MIPS32-LABEL: name: add_negative_imm
69 ; MIPS32: liveins: $a0
70 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
71 ; MIPS32: [[ADDiu:%[0-9]+]]:gpr32 = ADDiu [[COPY]], -3
72 ; MIPS32: $v0 = COPY [[ADDiu]]
73 ; MIPS32: RetRA implicit $v0
74 %0:gprb(s32) = COPY $a0
75 %1:gprb(s32) = G_CONSTANT i32 -3
76 %2:gprb(s32) = G_ADD %0, %1
82 name: add_not_imm32SExt16
86 tracksRegLiveness: true
91 ; MIPS32-LABEL: name: add_not_imm32SExt16
92 ; MIPS32: liveins: $a0
93 ; MIPS32: [[COPY:%[0-9]+]]:gpr32 = COPY $a0
94 ; MIPS32: [[ORi:%[0-9]+]]:gpr32 = ORi $zero, 65535
95 ; MIPS32: [[ADDu:%[0-9]+]]:gpr32 = ADDu [[COPY]], [[ORi]]
96 ; MIPS32: $v0 = COPY [[ADDu]]
97 ; MIPS32: RetRA implicit $v0
98 %0:gprb(s32) = COPY $a0
99 %1:gprb(s32) = G_CONSTANT i32 65535
100 %2:gprb(s32) = G_ADD %0, %1