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 i1 @eq_i32(i32 %a, i32 %b){
5 ; MIPS32-LABEL: eq_i32:
6 ; MIPS32: # %bb.0: # %entry
7 ; MIPS32-NEXT: xor $1, $4, $5
8 ; MIPS32-NEXT: sltiu $2, $1, 1
12 %cmp = icmp eq i32 %a, %b
16 define i1 @ne_i32(i32 %a, i32 %b) {
17 ; MIPS32-LABEL: ne_i32:
18 ; MIPS32: # %bb.0: # %entry
19 ; MIPS32-NEXT: xor $1, $4, $5
20 ; MIPS32-NEXT: sltu $2, $zero, $1
24 %cmp = icmp ne i32 %a, %b
28 define i1 @sgt_i32(i32 %a, i32 %b) {
29 ; MIPS32-LABEL: sgt_i32:
30 ; MIPS32: # %bb.0: # %entry
31 ; MIPS32-NEXT: slt $2, $5, $4
35 %cmp = icmp sgt i32 %a, %b
39 define i1 @sge_i32(i32 %a, i32 %b) {
40 ; MIPS32-LABEL: sge_i32:
41 ; MIPS32: # %bb.0: # %entry
42 ; MIPS32-NEXT: slt $1, $4, $5
43 ; MIPS32-NEXT: xori $2, $1, 1
47 %cmp = icmp sge i32 %a, %b
51 define i1 @slt_i32(i32 %a, i32 %b) {
52 ; MIPS32-LABEL: slt_i32:
53 ; MIPS32: # %bb.0: # %entry
54 ; MIPS32-NEXT: slt $2, $4, $5
58 %cmp = icmp slt i32 %a, %b
62 define i1 @sle_i32(i32 %a, i32 %b) {
63 ; MIPS32-LABEL: sle_i32:
64 ; MIPS32: # %bb.0: # %entry
65 ; MIPS32-NEXT: slt $1, $5, $4
66 ; MIPS32-NEXT: xori $2, $1, 1
70 %cmp = icmp sle i32 %a, %b
74 define i1 @ugt_i32(i32 %a, i32 %b) {
75 ; MIPS32-LABEL: ugt_i32:
76 ; MIPS32: # %bb.0: # %entry
77 ; MIPS32-NEXT: sltu $2, $5, $4
81 %cmp = icmp ugt i32 %a, %b
85 define i1 @uge_i32(i32 %a, i32 %b) {
86 ; MIPS32-LABEL: uge_i32:
87 ; MIPS32: # %bb.0: # %entry
88 ; MIPS32-NEXT: sltu $1, $4, $5
89 ; MIPS32-NEXT: xori $2, $1, 1
93 %cmp = icmp uge i32 %a, %b
97 define i1 @ult_i32(i32 %a, i32 %b) {
98 ; MIPS32-LABEL: ult_i32:
99 ; MIPS32: # %bb.0: # %entry
100 ; MIPS32-NEXT: sltu $2, $4, $5
101 ; MIPS32-NEXT: jr $ra
104 %cmp = icmp ult i32 %a, %b
108 define i1 @ule_i32(i32 %a, i32 %b) {
109 ; MIPS32-LABEL: ule_i32:
110 ; MIPS32: # %bb.0: # %entry
111 ; MIPS32-NEXT: sltu $1, $5, $4
112 ; MIPS32-NEXT: xori $2, $1, 1
113 ; MIPS32-NEXT: jr $ra
116 %cmp = icmp ule i32 %a, %b
120 define i1 @eq_ptr(i32* %a, i32* %b){
121 ; MIPS32-LABEL: eq_ptr:
122 ; MIPS32: # %bb.0: # %entry
123 ; MIPS32-NEXT: xor $1, $4, $5
124 ; MIPS32-NEXT: sltiu $2, $1, 1
125 ; MIPS32-NEXT: jr $ra
128 %cmp = icmp eq i32* %a, %b
132 define i1 @ult_i8(i8 %a, i8 %b) {
133 ; MIPS32-LABEL: ult_i8:
134 ; MIPS32: # %bb.0: # %entry
135 ; MIPS32-NEXT: ori $1, $zero, 255
136 ; MIPS32-NEXT: and $2, $4, $1
137 ; MIPS32-NEXT: and $1, $5, $1
138 ; MIPS32-NEXT: sltu $2, $2, $1
139 ; MIPS32-NEXT: jr $ra
142 %cmp = icmp ult i8 %a, %b
146 define i1 @slt_i16(i16 %a, i16 %b) {
147 ; MIPS32-LABEL: slt_i16:
148 ; MIPS32: # %bb.0: # %entry
149 ; MIPS32-NEXT: sll $1, $4, 16
150 ; MIPS32-NEXT: sra $1, $1, 16
151 ; MIPS32-NEXT: sll $2, $5, 16
152 ; MIPS32-NEXT: sra $2, $2, 16
153 ; MIPS32-NEXT: slt $2, $1, $2
154 ; MIPS32-NEXT: jr $ra
157 %cmp = icmp slt i16 %a, %b
161 define i1 @eq_i64(i64 %a, i64 %b){
162 ; MIPS32-LABEL: eq_i64:
163 ; MIPS32: # %bb.0: # %entry
164 ; MIPS32-NEXT: xor $1, $4, $6
165 ; MIPS32-NEXT: xor $2, $5, $7
166 ; MIPS32-NEXT: or $1, $1, $2
167 ; MIPS32-NEXT: ori $2, $zero, 0
168 ; MIPS32-NEXT: xor $1, $1, $2
169 ; MIPS32-NEXT: sltiu $2, $1, 1
170 ; MIPS32-NEXT: jr $ra
173 %cmp = icmp eq i64 %a, %b
177 define i1 @ne_i64(i64 %a, i64 %b) {
178 ; MIPS32-LABEL: ne_i64:
179 ; MIPS32: # %bb.0: # %entry
180 ; MIPS32-NEXT: xor $1, $4, $6
181 ; MIPS32-NEXT: xor $2, $5, $7
182 ; MIPS32-NEXT: or $1, $1, $2
183 ; MIPS32-NEXT: ori $2, $zero, 0
184 ; MIPS32-NEXT: xor $1, $1, $2
185 ; MIPS32-NEXT: sltu $2, $zero, $1
186 ; MIPS32-NEXT: jr $ra
189 %cmp = icmp ne i64 %a, %b
193 define i1 @sgt_i64(i64 %a, i64 %b) {
194 ; MIPS32-LABEL: sgt_i64:
195 ; MIPS32: # %bb.0: # %entry
196 ; MIPS32-NEXT: slt $1, $7, $5
197 ; MIPS32-NEXT: xor $2, $5, $7
198 ; MIPS32-NEXT: sltiu $2, $2, 1
199 ; MIPS32-NEXT: sltu $3, $6, $4
200 ; MIPS32-NEXT: ori $4, $zero, 1
201 ; MIPS32-NEXT: and $2, $2, $4
202 ; MIPS32-NEXT: movn $1, $3, $2
203 ; MIPS32-NEXT: move $2, $1
204 ; MIPS32-NEXT: jr $ra
207 %cmp = icmp sgt i64 %a, %b
211 define i1 @sge_i64(i64 %a, i64 %b) {
212 ; MIPS32-LABEL: sge_i64:
213 ; MIPS32: # %bb.0: # %entry
214 ; MIPS32-NEXT: slt $1, $5, $7
215 ; MIPS32-NEXT: xori $1, $1, 1
216 ; MIPS32-NEXT: xor $2, $5, $7
217 ; MIPS32-NEXT: sltiu $2, $2, 1
218 ; MIPS32-NEXT: sltu $3, $4, $6
219 ; MIPS32-NEXT: xori $3, $3, 1
220 ; MIPS32-NEXT: ori $4, $zero, 1
221 ; MIPS32-NEXT: and $2, $2, $4
222 ; MIPS32-NEXT: movn $1, $3, $2
223 ; MIPS32-NEXT: move $2, $1
224 ; MIPS32-NEXT: jr $ra
227 %cmp = icmp sge i64 %a, %b
231 define i1 @slt_i64(i64 %a, i64 %b) {
232 ; MIPS32-LABEL: slt_i64:
233 ; MIPS32: # %bb.0: # %entry
234 ; MIPS32-NEXT: slt $1, $5, $7
235 ; MIPS32-NEXT: xor $2, $5, $7
236 ; MIPS32-NEXT: sltiu $2, $2, 1
237 ; MIPS32-NEXT: sltu $3, $4, $6
238 ; MIPS32-NEXT: ori $4, $zero, 1
239 ; MIPS32-NEXT: and $2, $2, $4
240 ; MIPS32-NEXT: movn $1, $3, $2
241 ; MIPS32-NEXT: move $2, $1
242 ; MIPS32-NEXT: jr $ra
245 %cmp = icmp slt i64 %a, %b
249 define i1 @sle_i64(i64 %a, i64 %b) {
250 ; MIPS32-LABEL: sle_i64:
251 ; MIPS32: # %bb.0: # %entry
252 ; MIPS32-NEXT: slt $1, $7, $5
253 ; MIPS32-NEXT: xori $1, $1, 1
254 ; MIPS32-NEXT: xor $2, $5, $7
255 ; MIPS32-NEXT: sltiu $2, $2, 1
256 ; MIPS32-NEXT: sltu $3, $6, $4
257 ; MIPS32-NEXT: xori $3, $3, 1
258 ; MIPS32-NEXT: ori $4, $zero, 1
259 ; MIPS32-NEXT: and $2, $2, $4
260 ; MIPS32-NEXT: movn $1, $3, $2
261 ; MIPS32-NEXT: move $2, $1
262 ; MIPS32-NEXT: jr $ra
265 %cmp = icmp sle i64 %a, %b
269 define i1 @ugt_i64(i64 %a, i64 %b) {
270 ; MIPS32-LABEL: ugt_i64:
271 ; MIPS32: # %bb.0: # %entry
272 ; MIPS32-NEXT: sltu $1, $7, $5
273 ; MIPS32-NEXT: xor $2, $5, $7
274 ; MIPS32-NEXT: sltiu $2, $2, 1
275 ; MIPS32-NEXT: sltu $3, $6, $4
276 ; MIPS32-NEXT: ori $4, $zero, 1
277 ; MIPS32-NEXT: and $2, $2, $4
278 ; MIPS32-NEXT: movn $1, $3, $2
279 ; MIPS32-NEXT: move $2, $1
280 ; MIPS32-NEXT: jr $ra
283 %cmp = icmp ugt i64 %a, %b
287 define i1 @uge_i64(i64 %a, i64 %b) {
288 ; MIPS32-LABEL: uge_i64:
289 ; MIPS32: # %bb.0: # %entry
290 ; MIPS32-NEXT: sltu $1, $5, $7
291 ; MIPS32-NEXT: xori $1, $1, 1
292 ; MIPS32-NEXT: xor $2, $5, $7
293 ; MIPS32-NEXT: sltiu $2, $2, 1
294 ; MIPS32-NEXT: sltu $3, $4, $6
295 ; MIPS32-NEXT: xori $3, $3, 1
296 ; MIPS32-NEXT: ori $4, $zero, 1
297 ; MIPS32-NEXT: and $2, $2, $4
298 ; MIPS32-NEXT: movn $1, $3, $2
299 ; MIPS32-NEXT: move $2, $1
300 ; MIPS32-NEXT: jr $ra
303 %cmp = icmp uge i64 %a, %b
307 define i1 @ult_i64(i64 %a, i64 %b) {
308 ; MIPS32-LABEL: ult_i64:
309 ; MIPS32: # %bb.0: # %entry
310 ; MIPS32-NEXT: sltu $1, $5, $7
311 ; MIPS32-NEXT: xor $2, $5, $7
312 ; MIPS32-NEXT: sltiu $2, $2, 1
313 ; MIPS32-NEXT: sltu $3, $4, $6
314 ; MIPS32-NEXT: ori $4, $zero, 1
315 ; MIPS32-NEXT: and $2, $2, $4
316 ; MIPS32-NEXT: movn $1, $3, $2
317 ; MIPS32-NEXT: move $2, $1
318 ; MIPS32-NEXT: jr $ra
321 %cmp = icmp ult i64 %a, %b
325 define i1 @ule_i64(i64 %a, i64 %b) {
326 ; MIPS32-LABEL: ule_i64:
327 ; MIPS32: # %bb.0: # %entry
328 ; MIPS32-NEXT: sltu $1, $7, $5
329 ; MIPS32-NEXT: xori $1, $1, 1
330 ; MIPS32-NEXT: xor $2, $5, $7
331 ; MIPS32-NEXT: sltiu $2, $2, 1
332 ; MIPS32-NEXT: sltu $3, $6, $4
333 ; MIPS32-NEXT: xori $3, $3, 1
334 ; MIPS32-NEXT: ori $4, $zero, 1
335 ; MIPS32-NEXT: and $2, $2, $4
336 ; MIPS32-NEXT: movn $1, $3, $2
337 ; MIPS32-NEXT: move $2, $1
338 ; MIPS32-NEXT: jr $ra
341 %cmp = icmp ule i64 %a, %b