1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o - | FileCheck %s --check-prefix=ALL
4 define i32 @test_icmp_eq_i8(i8 %a, i8 %b) {
5 ; ALL-LABEL: test_icmp_eq_i8:
7 ; ALL-NEXT: cmpb %sil, %dil
9 ; ALL-NEXT: andl $1, %eax
11 %r = icmp eq i8 %a, %b
12 %res = zext i1 %r to i32
16 define i32 @test_icmp_eq_i16(i16 %a, i16 %b) {
17 ; ALL-LABEL: test_icmp_eq_i16:
19 ; ALL-NEXT: cmpw %si, %di
21 ; ALL-NEXT: andl $1, %eax
23 %r = icmp eq i16 %a, %b
24 %res = zext i1 %r to i32
28 define i32 @test_icmp_eq_i64(i64 %a, i64 %b) {
29 ; ALL-LABEL: test_icmp_eq_i64:
31 ; ALL-NEXT: cmpq %rsi, %rdi
33 ; ALL-NEXT: andl $1, %eax
35 %r = icmp eq i64 %a, %b
36 %res = zext i1 %r to i32
40 define i32 @test_icmp_eq_i32(i32 %a, i32 %b) {
41 ; ALL-LABEL: test_icmp_eq_i32:
43 ; ALL-NEXT: cmpl %esi, %edi
45 ; ALL-NEXT: andl $1, %eax
47 %r = icmp eq i32 %a, %b
48 %res = zext i1 %r to i32
52 define i32 @test_icmp_ne_i32(i32 %a, i32 %b) {
53 ; ALL-LABEL: test_icmp_ne_i32:
55 ; ALL-NEXT: cmpl %esi, %edi
57 ; ALL-NEXT: andl $1, %eax
59 %r = icmp ne i32 %a, %b
60 %res = zext i1 %r to i32
64 define i32 @test_icmp_ugt_i32(i32 %a, i32 %b) {
65 ; ALL-LABEL: test_icmp_ugt_i32:
67 ; ALL-NEXT: cmpl %esi, %edi
69 ; ALL-NEXT: andl $1, %eax
71 %r = icmp ugt i32 %a, %b
72 %res = zext i1 %r to i32
76 define i32 @test_icmp_uge_i32(i32 %a, i32 %b) {
77 ; ALL-LABEL: test_icmp_uge_i32:
79 ; ALL-NEXT: cmpl %esi, %edi
81 ; ALL-NEXT: andl $1, %eax
83 %r = icmp uge i32 %a, %b
84 %res = zext i1 %r to i32
88 define i32 @test_icmp_ult_i32(i32 %a, i32 %b) {
89 ; ALL-LABEL: test_icmp_ult_i32:
91 ; ALL-NEXT: cmpl %esi, %edi
93 ; ALL-NEXT: andl $1, %eax
95 %r = icmp ult i32 %a, %b
96 %res = zext i1 %r to i32
100 define i32 @test_icmp_ule_i32(i32 %a, i32 %b) {
101 ; ALL-LABEL: test_icmp_ule_i32:
103 ; ALL-NEXT: cmpl %esi, %edi
104 ; ALL-NEXT: setbe %al
105 ; ALL-NEXT: andl $1, %eax
107 %r = icmp ule i32 %a, %b
108 %res = zext i1 %r to i32
112 define i32 @test_icmp_sgt_i32(i32 %a, i32 %b) {
113 ; ALL-LABEL: test_icmp_sgt_i32:
115 ; ALL-NEXT: cmpl %esi, %edi
117 ; ALL-NEXT: andl $1, %eax
119 %r = icmp sgt i32 %a, %b
120 %res = zext i1 %r to i32
124 define i32 @test_icmp_sge_i32(i32 %a, i32 %b) {
125 ; ALL-LABEL: test_icmp_sge_i32:
127 ; ALL-NEXT: cmpl %esi, %edi
128 ; ALL-NEXT: setge %al
129 ; ALL-NEXT: andl $1, %eax
131 %r = icmp sge i32 %a, %b
132 %res = zext i1 %r to i32
136 define i32 @test_icmp_slt_i32(i32 %a, i32 %b) {
137 ; ALL-LABEL: test_icmp_slt_i32:
139 ; ALL-NEXT: cmpl %esi, %edi
141 ; ALL-NEXT: andl $1, %eax
143 %r = icmp slt i32 %a, %b
144 %res = zext i1 %r to i32
148 define i32 @test_icmp_sle_i32(i32 %a, i32 %b) {
149 ; ALL-LABEL: test_icmp_sle_i32:
151 ; ALL-NEXT: cmpl %esi, %edi
152 ; ALL-NEXT: setle %al
153 ; ALL-NEXT: andl $1, %eax
155 %r = icmp sle i32 %a, %b
156 %res = zext i1 %r to i32