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

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

Issue 1729263002: [wasm] I added comparison operators to the Int64Lowering. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: git rebase Created 4 years, 10 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/wasm-compiler.cc ('k') | test/unittests/compiler/int64-lowering-unittest.cc » ('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 de2a54d415cbdb6b78c23e0badd8d801d6524ba3..9cc15a74f75dfec5b64fc3010aa9f13869886882 100644
--- a/test/cctest/wasm/test-run-wasm-64.cc
+++ b/test/cctest/wasm/test-run-wasm-64.cc
@@ -70,14 +70,64 @@ TEST(Run_WasmI64Ne) {
}
}
// kExprI64LtS:
-// kExprI64LeS:
-// kExprI64LtU:
-// kExprI64LeU:
-// kExprI64GtS:
-// kExprI64GeS:
-// kExprI64GtU:
-// kExprI64GeU:
+TEST(Run_WasmI64LtS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LTS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64LeS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LES(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64LtU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LTU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i < *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64LeU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_LEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i <= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64GtS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GTS(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64GeS) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GES(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_INT64_INPUTS(i) {
+ FOR_INT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+TEST(Run_WasmI64GtU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GTU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i > *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
+
+TEST(Run_WasmI64GeU) {
+ WasmRunner<int32_t> r(MachineType::Int64(), MachineType::Int64());
+ BUILD(r, WASM_I64_GEU(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1)));
+ FOR_UINT64_INPUTS(i) {
+ FOR_UINT64_INPUTS(j) { CHECK_EQ(*i >= *j ? 1 : 0, r.Call(*i, *j)); }
+ }
+}
// kExprI32ConvertI64:
TEST(Run_WasmI32ConvertI64) {
FOR_INT64_INPUTS(i) {
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | test/unittests/compiler/int64-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698