1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -O0 -mtriple=mipsel-linux-gnu -global-isel -verify-machineinstrs %s -o -| FileCheck %s -check-prefixes=MIPS32
4 define i32 @eq(i32 %a, i32 %b){
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: xor $4, $4, $5
8 ; MIPS32-NEXT: sltiu $4, $4, 1
9 ; MIPS32-NEXT: lui $5, 0
10 ; MIPS32-NEXT: ori $5, $5, 1
11 ; MIPS32-NEXT: and $2, $4, $5
15 %cmp = icmp eq i32 %a, %b
16 %conv = zext i1 %cmp to i32
20 define i32 @ne(i32 %a, i32 %b) {
22 ; MIPS32: # %bb.0: # %entry
23 ; MIPS32-NEXT: xor $4, $4, $5
24 ; MIPS32-NEXT: sltu $4, $zero, $4
25 ; MIPS32-NEXT: lui $5, 0
26 ; MIPS32-NEXT: ori $5, $5, 1
27 ; MIPS32-NEXT: and $2, $4, $5
31 %cmp = icmp ne i32 %a, %b
32 %conv = zext i1 %cmp to i32
36 define i32 @sgt(i32 %a, i32 %b) {
38 ; MIPS32: # %bb.0: # %entry
39 ; MIPS32-NEXT: slt $4, $5, $4
40 ; MIPS32-NEXT: lui $5, 0
41 ; MIPS32-NEXT: ori $5, $5, 1
42 ; MIPS32-NEXT: and $2, $4, $5
46 %cmp = icmp sgt i32 %a, %b
47 %conv = zext i1 %cmp to i32
51 define i32 @sge(i32 %a, i32 %b) {
53 ; MIPS32: # %bb.0: # %entry
54 ; MIPS32-NEXT: slt $4, $4, $5
55 ; MIPS32-NEXT: xori $4, $4, 1
56 ; MIPS32-NEXT: lui $5, 0
57 ; MIPS32-NEXT: ori $5, $5, 1
58 ; MIPS32-NEXT: and $2, $4, $5
62 %cmp = icmp sge i32 %a, %b
63 %conv = zext i1 %cmp to i32
67 define i32 @slt(i32 %a, i32 %b) {
69 ; MIPS32: # %bb.0: # %entry
70 ; MIPS32-NEXT: slt $4, $4, $5
71 ; MIPS32-NEXT: lui $5, 0
72 ; MIPS32-NEXT: ori $5, $5, 1
73 ; MIPS32-NEXT: and $2, $4, $5
77 %cmp = icmp slt i32 %a, %b
78 %conv = zext i1 %cmp to i32
82 define i32 @sle(i32 %a, i32 %b) {
84 ; MIPS32: # %bb.0: # %entry
85 ; MIPS32-NEXT: slt $4, $5, $4
86 ; MIPS32-NEXT: xori $4, $4, 1
87 ; MIPS32-NEXT: lui $5, 0
88 ; MIPS32-NEXT: ori $5, $5, 1
89 ; MIPS32-NEXT: and $2, $4, $5
93 %cmp = icmp sle i32 %a, %b
94 %conv = zext i1 %cmp to i32
98 define i32 @ugt(i32 %a, i32 %b) {
100 ; MIPS32: # %bb.0: # %entry
101 ; MIPS32-NEXT: sltu $4, $5, $4
102 ; MIPS32-NEXT: lui $5, 0
103 ; MIPS32-NEXT: ori $5, $5, 1
104 ; MIPS32-NEXT: and $2, $4, $5
105 ; MIPS32-NEXT: jr $ra
108 %cmp = icmp ugt i32 %a, %b
109 %conv = zext i1 %cmp to i32
113 define i32 @uge(i32 %a, i32 %b) {
115 ; MIPS32: # %bb.0: # %entry
116 ; MIPS32-NEXT: sltu $4, $4, $5
117 ; MIPS32-NEXT: xori $4, $4, 1
118 ; MIPS32-NEXT: lui $5, 0
119 ; MIPS32-NEXT: ori $5, $5, 1
120 ; MIPS32-NEXT: and $2, $4, $5
121 ; MIPS32-NEXT: jr $ra
124 %cmp = icmp uge i32 %a, %b
125 %conv = zext i1 %cmp to i32
129 define i32 @ult(i32 %a, i32 %b) {
131 ; MIPS32: # %bb.0: # %entry
132 ; MIPS32-NEXT: sltu $4, $4, $5
133 ; MIPS32-NEXT: lui $5, 0
134 ; MIPS32-NEXT: ori $5, $5, 1
135 ; MIPS32-NEXT: and $2, $4, $5
136 ; MIPS32-NEXT: jr $ra
139 %cmp = icmp ult i32 %a, %b
140 %conv = zext i1 %cmp to i32
144 define i32 @ule(i32 %a, i32 %b) {
146 ; MIPS32: # %bb.0: # %entry
147 ; MIPS32-NEXT: sltu $4, $5, $4
148 ; MIPS32-NEXT: xori $4, $4, 1
149 ; MIPS32-NEXT: lui $5, 0
150 ; MIPS32-NEXT: ori $5, $5, 1
151 ; MIPS32-NEXT: and $2, $4, $5
152 ; MIPS32-NEXT: jr $ra
155 %cmp = icmp ule i32 %a, %b
156 %conv = zext i1 %cmp to i32