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
32 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
33 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
34 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[COPY]](s32), [[COPY1]]
35 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
36 ; MIPS32-NEXT: RetRA implicit $v0
39 %2:_(s1) = G_ICMP intpred(ne), %0(s32), %1
40 %3:_(s32) = G_ANYEXT %2(s1)
48 tracksRegLiveness: true
53 ; MIPS32-LABEL: name: eq_ptr
54 ; MIPS32: liveins: $a0, $a1
56 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $a0
57 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $a1
58 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY]](p0), [[COPY1]]
59 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
60 ; MIPS32-NEXT: RetRA implicit $v0
63 %2:_(s1) = G_ICMP intpred(eq), %0(p0), %1
64 %3:_(s32) = G_ANYEXT %2(s1)
72 tracksRegLiveness: true
77 ; MIPS32-LABEL: name: ult_i8
78 ; MIPS32: liveins: $a0, $a1
80 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
81 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
82 ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
83 ; MIPS32-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]]
84 ; MIPS32-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]]
85 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[AND]](s32), [[AND1]]
86 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
87 ; MIPS32-NEXT: RetRA implicit $v0
89 %0:_(s8) = G_TRUNC %2(s32)
91 %1:_(s8) = G_TRUNC %3(s32)
92 %4:_(s1) = G_ICMP intpred(ult), %0(s8), %1
93 %5:_(s32) = G_ANYEXT %4(s1)
101 tracksRegLiveness: true
106 ; MIPS32-LABEL: name: slt_i16
107 ; MIPS32: liveins: $a0, $a1
108 ; MIPS32-NEXT: {{ $}}
109 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
110 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
111 ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
112 ; MIPS32-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32)
113 ; MIPS32-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
114 ; MIPS32-NEXT: [[SHL1:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
115 ; MIPS32-NEXT: [[ASHR1:%[0-9]+]]:_(s32) = G_ASHR [[SHL1]], [[C]](s32)
116 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[ASHR]](s32), [[ASHR1]]
117 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
118 ; MIPS32-NEXT: RetRA implicit $v0
120 %0:_(s16) = G_TRUNC %2(s32)
122 %1:_(s16) = G_TRUNC %3(s32)
123 %4:_(s1) = G_ICMP intpred(slt), %0(s16), %1
124 %5:_(s32) = G_ANYEXT %4(s1)
132 tracksRegLiveness: true
135 liveins: $a0, $a1, $a2, $a3
137 ; MIPS32-LABEL: name: eq_i64
138 ; MIPS32: liveins: $a0, $a1, $a2, $a3
139 ; MIPS32-NEXT: {{ $}}
140 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
141 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
142 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
143 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
144 ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
145 ; MIPS32-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY2]]
146 ; MIPS32-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY3]]
147 ; MIPS32-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[XOR]], [[XOR1]]
148 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[OR]](s32), [[C]]
149 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
150 ; MIPS32-NEXT: RetRA implicit $v0
153 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
156 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
157 %6:_(s1) = G_ICMP intpred(eq), %0(s64), %1
158 %7:_(s32) = G_ANYEXT %6(s1)
166 tracksRegLiveness: true
169 liveins: $a0, $a1, $a2, $a3
171 ; MIPS32-LABEL: name: ne_i64
172 ; MIPS32: liveins: $a0, $a1, $a2, $a3
173 ; MIPS32-NEXT: {{ $}}
174 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
175 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
176 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
177 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
178 ; MIPS32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
179 ; MIPS32-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY2]]
180 ; MIPS32-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY3]]
181 ; MIPS32-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[XOR]], [[XOR1]]
182 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ne), [[OR]](s32), [[C]]
183 ; MIPS32-NEXT: $v0 = COPY [[ICMP]](s32)
184 ; MIPS32-NEXT: RetRA implicit $v0
187 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
190 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
191 %6:_(s1) = G_ICMP intpred(ne), %0(s64), %1
192 %7:_(s32) = G_ANYEXT %6(s1)
200 tracksRegLiveness: true
203 liveins: $a0, $a1, $a2, $a3
205 ; MIPS32-LABEL: name: sgt_i64
206 ; MIPS32: liveins: $a0, $a1, $a2, $a3
207 ; MIPS32-NEXT: {{ $}}
208 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
209 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
210 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
211 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
212 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sgt), [[COPY1]](s32), [[COPY3]]
213 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
214 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]]
215 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
216 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
217 ; MIPS32-NEXT: RetRA implicit $v0
220 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
223 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
224 %6:_(s1) = G_ICMP intpred(sgt), %0(s64), %1
225 %7:_(s32) = G_ANYEXT %6(s1)
233 tracksRegLiveness: true
236 liveins: $a0, $a1, $a2, $a3
238 ; MIPS32-LABEL: name: sge_i64
239 ; MIPS32: liveins: $a0, $a1, $a2, $a3
240 ; MIPS32-NEXT: {{ $}}
241 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
242 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
243 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
244 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
245 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sge), [[COPY1]](s32), [[COPY3]]
246 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
247 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY]](s32), [[COPY2]]
248 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
249 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
250 ; MIPS32-NEXT: RetRA implicit $v0
253 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
256 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
257 %6:_(s1) = G_ICMP intpred(sge), %0(s64), %1
258 %7:_(s32) = G_ANYEXT %6(s1)
266 tracksRegLiveness: true
269 liveins: $a0, $a1, $a2, $a3
271 ; MIPS32-LABEL: name: slt_i64
272 ; MIPS32: liveins: $a0, $a1, $a2, $a3
273 ; MIPS32-NEXT: {{ $}}
274 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
275 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
276 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
277 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
278 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY1]](s32), [[COPY3]]
279 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
280 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
281 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
282 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
283 ; MIPS32-NEXT: RetRA implicit $v0
286 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
289 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
290 %6:_(s1) = G_ICMP intpred(slt), %0(s64), %1
291 %7:_(s32) = G_ANYEXT %6(s1)
299 tracksRegLiveness: true
302 liveins: $a0, $a1, $a2, $a3
304 ; MIPS32-LABEL: name: sle_i64
305 ; MIPS32: liveins: $a0, $a1, $a2, $a3
306 ; MIPS32-NEXT: {{ $}}
307 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
308 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
309 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
310 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
311 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(sle), [[COPY1]](s32), [[COPY3]]
312 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
313 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY]](s32), [[COPY2]]
314 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
315 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
316 ; MIPS32-NEXT: RetRA implicit $v0
319 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
322 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
323 %6:_(s1) = G_ICMP intpred(sle), %0(s64), %1
324 %7:_(s32) = G_ANYEXT %6(s1)
332 tracksRegLiveness: true
335 liveins: $a0, $a1, $a2, $a3
337 ; MIPS32-LABEL: name: ugt_i64
338 ; MIPS32: liveins: $a0, $a1, $a2, $a3
339 ; MIPS32-NEXT: {{ $}}
340 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
341 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
342 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
343 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
344 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY1]](s32), [[COPY3]]
345 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
346 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ugt), [[COPY]](s32), [[COPY2]]
347 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
348 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
349 ; MIPS32-NEXT: RetRA implicit $v0
352 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
355 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
356 %6:_(s1) = G_ICMP intpred(ugt), %0(s64), %1
357 %7:_(s32) = G_ANYEXT %6(s1)
365 tracksRegLiveness: true
368 liveins: $a0, $a1, $a2, $a3
370 ; MIPS32-LABEL: name: uge_i64
371 ; MIPS32: liveins: $a0, $a1, $a2, $a3
372 ; MIPS32-NEXT: {{ $}}
373 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
374 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
375 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
376 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
377 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY1]](s32), [[COPY3]]
378 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
379 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(uge), [[COPY]](s32), [[COPY2]]
380 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
381 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
382 ; MIPS32-NEXT: 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-NEXT: {{ $}}
406 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
407 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
408 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
409 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
410 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY1]](s32), [[COPY3]]
411 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
412 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]]
413 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
414 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
415 ; MIPS32-NEXT: RetRA implicit $v0
418 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
421 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
422 %6:_(s1) = G_ICMP intpred(ult), %0(s64), %1
423 %7:_(s32) = G_ANYEXT %6(s1)
431 tracksRegLiveness: true
434 liveins: $a0, $a1, $a2, $a3
436 ; MIPS32-LABEL: name: ule_i64
437 ; MIPS32: liveins: $a0, $a1, $a2, $a3
438 ; MIPS32-NEXT: {{ $}}
439 ; MIPS32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $a0
440 ; MIPS32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $a1
441 ; MIPS32-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $a2
442 ; MIPS32-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $a3
443 ; MIPS32-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY1]](s32), [[COPY3]]
444 ; MIPS32-NEXT: [[ICMP1:%[0-9]+]]:_(s32) = G_ICMP intpred(eq), [[COPY1]](s32), [[COPY3]]
445 ; MIPS32-NEXT: [[ICMP2:%[0-9]+]]:_(s32) = G_ICMP intpred(ule), [[COPY]](s32), [[COPY2]]
446 ; MIPS32-NEXT: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[ICMP1]](s32), [[ICMP2]], [[ICMP]]
447 ; MIPS32-NEXT: $v0 = COPY [[SELECT]](s32)
448 ; MIPS32-NEXT: RetRA implicit $v0
451 %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32)
454 %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32)
455 %6:_(s1) = G_ICMP intpred(ule), %0(s64), %1
456 %7:_(s32) = G_ANYEXT %6(s1)