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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: tests_lit/llvm2ice_tests/8bit.pnacl.ll
diff --git a/tests_lit/llvm2ice_tests/8bit.pnacl.ll b/tests_lit/llvm2ice_tests/8bit.pnacl.ll
index 2307712468072466976e73f51d0a760f03e3f6d7..3b24d6af0d8f5d5c3841c7e098b7bf620ac1eabf 100644
--- a/tests_lit/llvm2ice_tests/8bit.pnacl.ll
+++ b/tests_lit/llvm2ice_tests/8bit.pnacl.ll
@@ -159,6 +159,69 @@ entry:
; CHECK-LABEL: srem8BitConst
; CHECK: idiv {{[abcd]l|byte ptr}}
+define internal i32 @shl8Bit(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %b_8 = trunc i32 %b to i8
+ %shl = shl i8 %b_8, %a_8
+ %ret = zext i8 %shl to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: shl8Bit
+; 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
+
+define internal i32 @shl8BitConst(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %shl = shl i8 %a_8, 6
+ %ret = zext i8 %shl to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: shl8BitConst
+; CHECK: shl {{[abcd]l|byte ptr}}, 6
+
+define internal i32 @lshr8Bit(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %b_8 = trunc i32 %b to i8
+ %lshr = lshr i8 %b_8, %a_8
+ %ret = zext i8 %lshr to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: lshr8Bit
+; CHECK: shr {{[abcd]l|byte ptr}}, cl
+
+define internal i32 @lshr8BitConst(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %lshr = lshr i8 %a_8, 6
+ %ret = zext i8 %lshr to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: lshr8BitConst
+; CHECK: shr {{[abcd]l|byte ptr}}, 6
+
+define internal i32 @ashr8Bit(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %b_8 = trunc i32 %b to i8
+ %ashr = ashr i8 %b_8, %a_8
+ %ret = zext i8 %ashr to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: ashr8Bit
+; CHECK: sar {{[abcd]l|byte ptr}}, cl
+
+define internal i32 @ashr8BitConst(i32 %a, i32 %b) {
+entry:
+ %a_8 = trunc i32 %a to i8
+ %ashr = ashr i8 %a_8, 6
+ %ret = zext i8 %ashr to i32
+ ret i32 %ret
+}
+; CHECK-LABEL: ashr8BitConst
+; CHECK: sar {{[abcd]l|byte ptr}}, 6
+
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ

Powered by Google App Engine
This is Rietveld 408576698