1 # RUN: llc -O0 -mtriple thumb-- -mattr=+v6t2 -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
3 define void @test_icmp_eq_s32() { ret void }
4 define void @test_icmp_ne_s32() { ret void }
5 define void @test_icmp_ugt_s32() { ret void }
6 define void @test_icmp_uge_s32() { ret void }
7 define void @test_icmp_ult_s32() { ret void }
8 define void @test_icmp_ule_s32() { ret void }
9 define void @test_icmp_sgt_s32() { ret void }
10 define void @test_icmp_sge_s32() { ret void }
11 define void @test_icmp_slt_s32() { ret void }
12 define void @test_icmp_sle_s32() { ret void }
15 name: test_icmp_eq_s32
20 - { id: 0, class: gprb }
21 - { id: 1, class: gprb }
22 - { id: 2, class: gprb }
23 - { id: 3, class: gprb }
28 ; CHECK-LABEL: name: test_icmp_eq_s32
29 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
30 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
31 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
32 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
33 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 0, $cpsr
34 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
35 ; CHECK: $r0 = COPY [[ANDri]]
36 ; CHECK: BX_RET 14, $noreg, implicit $r0
39 %2(s1) = G_ICMP intpred(eq), %0(s32), %1
40 %3(s32) = G_ZEXT %2(s1)
42 BX_RET 14, $noreg, implicit $r0
45 name: test_icmp_ne_s32
50 - { id: 0, class: gprb }
51 - { id: 1, class: gprb }
52 - { id: 2, class: gprb }
53 - { id: 3, class: gprb }
58 ; CHECK-LABEL: name: test_icmp_ne_s32
59 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
60 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
61 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
62 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
63 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 1, $cpsr
64 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
65 ; CHECK: $r0 = COPY [[ANDri]]
66 ; CHECK: BX_RET 14, $noreg, implicit $r0
69 %2(s1) = G_ICMP intpred(ne), %0(s32), %1
70 %3(s32) = G_ZEXT %2(s1)
72 BX_RET 14, $noreg, implicit $r0
75 name: test_icmp_ugt_s32
80 - { id: 0, class: gprb }
81 - { id: 1, class: gprb }
82 - { id: 2, class: gprb }
83 - { id: 3, class: gprb }
88 ; CHECK-LABEL: name: test_icmp_ugt_s32
89 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
90 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
91 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
92 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
93 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 8, $cpsr
94 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
95 ; CHECK: $r0 = COPY [[ANDri]]
96 ; CHECK: BX_RET 14, $noreg, implicit $r0
99 %2(s1) = G_ICMP intpred(ugt), %0(s32), %1
100 %3(s32) = G_ZEXT %2(s1)
102 BX_RET 14, $noreg, implicit $r0
105 name: test_icmp_uge_s32
107 regBankSelected: true
110 - { id: 0, class: gprb }
111 - { id: 1, class: gprb }
112 - { id: 2, class: gprb }
113 - { id: 3, class: gprb }
118 ; CHECK-LABEL: name: test_icmp_uge_s32
119 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
120 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
121 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
122 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
123 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 2, $cpsr
124 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
125 ; CHECK: $r0 = COPY [[ANDri]]
126 ; CHECK: BX_RET 14, $noreg, implicit $r0
129 %2(s1) = G_ICMP intpred(uge), %0(s32), %1
130 %3(s32) = G_ZEXT %2(s1)
132 BX_RET 14, $noreg, implicit $r0
135 name: test_icmp_ult_s32
137 regBankSelected: true
140 - { id: 0, class: gprb }
141 - { id: 1, class: gprb }
142 - { id: 2, class: gprb }
143 - { id: 3, class: gprb }
148 ; CHECK-LABEL: name: test_icmp_ult_s32
149 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
150 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
151 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
152 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
153 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 3, $cpsr
154 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
155 ; CHECK: $r0 = COPY [[ANDri]]
156 ; CHECK: BX_RET 14, $noreg, implicit $r0
159 %2(s1) = G_ICMP intpred(ult), %0(s32), %1
160 %3(s32) = G_ZEXT %2(s1)
162 BX_RET 14, $noreg, implicit $r0
165 name: test_icmp_ule_s32
167 regBankSelected: true
170 - { id: 0, class: gprb }
171 - { id: 1, class: gprb }
172 - { id: 2, class: gprb }
173 - { id: 3, class: gprb }
178 ; CHECK-LABEL: name: test_icmp_ule_s32
179 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
180 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
181 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
182 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
183 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 9, $cpsr
184 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
185 ; CHECK: $r0 = COPY [[ANDri]]
186 ; CHECK: BX_RET 14, $noreg, implicit $r0
189 %2(s1) = G_ICMP intpred(ule), %0(s32), %1
190 %3(s32) = G_ZEXT %2(s1)
192 BX_RET 14, $noreg, implicit $r0
195 name: test_icmp_sgt_s32
197 regBankSelected: true
200 - { id: 0, class: gprb }
201 - { id: 1, class: gprb }
202 - { id: 2, class: gprb }
203 - { id: 3, class: gprb }
208 ; CHECK-LABEL: name: test_icmp_sgt_s32
209 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
210 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
211 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
212 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
213 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 12, $cpsr
214 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
215 ; CHECK: $r0 = COPY [[ANDri]]
216 ; CHECK: BX_RET 14, $noreg, implicit $r0
219 %2(s1) = G_ICMP intpred(sgt), %0(s32), %1
220 %3(s32) = G_ZEXT %2(s1)
222 BX_RET 14, $noreg, implicit $r0
225 name: test_icmp_sge_s32
227 regBankSelected: true
230 - { id: 0, class: gprb }
231 - { id: 1, class: gprb }
232 - { id: 2, class: gprb }
233 - { id: 3, class: gprb }
238 ; CHECK-LABEL: name: test_icmp_sge_s32
239 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
240 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
241 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
242 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
243 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 10, $cpsr
244 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
245 ; CHECK: $r0 = COPY [[ANDri]]
246 ; CHECK: BX_RET 14, $noreg, implicit $r0
249 %2(s1) = G_ICMP intpred(sge), %0(s32), %1
250 %3(s32) = G_ZEXT %2(s1)
252 BX_RET 14, $noreg, implicit $r0
255 name: test_icmp_slt_s32
257 regBankSelected: true
260 - { id: 0, class: gprb }
261 - { id: 1, class: gprb }
262 - { id: 2, class: gprb }
263 - { id: 3, class: gprb }
268 ; CHECK-LABEL: name: test_icmp_slt_s32
269 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
270 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
271 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
272 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
273 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 11, $cpsr
274 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
275 ; CHECK: $r0 = COPY [[ANDri]]
276 ; CHECK: BX_RET 14, $noreg, implicit $r0
279 %2(s1) = G_ICMP intpred(slt), %0(s32), %1
280 %3(s32) = G_ZEXT %2(s1)
282 BX_RET 14, $noreg, implicit $r0
285 name: test_icmp_sle_s32
287 regBankSelected: true
290 - { id: 0, class: gprb }
291 - { id: 1, class: gprb }
292 - { id: 2, class: gprb }
293 - { id: 3, class: gprb }
298 ; CHECK-LABEL: name: test_icmp_sle_s32
299 ; CHECK: [[COPY:%[0-9]+]]:gprnopc = COPY $r0
300 ; CHECK: [[COPY1:%[0-9]+]]:rgpr = COPY $r1
301 ; CHECK: [[MOVi:%[0-9]+]]:rgpr = t2MOVi 0, 14, $noreg, $noreg
302 ; CHECK: t2CMPrr [[COPY]], [[COPY1]], 14, $noreg, implicit-def $cpsr
303 ; CHECK: [[MOVCCi:%[0-9]+]]:rgpr = t2MOVCCi [[MOVi]], 1, 13, $cpsr
304 ; CHECK: [[ANDri:%[0-9]+]]:rgpr = t2ANDri [[MOVCCi]], 1, 14, $noreg, $noreg
305 ; CHECK: $r0 = COPY [[ANDri]]
306 ; CHECK: BX_RET 14, $noreg, implicit $r0
309 %2(s1) = G_ICMP intpred(sle), %0(s32), %1
310 %3(s32) = G_ZEXT %2(s1)
312 BX_RET 14, $noreg, implicit $r0