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 @ne_i32() {entry: ret void}
6 define void @eq_ptr() {entry: ret void}
7 define void @ult_i8() {entry: ret void}
8 define void @slt_i16() {entry: ret void}
9 define void @eq_i64() {entry: ret void}
10 define void @ne_i64() {entry: ret void}
11 define void @sgt_i64() {entry: ret void}
12 define void @sge_i64() {entry: ret void}
13 define void @slt_i64() {entry: ret void}
14 define void @sle_i64() {entry: ret void}
15 define void @ugt_i64() {entry: ret void}
16 define void @uge_i64() {entry: ret void}
17 define void @ult_i64() {entry: ret void}
18 define void @ule_i64() {entry: ret void}
24 tracksRegLiveness: true
29 ; MIPS32-LABEL: name: ne_i32
30 ; MIPS32: liveins: $a0, $a1
31 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
32 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
33 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
34 ; MIPS32: $v0 = COPY [[ICMP]](s32)
35 ; MIPS32: RetRA implicit $v0
38 %2:_(s1) = G_ICMP intpred(ne), %0(s32), %1
39 %3:_(s32) = G_ANYEXT %2(s1)
47 tracksRegLiveness: true
52 ; MIPS32-LABEL: name: eq_ptr
53 ; MIPS32: liveins: $a0, $a1
54 ; MIPS32: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
55 ; MIPS32: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
56 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](p0), [[COPY1]]
57 ; MIPS32: $v0 = COPY [[ICMP]](s32)
58 ; MIPS32: RetRA implicit $v0
61 %2:_(s1) = G_ICMP intpred(eq), %0(p0), %1
62 %3:_(s32) = G_ANYEXT %2(s1)
70 tracksRegLiveness: true
75 ; MIPS32-LABEL: name: ult_i8
76 ; MIPS32: liveins: $a0, $a1
77 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
78 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
79 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
80 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
81 ; MIPS32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
82 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
83 ; MIPS32: $v0 = COPY [[ICMP]](s32)
84 ; MIPS32: RetRA implicit $v0
86 %0:_(s8) = G_TRUNC %2(s32)
88 %1:_(s8) = G_TRUNC %3(s32)
89 %4:_(s1) = G_ICMP intpred(ult), %0(s8), %1
90 %5:_(s32) = G_ANYEXT %4(s1)
98 tracksRegLiveness: true
103 ; MIPS32-LABEL: name: slt_i16
104 ; MIPS32: liveins: $a0, $a1
105 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
106 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
107 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
108 ; MIPS32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
109 ; MIPS32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
110 ; MIPS32: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
111 ; MIPS32: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)
112 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[ASHR]](s32), [[ASHR1]]
113 ; MIPS32: $v0 = COPY [[ICMP]](s32)
114 ; MIPS32: RetRA implicit $v0
116 %0:_(s16) = G_TRUNC %2(s32)
118 %1:_(s16) = G_TRUNC %3(s32)
119 %4:_(s1) = G_ICMP intpred(slt), %0(s16), %1
120 %5:_(s32) = G_ANYEXT %4(s1)
128 tracksRegLiveness: true
131 liveins: $a0, $a1, $a2, $a3
133 ; MIPS32-LABEL: name: eq_i64
134 ; MIPS32: liveins: $a0, $a1, $a2, $a3
135 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
136 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
137 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
138 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
139 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
140 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY2]]
141 ; MIPS32: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY3]]
142 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[XOR]], [[XOR1]]
143 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s32), [[C]]
144 ; MIPS32: $v0 = COPY [[ICMP]](s32)
145 ; MIPS32: RetRA implicit $v0
148 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
151 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
152 %6:_(s1) = G_ICMP intpred(eq), %0(s64), %1
153 %7:_(s32) = G_ANYEXT %6(s1)
161 tracksRegLiveness: true
164 liveins: $a0, $a1, $a2, $a3
166 ; MIPS32-LABEL: name: ne_i64
167 ; MIPS32: liveins: $a0, $a1, $a2, $a3
168 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
169 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
170 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
171 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
172 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
173 ; MIPS32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY2]]
174 ; MIPS32: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY3]]
175 ; MIPS32: [[OR:%[0-9]+]]:_(s32) = G_OR [[XOR]], [[XOR1]]
176 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[OR]](s32), [[C]]
177 ; MIPS32: $v0 = COPY [[ICMP]](s32)
178 ; MIPS32: RetRA implicit $v0
181 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
184 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
185 %6:_(s1) = G_ICMP intpred(ne), %0(s64), %1
186 %7:_(s32) = G_ANYEXT %6(s1)
194 tracksRegLiveness: true
197 liveins: $a0, $a1, $a2, $a3
199 ; MIPS32-LABEL: name: sgt_i64
200 ; MIPS32: liveins: $a0, $a1, $a2, $a3
201 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
202 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
203 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
204 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
205 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY1]](s32), [[COPY3]]
206 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
207 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]]
208 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
209 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
210 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
211 ; MIPS32: $v0 = COPY [[SELECT]](s32)
212 ; MIPS32: RetRA implicit $v0
215 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
218 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
219 %6:_(s1) = G_ICMP intpred(sgt), %0(s64), %1
220 %7:_(s32) = G_ANYEXT %6(s1)
228 tracksRegLiveness: true
231 liveins: $a0, $a1, $a2, $a3
233 ; MIPS32-LABEL: name: sge_i64
234 ; MIPS32: liveins: $a0, $a1, $a2, $a3
235 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
236 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
237 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
238 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
239 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sge), [[COPY1]](s32), [[COPY3]]
240 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
241 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY]](s32), [[COPY2]]
242 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
243 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
244 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
245 ; MIPS32: $v0 = COPY [[SELECT]](s32)
246 ; MIPS32: RetRA implicit $v0
249 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
252 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
253 %6:_(s1) = G_ICMP intpred(sge), %0(s64), %1
254 %7:_(s32) = G_ANYEXT %6(s1)
262 tracksRegLiveness: true
265 liveins: $a0, $a1, $a2, $a3
267 ; MIPS32-LABEL: name: slt_i64
268 ; MIPS32: liveins: $a0, $a1, $a2, $a3
269 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
270 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
271 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
272 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
273 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY1]](s32), [[COPY3]]
274 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
275 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
276 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
277 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
278 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
279 ; MIPS32: $v0 = COPY [[SELECT]](s32)
280 ; MIPS32: RetRA implicit $v0
283 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
286 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
287 %6:_(s1) = G_ICMP intpred(slt), %0(s64), %1
288 %7:_(s32) = G_ANYEXT %6(s1)
296 tracksRegLiveness: true
299 liveins: $a0, $a1, $a2, $a3
301 ; MIPS32-LABEL: name: sle_i64
302 ; MIPS32: liveins: $a0, $a1, $a2, $a3
303 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
304 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
305 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
306 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
307 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sle), [[COPY1]](s32), [[COPY3]]
308 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
309 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY]](s32), [[COPY2]]
310 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
311 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
312 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
313 ; MIPS32: $v0 = COPY [[SELECT]](s32)
314 ; MIPS32: RetRA implicit $v0
317 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
320 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
321 %6:_(s1) = G_ICMP intpred(sle), %0(s64), %1
322 %7:_(s32) = G_ANYEXT %6(s1)
330 tracksRegLiveness: true
333 liveins: $a0, $a1, $a2, $a3
335 ; MIPS32-LABEL: name: ugt_i64
336 ; MIPS32: liveins: $a0, $a1, $a2, $a3
337 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
338 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
339 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
340 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
341 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY1]](s32), [[COPY3]]
342 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
343 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]]
344 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
345 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
346 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
347 ; MIPS32: $v0 = COPY [[SELECT]](s32)
348 ; MIPS32: RetRA implicit $v0
351 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
354 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
355 %6:_(s1) = G_ICMP intpred(ugt), %0(s64), %1
356 %7:_(s32) = G_ANYEXT %6(s1)
364 tracksRegLiveness: true
367 liveins: $a0, $a1, $a2, $a3
369 ; MIPS32-LABEL: name: uge_i64
370 ; MIPS32: liveins: $a0, $a1, $a2, $a3
371 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
372 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
373 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
374 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
375 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY1]](s32), [[COPY3]]
376 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
377 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY]](s32), [[COPY2]]
378 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
379 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
380 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
381 ; MIPS32: $v0 = COPY [[SELECT]](s32)
382 ; MIPS32: RetRA implicit $v0
385 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
388 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
389 %6:_(s1) = G_ICMP intpred(uge), %0(s64), %1
390 %7:_(s32) = G_ANYEXT %6(s1)
398 tracksRegLiveness: true
401 liveins: $a0, $a1, $a2, $a3
403 ; MIPS32-LABEL: name: ult_i64
404 ; MIPS32: liveins: $a0, $a1, $a2, $a3
405 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
406 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
407 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
408 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
409 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY1]](s32), [[COPY3]]
410 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
411 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
412 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
413 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
414 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
415 ; MIPS32: $v0 = COPY [[SELECT]](s32)
416 ; MIPS32: RetRA implicit $v0
419 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
422 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
423 %6:_(s1) = G_ICMP intpred(ult), %0(s64), %1
424 %7:_(s32) = G_ANYEXT %6(s1)
432 tracksRegLiveness: true
435 liveins: $a0, $a1, $a2, $a3
437 ; MIPS32-LABEL: name: ule_i64
438 ; MIPS32: liveins: $a0, $a1, $a2, $a3
439 ; MIPS32: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
440 ; MIPS32: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
441 ; MIPS32: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
442 ; MIPS32: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
443 ; MIPS32: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY1]](s32), [[COPY3]]
444 ; MIPS32: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
445 ; MIPS32: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY]](s32), [[COPY2]]
446 ; MIPS32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
447 ; MIPS32: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP1]], [[C]]
448 ; MIPS32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[ICMP2]], [[ICMP]]
449 ; MIPS32: $v0 = COPY [[SELECT]](s32)
450 ; MIPS32: RetRA implicit $v0
453 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
456 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
457 %6:_(s1) = G_ICMP intpred(ule), %0(s64), %1
458 %7:_(s32) = G_ANYEXT %6(s1)