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

Unified Diff: crosstest/test_arith_bool.ll

Issue 547033002: Subzero: Be more strict about i1 calculations. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Revert unnecessary changes Created 6 years, 3 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: crosstest/test_arith_bool.ll
diff --git a/crosstest/test_arith_bool.ll b/crosstest/test_arith_bool.ll
new file mode 100644
index 0000000000000000000000000000000000000000..b3fbbfe2daa3e179332fc54e89926749d3b257f2
--- /dev/null
+++ b/crosstest/test_arith_bool.ll
@@ -0,0 +1,103 @@
+; ModuleID = '/tmp/tmpNm2zJj/test_arith.ll'
+target datalayout = "e-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-p:32:32:32-v128:32:32"
+target triple = "i686-pc-linux-gnu"
+
+; This file was generated starting from Output/test_arith.pnacl.ll.
+; The testBool.*hh( functions were extracted, the hh changed to jj,
+; and the i8's changed to i1.
+
+define i32 @_Z11testBoolAddjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %add = add i1 %b.arg_trunc, %a.arg_trunc
+ %add.ret_ext = zext i1 %add to i32
+ ret i32 %add.ret_ext
+}
+
+define i32 @_Z11testBoolSubjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %sub = sub i1 %a.arg_trunc, %b.arg_trunc
+ %sub.ret_ext = zext i1 %sub to i32
+ ret i32 %sub.ret_ext
+}
+
+define i32 @_Z11testBoolMuljj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %mul = mul i1 %b.arg_trunc, %a.arg_trunc
+ %mul.ret_ext = zext i1 %mul to i32
+ ret i32 %mul.ret_ext
+}
+
+define i32 @_Z12testBoolUdivjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %div3 = udiv i1 %a.arg_trunc, %b.arg_trunc
+ %div3.ret_ext = zext i1 %div3 to i32
+ ret i32 %div3.ret_ext
+}
+
+define i32 @_Z12testBoolUremjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %0 = urem i1 %a.arg_trunc, %b.arg_trunc
+ %.ret_ext = zext i1 %0 to i32
+ ret i32 %.ret_ext
+}
+
+define i32 @_Z11testBoolShljj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %conv = zext i1 %a.arg_trunc to i32
+ %conv1 = zext i1 %b.arg_trunc to i32
+ %shl = shl i32 %conv, %conv1
+ %conv2 = trunc i32 %shl to i1
+ %conv2.ret_ext = zext i1 %conv2 to i32
+ ret i32 %conv2.ret_ext
+}
+
+define i32 @_Z12testBoolLshrjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %conv = zext i1 %a.arg_trunc to i32
+ %conv1 = zext i1 %b.arg_trunc to i32
+ %shr = lshr i32 %conv, %conv1
+ %conv2 = trunc i32 %shr to i1
+ %conv2.ret_ext = zext i1 %conv2 to i32
+ ret i32 %conv2.ret_ext
+}
+
+define i32 @_Z11testBoolAndjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %and3 = and i1 %b.arg_trunc, %a.arg_trunc
+ %and3.ret_ext = zext i1 %and3 to i32
+ ret i32 %and3.ret_ext
+}
+
+define i32 @_Z10testBoolOrjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %or3 = or i1 %b.arg_trunc, %a.arg_trunc
+ %or3.ret_ext = zext i1 %or3 to i32
+ ret i32 %or3.ret_ext
+}
+
+define i32 @_Z11testBoolXorjj(i32 %a, i32 %b) {
+entry:
+ %b.arg_trunc = trunc i32 %b to i1
+ %a.arg_trunc = trunc i32 %a to i1
+ %xor3 = xor i1 %b.arg_trunc, %a.arg_trunc
+ %xor3.ret_ext = zext i1 %xor3 to i32
+ ret i32 %xor3.ret_ext
+}
« no previous file with comments | « crosstest/test_arith.cpp ('k') | crosstest/test_arith_main.cpp » ('j') | src/IceInstX8632.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698