1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefix=SDAG-X64
3 ; RUN: llc < %s -fast-isel -fast-isel-abort=1 -mtriple=x86_64-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefix=FAST-X64
4 ; RUN: llc < %s -global-isel -global-isel-abort=1 -mtriple=x86_64-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefixes=GISEL-X64
5 ; RUN: llc < %s -mtriple=i686-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefixes=SDAG-X86
6 ; Allow fast-isel to fallback to selection dag on x86
7 ; RUN: llc < %s -fast-isel -mtriple=i686-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefixes=FAST-X86
8 ; RUN: llc < %s -global-isel -global-isel-abort=1 -mtriple=i686-apple-darwin10 -verify-machineinstrs | FileCheck %s --check-prefixes=GISEL-X86
10 define i32 @test_icmp_eq_i8(i8 %a, i8 %b) {
11 ; SDAG-X64-LABEL: test_icmp_eq_i8:
13 ; SDAG-X64-NEXT: xorl %eax, %eax
14 ; SDAG-X64-NEXT: cmpb %sil, %dil
15 ; SDAG-X64-NEXT: sete %al
18 ; FAST-X64-LABEL: test_icmp_eq_i8:
20 ; FAST-X64-NEXT: cmpb %sil, %dil
21 ; FAST-X64-NEXT: sete %al
22 ; FAST-X64-NEXT: andb $1, %al
23 ; FAST-X64-NEXT: movzbl %al, %eax
26 ; GISEL-X64-LABEL: test_icmp_eq_i8:
27 ; GISEL-X64: ## %bb.0:
28 ; GISEL-X64-NEXT: xorl %eax, %eax
29 ; GISEL-X64-NEXT: cmpb %sil, %dil
30 ; GISEL-X64-NEXT: sete %al
31 ; GISEL-X64-NEXT: andl $1, %eax
32 ; GISEL-X64-NEXT: retq
34 ; SDAG-X86-LABEL: test_icmp_eq_i8:
36 ; SDAG-X86-NEXT: movzbl {{[0-9]+}}(%esp), %ecx
37 ; SDAG-X86-NEXT: xorl %eax, %eax
38 ; SDAG-X86-NEXT: cmpb {{[0-9]+}}(%esp), %cl
39 ; SDAG-X86-NEXT: sete %al
42 ; FAST-X86-LABEL: test_icmp_eq_i8:
44 ; FAST-X86-NEXT: movzbl {{[0-9]+}}(%esp), %eax
45 ; FAST-X86-NEXT: cmpb %al, {{[0-9]+}}(%esp)
46 ; FAST-X86-NEXT: sete %al
47 ; FAST-X86-NEXT: andb $1, %al
48 ; FAST-X86-NEXT: movzbl %al, %eax
51 ; GISEL-X86-LABEL: test_icmp_eq_i8:
52 ; GISEL-X86: ## %bb.0:
53 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
54 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
55 ; GISEL-X86-NEXT: xorl %eax, %eax
56 ; GISEL-X86-NEXT: cmpb %dl, %cl
57 ; GISEL-X86-NEXT: sete %al
58 ; GISEL-X86-NEXT: andl $1, %eax
59 ; GISEL-X86-NEXT: retl
60 %r = icmp eq i8 %a, %b
61 %res = zext i1 %r to i32
65 define i32 @test_icmp_eq_i16(i16 %a, i16 %b) {
66 ; SDAG-X64-LABEL: test_icmp_eq_i16:
68 ; SDAG-X64-NEXT: xorl %eax, %eax
69 ; SDAG-X64-NEXT: cmpw %si, %di
70 ; SDAG-X64-NEXT: sete %al
73 ; FAST-X64-LABEL: test_icmp_eq_i16:
75 ; FAST-X64-NEXT: cmpw %si, %di
76 ; FAST-X64-NEXT: sete %al
77 ; FAST-X64-NEXT: andb $1, %al
78 ; FAST-X64-NEXT: movzbl %al, %eax
81 ; GISEL-X64-LABEL: test_icmp_eq_i16:
82 ; GISEL-X64: ## %bb.0:
83 ; GISEL-X64-NEXT: xorl %eax, %eax
84 ; GISEL-X64-NEXT: cmpw %si, %di
85 ; GISEL-X64-NEXT: sete %al
86 ; GISEL-X64-NEXT: andl $1, %eax
87 ; GISEL-X64-NEXT: retq
89 ; SDAG-X86-LABEL: test_icmp_eq_i16:
91 ; SDAG-X86-NEXT: movzwl {{[0-9]+}}(%esp), %ecx
92 ; SDAG-X86-NEXT: xorl %eax, %eax
93 ; SDAG-X86-NEXT: cmpw {{[0-9]+}}(%esp), %cx
94 ; SDAG-X86-NEXT: sete %al
97 ; FAST-X86-LABEL: test_icmp_eq_i16:
99 ; FAST-X86-NEXT: movzwl {{[0-9]+}}(%esp), %eax
100 ; FAST-X86-NEXT: cmpw %ax, {{[0-9]+}}(%esp)
101 ; FAST-X86-NEXT: sete %al
102 ; FAST-X86-NEXT: andb $1, %al
103 ; FAST-X86-NEXT: movzbl %al, %eax
104 ; FAST-X86-NEXT: retl
106 ; GISEL-X86-LABEL: test_icmp_eq_i16:
107 ; GISEL-X86: ## %bb.0:
108 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
109 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
110 ; GISEL-X86-NEXT: xorl %eax, %eax
111 ; GISEL-X86-NEXT: cmpw %dx, %cx
112 ; GISEL-X86-NEXT: sete %al
113 ; GISEL-X86-NEXT: andl $1, %eax
114 ; GISEL-X86-NEXT: retl
115 %r = icmp eq i16 %a, %b
116 %res = zext i1 %r to i32
120 define i32 @test_icmp_eq_i64(i64 %a, i64 %b) {
121 ; SDAG-X64-LABEL: test_icmp_eq_i64:
122 ; SDAG-X64: ## %bb.0:
123 ; SDAG-X64-NEXT: xorl %eax, %eax
124 ; SDAG-X64-NEXT: cmpq %rsi, %rdi
125 ; SDAG-X64-NEXT: sete %al
126 ; SDAG-X64-NEXT: retq
128 ; FAST-X64-LABEL: test_icmp_eq_i64:
129 ; FAST-X64: ## %bb.0:
130 ; FAST-X64-NEXT: cmpq %rsi, %rdi
131 ; FAST-X64-NEXT: sete %al
132 ; FAST-X64-NEXT: andb $1, %al
133 ; FAST-X64-NEXT: movzbl %al, %eax
134 ; FAST-X64-NEXT: retq
136 ; GISEL-X64-LABEL: test_icmp_eq_i64:
137 ; GISEL-X64: ## %bb.0:
138 ; GISEL-X64-NEXT: xorl %eax, %eax
139 ; GISEL-X64-NEXT: cmpq %rsi, %rdi
140 ; GISEL-X64-NEXT: sete %al
141 ; GISEL-X64-NEXT: andl $1, %eax
142 ; GISEL-X64-NEXT: retq
144 ; SDAG-X86-LABEL: test_icmp_eq_i64:
145 ; SDAG-X86: ## %bb.0:
146 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
147 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %edx
148 ; SDAG-X86-NEXT: xorl {{[0-9]+}}(%esp), %edx
149 ; SDAG-X86-NEXT: xorl {{[0-9]+}}(%esp), %ecx
150 ; SDAG-X86-NEXT: xorl %eax, %eax
151 ; SDAG-X86-NEXT: orl %edx, %ecx
152 ; SDAG-X86-NEXT: sete %al
153 ; SDAG-X86-NEXT: retl
155 ; FAST-X86-LABEL: test_icmp_eq_i64:
156 ; FAST-X86: ## %bb.0:
157 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
158 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
159 ; FAST-X86-NEXT: xorl {{[0-9]+}}(%esp), %ecx
160 ; FAST-X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
161 ; FAST-X86-NEXT: orl %ecx, %eax
162 ; FAST-X86-NEXT: sete %al
163 ; FAST-X86-NEXT: andb $1, %al
164 ; FAST-X86-NEXT: movzbl %al, %eax
165 ; FAST-X86-NEXT: retl
167 ; GISEL-X86-LABEL: test_icmp_eq_i64:
168 ; GISEL-X86: ## %bb.0:
169 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
170 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
171 ; GISEL-X86-NEXT: xorl {{[0-9]+}}(%esp), %eax
172 ; GISEL-X86-NEXT: xorl {{[0-9]+}}(%esp), %ecx
173 ; GISEL-X86-NEXT: orl %eax, %ecx
174 ; GISEL-X86-NEXT: xorl %eax, %eax
175 ; GISEL-X86-NEXT: cmpl $0, %ecx
176 ; GISEL-X86-NEXT: sete %al
177 ; GISEL-X86-NEXT: andl $1, %eax
178 ; GISEL-X86-NEXT: retl
179 %r = icmp eq i64 %a, %b
180 %res = zext i1 %r to i32
184 define i32 @test_icmp_eq_i32(i32 %a, i32 %b) {
185 ; SDAG-X64-LABEL: test_icmp_eq_i32:
186 ; SDAG-X64: ## %bb.0:
187 ; SDAG-X64-NEXT: xorl %eax, %eax
188 ; SDAG-X64-NEXT: cmpl %esi, %edi
189 ; SDAG-X64-NEXT: sete %al
190 ; SDAG-X64-NEXT: retq
192 ; FAST-X64-LABEL: test_icmp_eq_i32:
193 ; FAST-X64: ## %bb.0:
194 ; FAST-X64-NEXT: cmpl %esi, %edi
195 ; FAST-X64-NEXT: sete %al
196 ; FAST-X64-NEXT: andb $1, %al
197 ; FAST-X64-NEXT: movzbl %al, %eax
198 ; FAST-X64-NEXT: retq
200 ; GISEL-X64-LABEL: test_icmp_eq_i32:
201 ; GISEL-X64: ## %bb.0:
202 ; GISEL-X64-NEXT: xorl %eax, %eax
203 ; GISEL-X64-NEXT: cmpl %esi, %edi
204 ; GISEL-X64-NEXT: sete %al
205 ; GISEL-X64-NEXT: andl $1, %eax
206 ; GISEL-X64-NEXT: retq
208 ; SDAG-X86-LABEL: test_icmp_eq_i32:
209 ; SDAG-X86: ## %bb.0:
210 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
211 ; SDAG-X86-NEXT: xorl %eax, %eax
212 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
213 ; SDAG-X86-NEXT: sete %al
214 ; SDAG-X86-NEXT: retl
216 ; FAST-X86-LABEL: test_icmp_eq_i32:
217 ; FAST-X86: ## %bb.0:
218 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
219 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
220 ; FAST-X86-NEXT: sete %al
221 ; FAST-X86-NEXT: andb $1, %al
222 ; FAST-X86-NEXT: movzbl %al, %eax
223 ; FAST-X86-NEXT: retl
225 ; GISEL-X86-LABEL: test_icmp_eq_i32:
226 ; GISEL-X86: ## %bb.0:
227 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
228 ; GISEL-X86-NEXT: xorl %eax, %eax
229 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
230 ; GISEL-X86-NEXT: sete %al
231 ; GISEL-X86-NEXT: andl $1, %eax
232 ; GISEL-X86-NEXT: retl
233 %r = icmp eq i32 %a, %b
234 %res = zext i1 %r to i32
238 define i32 @test_icmp_ne_i32(i32 %a, i32 %b) {
239 ; SDAG-X64-LABEL: test_icmp_ne_i32:
240 ; SDAG-X64: ## %bb.0:
241 ; SDAG-X64-NEXT: xorl %eax, %eax
242 ; SDAG-X64-NEXT: cmpl %esi, %edi
243 ; SDAG-X64-NEXT: setne %al
244 ; SDAG-X64-NEXT: retq
246 ; FAST-X64-LABEL: test_icmp_ne_i32:
247 ; FAST-X64: ## %bb.0:
248 ; FAST-X64-NEXT: cmpl %esi, %edi
249 ; FAST-X64-NEXT: setne %al
250 ; FAST-X64-NEXT: andb $1, %al
251 ; FAST-X64-NEXT: movzbl %al, %eax
252 ; FAST-X64-NEXT: retq
254 ; GISEL-X64-LABEL: test_icmp_ne_i32:
255 ; GISEL-X64: ## %bb.0:
256 ; GISEL-X64-NEXT: xorl %eax, %eax
257 ; GISEL-X64-NEXT: cmpl %esi, %edi
258 ; GISEL-X64-NEXT: setne %al
259 ; GISEL-X64-NEXT: andl $1, %eax
260 ; GISEL-X64-NEXT: retq
262 ; SDAG-X86-LABEL: test_icmp_ne_i32:
263 ; SDAG-X86: ## %bb.0:
264 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
265 ; SDAG-X86-NEXT: xorl %eax, %eax
266 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
267 ; SDAG-X86-NEXT: setne %al
268 ; SDAG-X86-NEXT: retl
270 ; FAST-X86-LABEL: test_icmp_ne_i32:
271 ; FAST-X86: ## %bb.0:
272 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
273 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
274 ; FAST-X86-NEXT: setne %al
275 ; FAST-X86-NEXT: andb $1, %al
276 ; FAST-X86-NEXT: movzbl %al, %eax
277 ; FAST-X86-NEXT: retl
279 ; GISEL-X86-LABEL: test_icmp_ne_i32:
280 ; GISEL-X86: ## %bb.0:
281 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
282 ; GISEL-X86-NEXT: xorl %eax, %eax
283 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
284 ; GISEL-X86-NEXT: setne %al
285 ; GISEL-X86-NEXT: andl $1, %eax
286 ; GISEL-X86-NEXT: retl
287 %r = icmp ne i32 %a, %b
288 %res = zext i1 %r to i32
292 define i32 @test_icmp_ugt_i32(i32 %a, i32 %b) {
293 ; SDAG-X64-LABEL: test_icmp_ugt_i32:
294 ; SDAG-X64: ## %bb.0:
295 ; SDAG-X64-NEXT: xorl %eax, %eax
296 ; SDAG-X64-NEXT: cmpl %esi, %edi
297 ; SDAG-X64-NEXT: seta %al
298 ; SDAG-X64-NEXT: retq
300 ; FAST-X64-LABEL: test_icmp_ugt_i32:
301 ; FAST-X64: ## %bb.0:
302 ; FAST-X64-NEXT: cmpl %esi, %edi
303 ; FAST-X64-NEXT: seta %al
304 ; FAST-X64-NEXT: andb $1, %al
305 ; FAST-X64-NEXT: movzbl %al, %eax
306 ; FAST-X64-NEXT: retq
308 ; GISEL-X64-LABEL: test_icmp_ugt_i32:
309 ; GISEL-X64: ## %bb.0:
310 ; GISEL-X64-NEXT: xorl %eax, %eax
311 ; GISEL-X64-NEXT: cmpl %esi, %edi
312 ; GISEL-X64-NEXT: seta %al
313 ; GISEL-X64-NEXT: andl $1, %eax
314 ; GISEL-X64-NEXT: retq
316 ; SDAG-X86-LABEL: test_icmp_ugt_i32:
317 ; SDAG-X86: ## %bb.0:
318 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
319 ; SDAG-X86-NEXT: xorl %eax, %eax
320 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
321 ; SDAG-X86-NEXT: seta %al
322 ; SDAG-X86-NEXT: retl
324 ; FAST-X86-LABEL: test_icmp_ugt_i32:
325 ; FAST-X86: ## %bb.0:
326 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
327 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
328 ; FAST-X86-NEXT: seta %al
329 ; FAST-X86-NEXT: andb $1, %al
330 ; FAST-X86-NEXT: movzbl %al, %eax
331 ; FAST-X86-NEXT: retl
333 ; GISEL-X86-LABEL: test_icmp_ugt_i32:
334 ; GISEL-X86: ## %bb.0:
335 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
336 ; GISEL-X86-NEXT: xorl %eax, %eax
337 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
338 ; GISEL-X86-NEXT: seta %al
339 ; GISEL-X86-NEXT: andl $1, %eax
340 ; GISEL-X86-NEXT: retl
341 %r = icmp ugt i32 %a, %b
342 %res = zext i1 %r to i32
346 define i32 @test_icmp_uge_i32(i32 %a, i32 %b) {
347 ; SDAG-X64-LABEL: test_icmp_uge_i32:
348 ; SDAG-X64: ## %bb.0:
349 ; SDAG-X64-NEXT: xorl %eax, %eax
350 ; SDAG-X64-NEXT: cmpl %esi, %edi
351 ; SDAG-X64-NEXT: setae %al
352 ; SDAG-X64-NEXT: retq
354 ; FAST-X64-LABEL: test_icmp_uge_i32:
355 ; FAST-X64: ## %bb.0:
356 ; FAST-X64-NEXT: cmpl %esi, %edi
357 ; FAST-X64-NEXT: setae %al
358 ; FAST-X64-NEXT: andb $1, %al
359 ; FAST-X64-NEXT: movzbl %al, %eax
360 ; FAST-X64-NEXT: retq
362 ; GISEL-X64-LABEL: test_icmp_uge_i32:
363 ; GISEL-X64: ## %bb.0:
364 ; GISEL-X64-NEXT: xorl %eax, %eax
365 ; GISEL-X64-NEXT: cmpl %esi, %edi
366 ; GISEL-X64-NEXT: setae %al
367 ; GISEL-X64-NEXT: andl $1, %eax
368 ; GISEL-X64-NEXT: retq
370 ; SDAG-X86-LABEL: test_icmp_uge_i32:
371 ; SDAG-X86: ## %bb.0:
372 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
373 ; SDAG-X86-NEXT: xorl %eax, %eax
374 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
375 ; SDAG-X86-NEXT: setae %al
376 ; SDAG-X86-NEXT: retl
378 ; FAST-X86-LABEL: test_icmp_uge_i32:
379 ; FAST-X86: ## %bb.0:
380 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
381 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
382 ; FAST-X86-NEXT: setae %al
383 ; FAST-X86-NEXT: andb $1, %al
384 ; FAST-X86-NEXT: movzbl %al, %eax
385 ; FAST-X86-NEXT: retl
387 ; GISEL-X86-LABEL: test_icmp_uge_i32:
388 ; GISEL-X86: ## %bb.0:
389 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
390 ; GISEL-X86-NEXT: xorl %eax, %eax
391 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
392 ; GISEL-X86-NEXT: setae %al
393 ; GISEL-X86-NEXT: andl $1, %eax
394 ; GISEL-X86-NEXT: retl
395 %r = icmp uge i32 %a, %b
396 %res = zext i1 %r to i32
400 define i32 @test_icmp_ult_i32(i32 %a, i32 %b) {
401 ; SDAG-X64-LABEL: test_icmp_ult_i32:
402 ; SDAG-X64: ## %bb.0:
403 ; SDAG-X64-NEXT: xorl %eax, %eax
404 ; SDAG-X64-NEXT: cmpl %esi, %edi
405 ; SDAG-X64-NEXT: setb %al
406 ; SDAG-X64-NEXT: retq
408 ; FAST-X64-LABEL: test_icmp_ult_i32:
409 ; FAST-X64: ## %bb.0:
410 ; FAST-X64-NEXT: cmpl %esi, %edi
411 ; FAST-X64-NEXT: setb %al
412 ; FAST-X64-NEXT: andb $1, %al
413 ; FAST-X64-NEXT: movzbl %al, %eax
414 ; FAST-X64-NEXT: retq
416 ; GISEL-X64-LABEL: test_icmp_ult_i32:
417 ; GISEL-X64: ## %bb.0:
418 ; GISEL-X64-NEXT: xorl %eax, %eax
419 ; GISEL-X64-NEXT: cmpl %esi, %edi
420 ; GISEL-X64-NEXT: setb %al
421 ; GISEL-X64-NEXT: andl $1, %eax
422 ; GISEL-X64-NEXT: retq
424 ; SDAG-X86-LABEL: test_icmp_ult_i32:
425 ; SDAG-X86: ## %bb.0:
426 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
427 ; SDAG-X86-NEXT: xorl %eax, %eax
428 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
429 ; SDAG-X86-NEXT: setb %al
430 ; SDAG-X86-NEXT: retl
432 ; FAST-X86-LABEL: test_icmp_ult_i32:
433 ; FAST-X86: ## %bb.0:
434 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
435 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
436 ; FAST-X86-NEXT: setb %al
437 ; FAST-X86-NEXT: andb $1, %al
438 ; FAST-X86-NEXT: movzbl %al, %eax
439 ; FAST-X86-NEXT: retl
441 ; GISEL-X86-LABEL: test_icmp_ult_i32:
442 ; GISEL-X86: ## %bb.0:
443 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
444 ; GISEL-X86-NEXT: xorl %eax, %eax
445 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
446 ; GISEL-X86-NEXT: setb %al
447 ; GISEL-X86-NEXT: andl $1, %eax
448 ; GISEL-X86-NEXT: retl
449 %r = icmp ult i32 %a, %b
450 %res = zext i1 %r to i32
454 define i32 @test_icmp_ule_i32(i32 %a, i32 %b) {
455 ; SDAG-X64-LABEL: test_icmp_ule_i32:
456 ; SDAG-X64: ## %bb.0:
457 ; SDAG-X64-NEXT: xorl %eax, %eax
458 ; SDAG-X64-NEXT: cmpl %esi, %edi
459 ; SDAG-X64-NEXT: setbe %al
460 ; SDAG-X64-NEXT: retq
462 ; FAST-X64-LABEL: test_icmp_ule_i32:
463 ; FAST-X64: ## %bb.0:
464 ; FAST-X64-NEXT: cmpl %esi, %edi
465 ; FAST-X64-NEXT: setbe %al
466 ; FAST-X64-NEXT: andb $1, %al
467 ; FAST-X64-NEXT: movzbl %al, %eax
468 ; FAST-X64-NEXT: retq
470 ; GISEL-X64-LABEL: test_icmp_ule_i32:
471 ; GISEL-X64: ## %bb.0:
472 ; GISEL-X64-NEXT: xorl %eax, %eax
473 ; GISEL-X64-NEXT: cmpl %esi, %edi
474 ; GISEL-X64-NEXT: setbe %al
475 ; GISEL-X64-NEXT: andl $1, %eax
476 ; GISEL-X64-NEXT: retq
478 ; SDAG-X86-LABEL: test_icmp_ule_i32:
479 ; SDAG-X86: ## %bb.0:
480 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
481 ; SDAG-X86-NEXT: xorl %eax, %eax
482 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
483 ; SDAG-X86-NEXT: setbe %al
484 ; SDAG-X86-NEXT: retl
486 ; FAST-X86-LABEL: test_icmp_ule_i32:
487 ; FAST-X86: ## %bb.0:
488 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
489 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
490 ; FAST-X86-NEXT: setbe %al
491 ; FAST-X86-NEXT: andb $1, %al
492 ; FAST-X86-NEXT: movzbl %al, %eax
493 ; FAST-X86-NEXT: retl
495 ; GISEL-X86-LABEL: test_icmp_ule_i32:
496 ; GISEL-X86: ## %bb.0:
497 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
498 ; GISEL-X86-NEXT: xorl %eax, %eax
499 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
500 ; GISEL-X86-NEXT: setbe %al
501 ; GISEL-X86-NEXT: andl $1, %eax
502 ; GISEL-X86-NEXT: retl
503 %r = icmp ule i32 %a, %b
504 %res = zext i1 %r to i32
508 define i32 @test_icmp_sgt_i32(i32 %a, i32 %b) {
509 ; SDAG-X64-LABEL: test_icmp_sgt_i32:
510 ; SDAG-X64: ## %bb.0:
511 ; SDAG-X64-NEXT: xorl %eax, %eax
512 ; SDAG-X64-NEXT: cmpl %esi, %edi
513 ; SDAG-X64-NEXT: setg %al
514 ; SDAG-X64-NEXT: retq
516 ; FAST-X64-LABEL: test_icmp_sgt_i32:
517 ; FAST-X64: ## %bb.0:
518 ; FAST-X64-NEXT: cmpl %esi, %edi
519 ; FAST-X64-NEXT: setg %al
520 ; FAST-X64-NEXT: andb $1, %al
521 ; FAST-X64-NEXT: movzbl %al, %eax
522 ; FAST-X64-NEXT: retq
524 ; GISEL-X64-LABEL: test_icmp_sgt_i32:
525 ; GISEL-X64: ## %bb.0:
526 ; GISEL-X64-NEXT: xorl %eax, %eax
527 ; GISEL-X64-NEXT: cmpl %esi, %edi
528 ; GISEL-X64-NEXT: setg %al
529 ; GISEL-X64-NEXT: andl $1, %eax
530 ; GISEL-X64-NEXT: retq
532 ; SDAG-X86-LABEL: test_icmp_sgt_i32:
533 ; SDAG-X86: ## %bb.0:
534 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
535 ; SDAG-X86-NEXT: xorl %eax, %eax
536 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
537 ; SDAG-X86-NEXT: setg %al
538 ; SDAG-X86-NEXT: retl
540 ; FAST-X86-LABEL: test_icmp_sgt_i32:
541 ; FAST-X86: ## %bb.0:
542 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
543 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
544 ; FAST-X86-NEXT: setg %al
545 ; FAST-X86-NEXT: andb $1, %al
546 ; FAST-X86-NEXT: movzbl %al, %eax
547 ; FAST-X86-NEXT: retl
549 ; GISEL-X86-LABEL: test_icmp_sgt_i32:
550 ; GISEL-X86: ## %bb.0:
551 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
552 ; GISEL-X86-NEXT: xorl %eax, %eax
553 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
554 ; GISEL-X86-NEXT: setg %al
555 ; GISEL-X86-NEXT: andl $1, %eax
556 ; GISEL-X86-NEXT: retl
557 %r = icmp sgt i32 %a, %b
558 %res = zext i1 %r to i32
562 define i32 @test_icmp_sge_i32(i32 %a, i32 %b) {
563 ; SDAG-X64-LABEL: test_icmp_sge_i32:
564 ; SDAG-X64: ## %bb.0:
565 ; SDAG-X64-NEXT: xorl %eax, %eax
566 ; SDAG-X64-NEXT: cmpl %esi, %edi
567 ; SDAG-X64-NEXT: setge %al
568 ; SDAG-X64-NEXT: retq
570 ; FAST-X64-LABEL: test_icmp_sge_i32:
571 ; FAST-X64: ## %bb.0:
572 ; FAST-X64-NEXT: cmpl %esi, %edi
573 ; FAST-X64-NEXT: setge %al
574 ; FAST-X64-NEXT: andb $1, %al
575 ; FAST-X64-NEXT: movzbl %al, %eax
576 ; FAST-X64-NEXT: retq
578 ; GISEL-X64-LABEL: test_icmp_sge_i32:
579 ; GISEL-X64: ## %bb.0:
580 ; GISEL-X64-NEXT: xorl %eax, %eax
581 ; GISEL-X64-NEXT: cmpl %esi, %edi
582 ; GISEL-X64-NEXT: setge %al
583 ; GISEL-X64-NEXT: andl $1, %eax
584 ; GISEL-X64-NEXT: retq
586 ; SDAG-X86-LABEL: test_icmp_sge_i32:
587 ; SDAG-X86: ## %bb.0:
588 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
589 ; SDAG-X86-NEXT: xorl %eax, %eax
590 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
591 ; SDAG-X86-NEXT: setge %al
592 ; SDAG-X86-NEXT: retl
594 ; FAST-X86-LABEL: test_icmp_sge_i32:
595 ; FAST-X86: ## %bb.0:
596 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
597 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
598 ; FAST-X86-NEXT: setge %al
599 ; FAST-X86-NEXT: andb $1, %al
600 ; FAST-X86-NEXT: movzbl %al, %eax
601 ; FAST-X86-NEXT: retl
603 ; GISEL-X86-LABEL: test_icmp_sge_i32:
604 ; GISEL-X86: ## %bb.0:
605 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
606 ; GISEL-X86-NEXT: xorl %eax, %eax
607 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
608 ; GISEL-X86-NEXT: setge %al
609 ; GISEL-X86-NEXT: andl $1, %eax
610 ; GISEL-X86-NEXT: retl
611 %r = icmp sge i32 %a, %b
612 %res = zext i1 %r to i32
616 define i32 @test_icmp_slt_i32(i32 %a, i32 %b) {
617 ; SDAG-X64-LABEL: test_icmp_slt_i32:
618 ; SDAG-X64: ## %bb.0:
619 ; SDAG-X64-NEXT: xorl %eax, %eax
620 ; SDAG-X64-NEXT: cmpl %esi, %edi
621 ; SDAG-X64-NEXT: setl %al
622 ; SDAG-X64-NEXT: retq
624 ; FAST-X64-LABEL: test_icmp_slt_i32:
625 ; FAST-X64: ## %bb.0:
626 ; FAST-X64-NEXT: cmpl %esi, %edi
627 ; FAST-X64-NEXT: setl %al
628 ; FAST-X64-NEXT: andb $1, %al
629 ; FAST-X64-NEXT: movzbl %al, %eax
630 ; FAST-X64-NEXT: retq
632 ; GISEL-X64-LABEL: test_icmp_slt_i32:
633 ; GISEL-X64: ## %bb.0:
634 ; GISEL-X64-NEXT: xorl %eax, %eax
635 ; GISEL-X64-NEXT: cmpl %esi, %edi
636 ; GISEL-X64-NEXT: setl %al
637 ; GISEL-X64-NEXT: andl $1, %eax
638 ; GISEL-X64-NEXT: retq
640 ; SDAG-X86-LABEL: test_icmp_slt_i32:
641 ; SDAG-X86: ## %bb.0:
642 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
643 ; SDAG-X86-NEXT: xorl %eax, %eax
644 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
645 ; SDAG-X86-NEXT: setl %al
646 ; SDAG-X86-NEXT: retl
648 ; FAST-X86-LABEL: test_icmp_slt_i32:
649 ; FAST-X86: ## %bb.0:
650 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
651 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
652 ; FAST-X86-NEXT: setl %al
653 ; FAST-X86-NEXT: andb $1, %al
654 ; FAST-X86-NEXT: movzbl %al, %eax
655 ; FAST-X86-NEXT: retl
657 ; GISEL-X86-LABEL: test_icmp_slt_i32:
658 ; GISEL-X86: ## %bb.0:
659 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
660 ; GISEL-X86-NEXT: xorl %eax, %eax
661 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
662 ; GISEL-X86-NEXT: setl %al
663 ; GISEL-X86-NEXT: andl $1, %eax
664 ; GISEL-X86-NEXT: retl
665 %r = icmp slt i32 %a, %b
666 %res = zext i1 %r to i32
670 define i32 @test_icmp_sle_i32(i32 %a, i32 %b) {
671 ; SDAG-X64-LABEL: test_icmp_sle_i32:
672 ; SDAG-X64: ## %bb.0:
673 ; SDAG-X64-NEXT: xorl %eax, %eax
674 ; SDAG-X64-NEXT: cmpl %esi, %edi
675 ; SDAG-X64-NEXT: setle %al
676 ; SDAG-X64-NEXT: retq
678 ; FAST-X64-LABEL: test_icmp_sle_i32:
679 ; FAST-X64: ## %bb.0:
680 ; FAST-X64-NEXT: cmpl %esi, %edi
681 ; FAST-X64-NEXT: setle %al
682 ; FAST-X64-NEXT: andb $1, %al
683 ; FAST-X64-NEXT: movzbl %al, %eax
684 ; FAST-X64-NEXT: retq
686 ; GISEL-X64-LABEL: test_icmp_sle_i32:
687 ; GISEL-X64: ## %bb.0:
688 ; GISEL-X64-NEXT: xorl %eax, %eax
689 ; GISEL-X64-NEXT: cmpl %esi, %edi
690 ; GISEL-X64-NEXT: setle %al
691 ; GISEL-X64-NEXT: andl $1, %eax
692 ; GISEL-X64-NEXT: retq
694 ; SDAG-X86-LABEL: test_icmp_sle_i32:
695 ; SDAG-X86: ## %bb.0:
696 ; SDAG-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
697 ; SDAG-X86-NEXT: xorl %eax, %eax
698 ; SDAG-X86-NEXT: cmpl {{[0-9]+}}(%esp), %ecx
699 ; SDAG-X86-NEXT: setle %al
700 ; SDAG-X86-NEXT: retl
702 ; FAST-X86-LABEL: test_icmp_sle_i32:
703 ; FAST-X86: ## %bb.0:
704 ; FAST-X86-NEXT: movl {{[0-9]+}}(%esp), %eax
705 ; FAST-X86-NEXT: cmpl %eax, {{[0-9]+}}(%esp)
706 ; FAST-X86-NEXT: setle %al
707 ; FAST-X86-NEXT: andb $1, %al
708 ; FAST-X86-NEXT: movzbl %al, %eax
709 ; FAST-X86-NEXT: retl
711 ; GISEL-X86-LABEL: test_icmp_sle_i32:
712 ; GISEL-X86: ## %bb.0:
713 ; GISEL-X86-NEXT: movl {{[0-9]+}}(%esp), %ecx
714 ; GISEL-X86-NEXT: xorl %eax, %eax
715 ; GISEL-X86-NEXT: cmpl %ecx, {{[0-9]+}}(%esp)
716 ; GISEL-X86-NEXT: setle %al
717 ; GISEL-X86-NEXT: andl $1, %eax
718 ; GISEL-X86-NEXT: retl
719 %r = icmp sle i32 %a, %b
720 %res = zext i1 %r to i32