Revert r354244 "[DAGCombiner] Eliminate dead stores to stack."
[llvm-complete.git] / test / CodeGen / Mips / GlobalISel / llvm-ir / icmp.ll
blob3ba1b1102b006e8f597d82b78fa22d96c8e9890e
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){
5 ; MIPS32-LABEL: eq:
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
12 ; MIPS32-NEXT:    jr $ra
13 ; MIPS32-NEXT:    nop
14 entry:
15   %cmp = icmp eq i32 %a, %b
16   %conv = zext i1 %cmp to i32
17   ret i32 %conv
20 define i32 @ne(i32 %a, i32 %b) {
21 ; MIPS32-LABEL: ne:
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
28 ; MIPS32-NEXT:    jr $ra
29 ; MIPS32-NEXT:    nop
30 entry:
31   %cmp = icmp ne i32 %a, %b
32   %conv = zext i1 %cmp to i32
33   ret i32 %conv
36 define i32 @sgt(i32 %a, i32 %b) {
37 ; MIPS32-LABEL: sgt:
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
43 ; MIPS32-NEXT:    jr $ra
44 ; MIPS32-NEXT:    nop
45 entry:
46   %cmp = icmp sgt i32 %a, %b
47   %conv = zext i1 %cmp to i32
48   ret i32 %conv
51 define i32 @sge(i32 %a, i32 %b) {
52 ; MIPS32-LABEL: sge:
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
59 ; MIPS32-NEXT:    jr $ra
60 ; MIPS32-NEXT:    nop
61 entry:
62   %cmp = icmp sge i32 %a, %b
63   %conv = zext i1 %cmp to i32
64   ret i32 %conv
67 define i32 @slt(i32 %a, i32 %b) {
68 ; MIPS32-LABEL: slt:
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
74 ; MIPS32-NEXT:    jr $ra
75 ; MIPS32-NEXT:    nop
76 entry:
77   %cmp = icmp slt i32 %a, %b
78   %conv = zext i1 %cmp to i32
79   ret i32 %conv
82 define i32 @sle(i32 %a, i32 %b) {
83 ; MIPS32-LABEL: sle:
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
90 ; MIPS32-NEXT:    jr $ra
91 ; MIPS32-NEXT:    nop
92 entry:
93   %cmp = icmp sle i32 %a, %b
94   %conv = zext i1 %cmp to i32
95   ret i32 %conv
98 define i32 @ugt(i32 %a, i32 %b) {
99 ; MIPS32-LABEL: ugt:
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
106 ; MIPS32-NEXT:    nop
107 entry:
108   %cmp = icmp ugt i32 %a, %b
109   %conv = zext i1 %cmp to i32
110   ret i32 %conv
113 define i32 @uge(i32 %a, i32 %b) {
114 ; MIPS32-LABEL: uge:
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
122 ; MIPS32-NEXT:    nop
123 entry:
124   %cmp = icmp uge i32 %a, %b
125   %conv = zext i1 %cmp to i32
126   ret i32 %conv
129 define i32 @ult(i32 %a, i32 %b) {
130 ; MIPS32-LABEL: ult:
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
137 ; MIPS32-NEXT:    nop
138 entry:
139   %cmp = icmp ult i32 %a, %b
140   %conv = zext i1 %cmp to i32
141   ret i32 %conv
144 define i32 @ule(i32 %a, i32 %b) {
145 ; MIPS32-LABEL: ule:
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
153 ; MIPS32-NEXT:    nop
154 entry:
155   %cmp = icmp ule i32 %a, %b
156   %conv = zext i1 %cmp to i32
157   ret i32 %conv