1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
4 define void @test_and_regs() { ret void }
5 define void @test_and_imm() { ret void }
7 define void @test_bfc() { ret void }
8 define void @test_no_bfc_bad_mask() { ret void }
10 define void @test_mvn() { ret void }
11 define void @test_bic() { ret void }
12 define void @test_orn() { ret void }
20 - { id: 0, class: gprb }
21 - { id: 1, class: gprb }
22 - { id: 2, class: gprb }
27 ; CHECK-LABEL: name: test_and_regs
28 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
29 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
30 ; CHECK: [[t2ANDrr:%[0-9]+]]:rgpr = t2ANDrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
31 ; CHECK: $r0 = COPY [[t2ANDrr]]
32 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
37 %2(s32) = G_AND %0, %1
41 BX_RET 14, $noreg, implicit $r0
49 - { id: 0, class: gprb }
50 - { id: 1, class: gprb }
51 - { id: 2, class: gprb }
56 ; CHECK-LABEL: name: test_and_imm
57 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
58 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY]], 786444, 14 /* CC::al */, $noreg, $noreg
59 ; CHECK: $r0 = COPY [[t2ANDri]]
60 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
63 %1(s32) = G_CONSTANT i32 786444 ; 0x000c000c
64 %2(s32) = G_AND %0, %1
68 BX_RET 14, $noreg, implicit $r0
76 - { id: 0, class: gprb }
77 - { id: 1, class: gprb }
78 - { id: 2, class: gprb }
83 ; CHECK-LABEL: name: test_bfc
84 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
85 ; CHECK: [[t2BFC:%[0-9]+]]:rgpr = t2BFC [[COPY]], -65529, 14 /* CC::al */, $noreg
86 ; CHECK: $r0 = COPY [[t2BFC]]
87 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
90 %1(s32) = G_CONSTANT i32 -65529 ; 0xFFFF0007
91 %2(s32) = G_AND %0, %1
95 BX_RET 14, $noreg, implicit $r0
98 name: test_no_bfc_bad_mask
100 regBankSelected: true
103 - { id: 0, class: gprb }
104 - { id: 1, class: gprb }
105 - { id: 2, class: gprb }
110 ; CHECK-LABEL: name: test_no_bfc_bad_mask
111 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
112 ; CHECK: [[t2ANDri:%[0-9]+]]:rgpr = t2ANDri [[COPY]], 786444, 14 /* CC::al */, $noreg, $noreg
113 ; CHECK: $r0 = COPY [[t2ANDri]]
114 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
117 %1(s32) = G_CONSTANT i32 786444 ; 0x000c000c
118 %2(s32) = G_AND %0, %1
122 BX_RET 14, $noreg, implicit $r0
127 regBankSelected: true
130 - { id: 0, class: gprb }
131 - { id: 1, class: gprb }
132 - { id: 2, class: gprb }
137 ; CHECK-LABEL: name: test_mvn
138 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
139 ; CHECK: [[t2MVNr:%[0-9]+]]:rgpr = t2MVNr [[COPY]], 14 /* CC::al */, $noreg, $noreg
140 ; CHECK: $r0 = COPY [[t2MVNr]]
141 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
144 %1(s32) = G_CONSTANT i32 -1
145 %2(s32) = G_XOR %0, %1
149 BX_RET 14, $noreg, implicit $r0
154 regBankSelected: true
157 - { id: 0, class: gprb }
158 - { id: 1, class: gprb }
159 - { id: 2, class: gprb }
160 - { id: 3, class: gprb }
161 - { id: 4, class: gprb }
166 ; CHECK-LABEL: name: test_bic
167 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
168 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
169 ; CHECK: [[t2BICrr:%[0-9]+]]:rgpr = t2BICrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
170 ; CHECK: $r0 = COPY [[t2BICrr]]
171 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
175 %2(s32) = G_CONSTANT i32 -1
176 %3(s32) = G_XOR %1, %2
178 %4(s32) = G_AND %0, %3
182 BX_RET 14, $noreg, implicit $r0
187 regBankSelected: true
190 - { id: 0, class: gprb }
191 - { id: 1, class: gprb }
192 - { id: 2, class: gprb }
193 - { id: 3, class: gprb }
194 - { id: 4, class: gprb }
199 ; CHECK-LABEL: name: test_orn
200 ; CHECK: [[COPY:%[0-9]+]]:rgpr = COPY $r0
201 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
202 ; CHECK: [[t2ORNrr:%[0-9]+]]:rgpr = t2ORNrr [[COPY]], [[COPY1]], 14 /* CC::al */, $noreg, $noreg
203 ; CHECK: $r0 = COPY [[t2ORNrr]]
204 ; CHECK: BX_RET 14 /* CC::al */, $noreg, implicit $r0
208 %2(s32) = G_CONSTANT i32 -1
209 %3(s32) = G_XOR %1, %2
211 %4(s32) = G_OR %0, %3
215 BX_RET 14, $noreg, implicit $r0