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

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

Issue 1845443003: [wasm] Mask shift counts on architectures that don't implicitly mask. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Spelling Created 4 years, 9 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 | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/wasm/asm-wasm-i32.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 cd3f4aa428ff4ce120077867377b0a845d51ed8e..363392ce4bdd03cba86c80dc1af6b033202c1896 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -1317,3 +1317,42 @@ TEST(Run_WasmI64Eqz) {
CHECK_EQ(result, r.Call(*i));
}
}
+
+TEST(Run_WasmI64Shl) {
+ REQUIRE(I64Shl);
+ WasmRunner<uint64_t> r(MachineType::Uint64(), MachineType::Uint64());
+ BUILD(r, WASM_I64_SHL(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) {
+ uint64_t expected = (*i) << (*j & 0x3f);
+ CHECK_EQ(expected, r.Call(*i, *j));
+ }
+ }
+}
+
+TEST(Run_WasmI64Shr) {
+ REQUIRE(I64ShrU);
+ WasmRunner<uint64_t> r(MachineType::Uint64(), MachineType::Uint64());
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) {
+ uint64_t expected = (*i) >> (*j & 0x3f);
+ CHECK_EQ(expected, r.Call(*i, *j));
+ }
+ }
+}
+
+TEST(Run_WasmI64Sar) {
+ REQUIRE(I64ShrS);
+ WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) {
+ int64_t expected = (*i) >> (*j & 0x3f);
+ CHECK_EQ(expected, r.Call(*i, *j));
+ }
+ }
+}
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | test/mjsunit/wasm/asm-wasm-i32.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698