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

Unified Diff: test/cctest/wasm/test-run-wasm-64.cc

Issue 2637583002: [wasm] Fix codegen issue for i64.add and i64.sub on ia32 (Closed)
Patch Set: Rebasing Created 3 years, 11 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
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | test/mjsunit/regress/wasm/regression-5800.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/wasm/test-run-wasm-64.cc
diff --git a/test/cctest/wasm/test-run-wasm-64.cc b/test/cctest/wasm/test-run-wasm-64.cc
index e217bb8e71e09db7e09ac4f5afd08634e2427ced..e28273d3bed2617a021fc9b9e50dba1a19448d4d 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -136,6 +136,21 @@ WASM_EXEC_TEST(I64Add) {
}
}
+// The i64 add and subtract regression tests need a 64-bit value with a non-zero
+// upper half. This upper half was clobbering eax, leading to the function
+// returning 1 rather than 0.
+const int64_t kHasBit33On = 0x100000000;
+
+WASM_EXEC_TEST(Regress5800_Add) {
+ REQUIRE(I64Add);
+ WasmRunner<int32_t> r(execution_mode);
+ BUILD(r, WASM_BLOCK(WASM_BR_IF(0, WASM_I64_EQZ(WASM_I64_ADD(
+ WASM_I64V(0), WASM_I64V(kHasBit33On)))),
+ WASM_RETURN1(WASM_I32V(0))),
+ WASM_I32V(0));
+ CHECK_EQ(0, r.Call());
+}
+
WASM_EXEC_TEST(I64Sub) {
REQUIRE(I64Sub);
WasmRunner<int64_t, int64_t, int64_t> r(execution_mode);
@@ -145,6 +160,16 @@ WASM_EXEC_TEST(I64Sub) {
}
}
+WASM_EXEC_TEST(Regress5800_Sub) {
+ REQUIRE(I64Sub);
+ WasmRunner<int32_t> r(execution_mode);
+ BUILD(r, WASM_BLOCK(WASM_BR_IF(0, WASM_I64_EQZ(WASM_I64_SUB(
+ WASM_I64V(0), WASM_I64V(kHasBit33On)))),
+ WASM_RETURN1(WASM_I32V(0))),
+ WASM_I32V(0));
+ CHECK_EQ(0, r.Call());
+}
+
WASM_EXEC_TEST(I64AddUseOnlyLowWord) {
REQUIRE(I64Add);
REQUIRE(I32ConvertI64);
« no previous file with comments | « src/compiler/ia32/code-generator-ia32.cc ('k') | test/mjsunit/regress/wasm/regression-5800.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698