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 363392ce4bdd03cba86c80dc1af6b033202c1896..634c41ff38f3bd60556b49f83010ab2519d2790c 100644 |
--- a/test/cctest/wasm/test-run-wasm-64.cc |
+++ b/test/cctest/wasm/test-run-wasm-64.cc |
@@ -869,26 +869,35 @@ void TestI64Cmp(WasmOpcode opcode, int64_t expected, int64_t a, int64_t b) { |
} while (false) |
TEST(Run_Wasm_I64Binops) { |
- // TODO(titzer): real 64-bit numbers |
- TEST_I64_BINOP(I64Add, 8888888888888LL, 3333333333333LL, 5555555555555LL); |
- TEST_I64_BINOP(I64Sub, -111111111111LL, 777777777777LL, 888888888888LL); |
- TEST_I64_BINOP(I64Mul, 65130756, 88734, 734); |
- TEST_I64_BINOP(I64Mul, 65130756, -88734, -734); |
- TEST_I64_BINOP(I64Mul, -65130756, -88734, 734); |
- TEST_I64_BINOP(I64DivS, -66, -4777344, 72384); |
- TEST_I64_BINOP(I64DivU, 805306368, 0xF0000000, 5); |
- TEST_I64_BINOP(I64RemS, -3, -3003, 1000); |
- TEST_I64_BINOP(I64RemU, 4, 4004, 1000); |
- TEST_I64_BINOP(I64And, 0xEE, 0xFFEE, 0xFF0000FF); |
- TEST_I64_BINOP(I64Ior, 0xF0FF00FF, 0xF0F000EE, 0x000F0011); |
- TEST_I64_BINOP(I64Xor, 0xABCDEF01, 0xABCDEFFF, 0xFE); |
- TEST_I64_BINOP(I64Shl, 0xA0000000, 0xA, 28); |
- TEST_I64_BINOP(I64ShrU, 0x0700001000123456LL, 0x7000010001234567LL, 4); |
- TEST_I64_BINOP(I64ShrS, 0xFF00000000000000LL, 0x8000000000000000LL, 7); |
- TEST_I64_BINOP(I64Ror, 0x0100000000000000LL, 0x8000000000000000LL, 7); |
- TEST_I64_BINOP(I64Ror, 0x0100000000000000LL, 0x8000000000000000LL, 71); |
- TEST_I64_BINOP(I64Rol, 0x0000000000000040LL, 0x8000000000000000LL, 7); |
- TEST_I64_BINOP(I64Rol, 0x0000000000000040LL, 0x8000000000000000LL, 71); |
+ TEST_I64_BINOP(I64Add, -5586332274295447011, 0x501b72ebabc26847, |
+ 0x625de9793d8f79d6); |
+ TEST_I64_BINOP(I64Sub, 9001903251710731490, 0xf24fe6474640002e, |
+ 0x7562b6f711991b4c); |
+ TEST_I64_BINOP(I64Mul, -4569547818546064176, 0x231a263c2cbc6451, |
+ 0xead44de6bd3e23d0); |
+ TEST_I64_BINOP(I64Mul, -25963122347507043, 0x4da1fa47c9352b73, |
+ 0x91fe82317aa035af); |
+ TEST_I64_BINOP(I64Mul, 7640290486138131960, 0x185731abe8eea47c, |
+ 0x714ec59f1380d4c2); |
+ TEST_I64_BINOP(I64DivS, -91517, 0x93b1190a34de56a0, 0x00004d8f68863948); |
+ TEST_I64_BINOP(I64DivU, 149016, 0xe15b3727e8a2080a, 0x0000631bfa72db8b); |
+ TEST_I64_BINOP(I64RemS, -664128064149968, 0x9a78b4e4fe708692, |
+ 0x0003e0b6b3be7609); |
+ TEST_I64_BINOP(I64RemU, 1742040017332765, 0x0ce84708c6258c81, |
+ 0x000a6fde82016697); |
+ TEST_I64_BINOP(I64And, 2531040582801836054, 0xaf257d1602644a16, |
+ 0x33b290a91a10d997); |
+ TEST_I64_BINOP(I64Ior, 8556201506536114940, 0x169d9be7bd3f0a5c, |
+ 0x66bca28d77af40e8); |
+ TEST_I64_BINOP(I64Xor, -4605655183785456377, 0xb6ea20a5d48e85b8, |
+ 0x76ff4da6c80688bf); |
+ TEST_I64_BINOP(I64Shl, -7240704056088331264, 0xef4dc1ed030e8ffe, 9); |
ahaas
2016/03/31 09:14:54
Some instructions (e.g. shifts) have their own tes
|
+ TEST_I64_BINOP(I64ShrU, 12500673744059159, 0xb1a52fa7deec5d14, 10); |
+ TEST_I64_BINOP(I64ShrS, 1725103446999874, 0x3107c791461a112b, 11); |
+ TEST_I64_BINOP(I64Ror, -8960135652432576946, 0x73418d1717e4e83a, 12); |
+ TEST_I64_BINOP(I64Ror, 7617662827409989779, 0xebff67cf0c126d36, 13); |
+ TEST_I64_BINOP(I64Rol, -2097714064174346012, 0x43938b8db0b0f230, 14); |
+ TEST_I64_BINOP(I64Rol, 8728493013947314237, 0xe07af243ac4d219d, 15); |
} |
#define TEST_I64_CMP(name, expected, a, b) \ |
@@ -897,17 +906,16 @@ TEST(Run_Wasm_I64Binops) { |
} while (false) |
TEST(Run_Wasm_I64Compare) { |
- // TODO(titzer): real 64-bit numbers |
- TEST_I64_CMP(I64Eq, 1, -9999, -9999); |
- TEST_I64_CMP(I64Ne, 1, -9199, -9999); |
- TEST_I64_CMP(I64LtS, 1, -4, 4); |
- TEST_I64_CMP(I64LeS, 0, -2, -3); |
- TEST_I64_CMP(I64LtU, 1, 0, -6); |
- TEST_I64_CMP(I64LeU, 1, 98978, 0xF0000000); |
- TEST_I64_CMP(I64GtS, 1, 4, -4); |
- TEST_I64_CMP(I64GeS, 0, -3, -2); |
- TEST_I64_CMP(I64GtU, 1, -6, 0); |
- TEST_I64_CMP(I64GeU, 1, 0xF0000000, 98978); |
+ TEST_I64_CMP(I64Eq, 0, 0xB915D8FA494064F0, 0x04D700B2536019A3); |
+ TEST_I64_CMP(I64Ne, 1, 0xC2FAFAAAB0446CDC, 0x52A3328F780C97A3); |
+ TEST_I64_CMP(I64LtS, 0, 0x673636E6306B0578, 0x028EC9ECA78F7227); |
+ TEST_I64_CMP(I64LeS, 1, 0xAE5214114B86A0FA, 0x7C1D21DA3DFD0CCF); |
+ TEST_I64_CMP(I64LtU, 0, 0x7D52166381EC1CE0, 0x59F4A6A9E78CD3D8); |
+ TEST_I64_CMP(I64LeU, 1, 0xE4169A385C7EA0E0, 0xFBDBED2C8781E5BC); |
+ TEST_I64_CMP(I64GtS, 0, 0x9D08FF8FB5F42E81, 0xD4E5C9D7FE09F621); |
+ TEST_I64_CMP(I64GeS, 1, 0x78DA3B2F73264E0F, 0x6FE5E2A67C501CBE); |
+ TEST_I64_CMP(I64GtU, 0, 0x8F691284E44F7DA9, 0xD5EA9BC1EE149192); |
+ TEST_I64_CMP(I64GeU, 0, 0x0886A0C58C7AA224, 0x5DDBE5A81FD7EE47); |
} |
TEST(Run_Wasm_I64Clz) { |
@@ -1102,7 +1110,7 @@ TEST(Run_WasmCall_Int64Sub) { |
TEST(Run_Wasm_LoadStoreI64_sx) { |
REQUIRE(I64LoadStore); |
- REQUIRE(DepthFirst); // TODO(titzer): temporary hack |
+ REQUIRE(DepthFirst); |
byte loads[] = {kExprI64LoadMem8S, kExprI64LoadMem16S, kExprI64LoadMem32S, |
kExprI64LoadMem}; |
@@ -1288,7 +1296,7 @@ TEST(Run_Wasm_I64Global) { |
REQUIRE(I64LoadStore); |
REQUIRE(I64SConvertI32); |
REQUIRE(I64And); |
- REQUIRE(DepthFirst); // TODO(titzer): temporary hack |
+ REQUIRE(DepthFirst); |
TestingModule module; |
int64_t* global = module.AddGlobal<int64_t>(MachineType::Int64()); |
WasmRunner<int32_t> r(&module, MachineType::Int32()); |