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 2bcd538f5fe139069dfc42e379a59d826115ecca..dac33357f554b3c4e44d9f0a08227985503b2aeb 100644 |
--- a/test/cctest/wasm/test-run-wasm-64.cc |
+++ b/test/cctest/wasm/test-run-wasm-64.cc |
@@ -85,7 +85,73 @@ TEST(Run_WasmI64Shl) { |
} |
#endif |
// kExprI64ShrU: |
+#if !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_X87 && !V8_TARGET_ARCH_ARM |
+TEST(Run_WasmI64ShrU) { |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
+ FOR_UINT64_INPUTS(i) { |
+ for (int64_t j = 1; j < 64; j++) { |
+ CHECK_EQ(*i >> j, r.Call(*i, j)); |
+ } |
+ } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(0))); |
+ FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 0, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(32))); |
+ FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 32, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(20))); |
+ FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 20, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SHR(WASM_GET_LOCAL(0), WASM_I64V_1(40))); |
+ FOR_UINT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); } |
+ } |
+} |
+#endif |
// kExprI64ShrS: |
+#if !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_X87 && !V8_TARGET_ARCH_ARM |
+TEST(Run_WasmI64ShrS) { |
+ { |
+ 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_t j = 1; j < 64; j++) { |
+ CHECK_EQ(*i >> j, r.Call(*i, j)); |
+ } |
+ } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_I64V_1(0))); |
+ FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 0, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_I64V_1(32))); |
+ FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 32, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_I64V_1(20))); |
+ FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 20, r.Call(*i)); } |
+ } |
+ { |
+ WasmRunner<int64_t> r(MachineType::Int64()); |
+ BUILD(r, WASM_I64_SAR(WASM_GET_LOCAL(0), WASM_I64V_1(40))); |
+ FOR_INT64_INPUTS(i) { CHECK_EQ(*i >> 40, r.Call(*i)); } |
+ } |
+} |
+#endif |
// kExprI64Eq: |
TEST(Run_WasmI64Eq) { |
WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64()); |