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

Side by Side Diff: tests_lit/llvm2ice_tests/8bit.pnacl.ll

Issue 622113002: Handle GPR and vector shift ops. Handle pmull also. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: grammar Created 6 years, 2 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
OLDNEW
1 ; This tries to be a comprehensive test of i8 operations. 1 ; This tries to be a comprehensive test of i8 operations.
2 2
3 ; RUN: %p2i -i %s --args -O2 --verbose none \ 3 ; RUN: %p2i -i %s --args -O2 --verbose none \
4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s 5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
6 ; RUN: %p2i -i %s --args -Om1 --verbose none \ 6 ; RUN: %p2i -i %s --args -Om1 --verbose none \
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s 8 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
9 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s 9 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s
10 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s 10 ; RUN: %p2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 define internal i32 @srem8BitConst(i32 %a, i32 %b) { 152 define internal i32 @srem8BitConst(i32 %a, i32 %b) {
153 entry: 153 entry:
154 %a_8 = trunc i32 %a to i8 154 %a_8 = trunc i32 %a to i8
155 %srem = srem i8 %a_8, 123 155 %srem = srem i8 %a_8, 123
156 %ret = zext i8 %srem to i32 156 %ret = zext i8 %srem to i32
157 ret i32 %ret 157 ret i32 %ret
158 } 158 }
159 ; CHECK-LABEL: srem8BitConst 159 ; CHECK-LABEL: srem8BitConst
160 ; CHECK: idiv {{[abcd]l|byte ptr}} 160 ; CHECK: idiv {{[abcd]l|byte ptr}}
161 161
162 define internal i32 @shl8Bit(i32 %a, i32 %b) {
163 entry:
164 %a_8 = trunc i32 %a to i8
165 %b_8 = trunc i32 %b to i8
166 %shl = shl i8 %b_8, %a_8
167 %ret = zext i8 %shl to i32
168 ret i32 %ret
169 }
170 ; CHECK-LABEL: shl8Bit
171 ; CHECK: shl {{[abcd]l|byte ptr}}, cl
Jim Stichnoth 2014/10/02 20:35:17 Maybe [abd]l ? Shouldn't be shifting cl by cl.
jvoung (off chromium) 2014/10/02 22:04:13 Ah right -- Done
172
173 define internal i32 @shl8BitConst(i32 %a, i32 %b) {
174 entry:
175 %a_8 = trunc i32 %a to i8
176 %shl = shl i8 %a_8, 6
177 %ret = zext i8 %shl to i32
178 ret i32 %ret
179 }
180 ; CHECK-LABEL: shl8BitConst
181 ; CHECK: shl {{[abcd]l|byte ptr}}, 6
182
183 define internal i32 @lshr8Bit(i32 %a, i32 %b) {
184 entry:
185 %a_8 = trunc i32 %a to i8
186 %b_8 = trunc i32 %b to i8
187 %lshr = lshr i8 %b_8, %a_8
188 %ret = zext i8 %lshr to i32
189 ret i32 %ret
190 }
191 ; CHECK-LABEL: lshr8Bit
192 ; CHECK: shr {{[abcd]l|byte ptr}}, cl
193
194 define internal i32 @lshr8BitConst(i32 %a, i32 %b) {
195 entry:
196 %a_8 = trunc i32 %a to i8
197 %lshr = lshr i8 %a_8, 6
198 %ret = zext i8 %lshr to i32
199 ret i32 %ret
200 }
201 ; CHECK-LABEL: lshr8BitConst
202 ; CHECK: shr {{[abcd]l|byte ptr}}, 6
203
204 define internal i32 @ashr8Bit(i32 %a, i32 %b) {
205 entry:
206 %a_8 = trunc i32 %a to i8
207 %b_8 = trunc i32 %b to i8
208 %ashr = ashr i8 %b_8, %a_8
209 %ret = zext i8 %ashr to i32
210 ret i32 %ret
211 }
212 ; CHECK-LABEL: ashr8Bit
213 ; CHECK: sar {{[abcd]l|byte ptr}}, cl
214
215 define internal i32 @ashr8BitConst(i32 %a, i32 %b) {
216 entry:
217 %a_8 = trunc i32 %a to i8
218 %ashr = ashr i8 %a_8, 6
219 %ret = zext i8 %ashr to i32
220 ret i32 %ret
221 }
222 ; CHECK-LABEL: ashr8BitConst
223 ; CHECK: sar {{[abcd]l|byte ptr}}, 6
224
162 225
163 ; ERRORS-NOT: ICE translation error 226 ; ERRORS-NOT: ICE translation error
164 ; DUMP-NOT: SZ 227 ; DUMP-NOT: SZ
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698