Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: tests_lit/llvm2ice_tests/icmp.ll

Issue 2022063003: [Subzero][MIPS32] Implement icmp operation for i8, i16 operands (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addressed review comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; Simple tests for icmp with i8, i16, i32 operands.
2
3 ; RUN: %if --need=allow_dump --need=target_MIPS32 --command %p2i \
4 ; RUN: --filetype=asm --target mips32 -i %s --args -O2 --skip-unimplemented \
5 ; RUN: -allow-externally-defined-symbols \
6 ; RUN: | %if --need=allow_dump --need=target_MIPS32 --command FileCheck %s \
7 ; RUN: --check-prefix=COMMON --check-prefix=MIPS32
8 ; RUN: %if --need=allow_dump --need=target_MIPS32 --command %p2i \
9 ; RUN: --filetype=asm --target mips32 -i %s --args -Om1 --skip-unimplemented \
10 ; RUN: -allow-externally-defined-symbols \
11 ; RUN: | %if --need=allow_dump --need=target_MIPS32 --command FileCheck %s \
12 ; RUN: --check-prefix=COMMON --check-prefix=MIPS32
13
14 define internal i32 @icmpEq32(i32 %a, i32 %b) {
15 entry:
16 %cmp = icmp eq i32 %a, %b
17 %cmp.ret_ext = zext i1 %cmp to i32
18 ret i32 %cmp.ret_ext
19 }
20 ; MIPS32-LABEL: icmpEq32
21 ; MIPS32: xor
22 ; MIPS32: sltiu {{.*}}, {{.*}}, 1
23
24 define internal i32 @icmpNe32(i32 %a, i32 %b) {
25 entry:
26 %cmp = icmp ne i32 %a, %b
27 %cmp.ret_ext = zext i1 %cmp to i32
28 ret i32 %cmp.ret_ext
29 }
30 ; MIPS32-LABEL: icmpNe32
31 ; MIPS32: xor
32 ; MIPS32: sltu {{.*}}, $zero, {{.*}}
33
34 define internal i32 @icmpSgt32(i32 %a, i32 %b) {
35 entry:
36 %cmp = icmp sgt i32 %a, %b
37 %cmp.ret_ext = zext i1 %cmp to i32
38 ret i32 %cmp.ret_ext
39 }
40 ; MIPS32-LABEL: icmpSgt32
41 ; MIPS32: slt
42
43 define internal i32 @icmpUgt32(i32 %a, i32 %b) {
44 entry:
45 %cmp = icmp ugt i32 %a, %b
46 %cmp.ret_ext = zext i1 %cmp to i32
47 ret i32 %cmp.ret_ext
48 }
49 ; MIPS32-LABEL: icmpUgt32
50 ; MIPS32: sltu
51
52 define internal i32 @icmpSge32(i32 %a, i32 %b) {
53 entry:
54 %cmp = icmp sge i32 %a, %b
55 %cmp.ret_ext = zext i1 %cmp to i32
56 ret i32 %cmp.ret_ext
57 }
58 ; MIPS32-LABEL: icmpSge32
59 ; MIPS32: slt
60 ; MIPS32: xori {{.*}}, {{.*}}, 1
61
62 define internal i32 @icmpUge32(i32 %a, i32 %b) {
63 entry:
64 %cmp = icmp uge i32 %a, %b
65 %cmp.ret_ext = zext i1 %cmp to i32
66 ret i32 %cmp.ret_ext
67 }
68 ; MIPS32-LABEL: icmpUge32
69 ; MIPS32: sltu
70 ; MIPS32: xori {{.*}}, {{.*}}, 1
71
72 define internal i32 @icmpSlt32(i32 %a, i32 %b) {
73 entry:
74 %cmp = icmp slt i32 %a, %b
75 %cmp.ret_ext = zext i1 %cmp to i32
76 ret i32 %cmp.ret_ext
77 }
78 ; MIPS32-LABEL: icmpSlt32
79 ; MIPS32: slt
80
81 define internal i32 @icmpUlt32(i32 %a, i32 %b) {
82 entry:
83 %cmp = icmp ult i32 %a, %b
84 %cmp.ret_ext = zext i1 %cmp to i32
85 ret i32 %cmp.ret_ext
86 }
87 ; MIPS32-LABEL: icmpUlt32
88 ; MIPS32: sltu
89
90 define internal i32 @icmpSle32(i32 %a, i32 %b) {
91 entry:
92 %cmp = icmp sle i32 %a, %b
93 %cmp.ret_ext = zext i1 %cmp to i32
94 ret i32 %cmp.ret_ext
95 }
96 ; MIPS32-LABEL: icmpSle32
97 ; MIPS32: slt
98 ; MIPS32: xori {{.*}}, {{.*}}, 1
99
100 define internal i32 @icmpUle32(i32 %a, i32 %b) {
101 entry:
102 %cmp = icmp ule i32 %a, %b
103 %cmp.ret_ext = zext i1 %cmp to i32
104 ret i32 %cmp.ret_ext
105 }
106 ; MIPS32-LABEL: icmpUle32
107 ; MIPS32: sltu
108 ; MIPS32: xori {{.*}}, {{.*}}, 1
109
110 define internal i32 @icmpEq8(i32 %a, i32 %b) {
111 entry:
112 %a_8 = trunc i32 %a to i8
113 %b_8 = trunc i32 %b to i8
114 %icmp = icmp eq i8 %b_8, %a_8
115 %ret = zext i1 %icmp to i32
116 ret i32 %ret
117 }
118 ; MIPS32-LABEL: icmpEq8
119 ; MIPS32: sll {{.*}}, {{.*}}, 24
120 ; MIPS32: sll {{.*}}, {{.*}}, 24
121 ; MIPS32: xor
122 ; MIPS32: sltiu {{.*}}, {{.*}}, 1
123
124 define internal i32 @icmpSgt8(i32 %a, i32 %b) {
125 entry:
126 %a_8 = trunc i32 %a to i8
127 %b_8 = trunc i32 %b to i8
128 %icmp = icmp sgt i8 %b_8, %a_8
129 %ret = zext i1 %icmp to i32
130 ret i32 %ret
131 }
132 ; MIPS32-LABEL: icmpSgt8
133 ; MIPS32: sll {{.*}}, {{.*}}, 24
134 ; MIPS32: sll {{.*}}, {{.*}}, 24
135 ; MIPS32: slt
136
137 define internal i32 @icmpUgt8(i32 %a, i32 %b) {
138 entry:
139 %a_8 = trunc i32 %a to i8
140 %b_8 = trunc i32 %b to i8
141 %icmp = icmp ugt i8 %b_8, %a_8
142 %ret = zext i1 %icmp to i32
143 ret i32 %ret
144 }
145 ; MIPS32-LABEL: icmpUgt8
146 ; MIPS32: sll {{.*}}, {{.*}}, 24
147 ; MIPS32: sll {{.*}}, {{.*}}, 24
148 ; MIPS32: sltu
149
150 define internal i32 @icmpSgt16(i32 %a, i32 %b) {
151 entry:
152 %a_16 = trunc i32 %a to i16
153 %b_16 = trunc i32 %b to i16
154 %icmp = icmp sgt i16 %b_16, %a_16
155 %ret = zext i1 %icmp to i32
156 ret i32 %ret
157 }
158 ; MIPS32-LABEL: icmpSgt16
159 ; MIPS32: sll {{.*}}, {{.*}}, 16
160 ; MIPS32: sll {{.*}}, {{.*}}, 16
161 ; MIPS32: slt
162
163 define internal i32 @icmpUgt16(i32 %a, i32 %b) {
164 entry:
165 %a_16 = trunc i32 %a to i16
166 %b_16 = trunc i32 %b to i16
167 %icmp = icmp ugt i16 %b_16, %a_16
168 %ret = zext i1 %icmp to i32
169 ret i32 %ret
170 }
171 ; MIPS32-LABEL: icmpUgt16
172 ; MIPS32: sll {{.*}}, {{.*}}, 16
173 ; MIPS32: sll {{.*}}, {{.*}}, 16
174 ; MIPS32: sltu
OLDNEW
« no previous file with comments | « src/IceTargetLoweringMIPS32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698