OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdint.h> | 5 #include <stdint.h> |
6 #include <stdlib.h> | 6 #include <stdlib.h> |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/wasm/wasm-macro-gen.h" | 10 #include "src/wasm/wasm-macro-gen.h" |
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 CHECK_EQ(kWritten, module.ReadMemory(&memory[0])); | 1361 CHECK_EQ(kWritten, module.ReadMemory(&memory[0])); |
1362 } | 1362 } |
1363 } | 1363 } |
1364 | 1364 |
1365 WASM_EXEC_TEST(I64Global) { | 1365 WASM_EXEC_TEST(I64Global) { |
1366 REQUIRE(I64LoadStore); | 1366 REQUIRE(I64LoadStore); |
1367 REQUIRE(I64SConvertI32); | 1367 REQUIRE(I64SConvertI32); |
1368 REQUIRE(I64And); | 1368 REQUIRE(I64And); |
1369 REQUIRE(DepthFirst); | 1369 REQUIRE(DepthFirst); |
1370 TestingModule module(execution_mode); | 1370 TestingModule module(execution_mode); |
1371 int64_t* global = module.AddGlobal<int64_t>(MachineType::Int64()); | 1371 int64_t* global = module.AddGlobal<int64_t>(kAstI64); |
1372 WasmRunner<int32_t> r(&module, MachineType::Int32()); | 1372 WasmRunner<int32_t> r(&module, MachineType::Int32()); |
1373 // global = global + p0 | 1373 // global = global + p0 |
1374 BUILD(r, B2(WASM_STORE_GLOBAL( | 1374 BUILD(r, B2(WASM_STORE_GLOBAL( |
1375 0, WASM_I64_AND(WASM_LOAD_GLOBAL(0), | 1375 0, WASM_I64_AND(WASM_LOAD_GLOBAL(0), |
1376 WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))), | 1376 WASM_I64_SCONVERT_I32(WASM_GET_LOCAL(0)))), |
1377 WASM_ZERO)); | 1377 WASM_ZERO)); |
1378 | 1378 |
1379 module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL); | 1379 module.WriteMemory<int64_t>(global, 0xFFFFFFFFFFFFFFFFLL); |
1380 for (int i = 9; i < 444444; i += 111111) { | 1380 for (int i = 9; i < 444444; i += 111111) { |
1381 int64_t expected = *global & i; | 1381 int64_t expected = *global & i; |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 CHECK_EQ(expected, result); | 1566 CHECK_EQ(expected, result); |
1567 } | 1567 } |
1568 } | 1568 } |
1569 } | 1569 } |
1570 } | 1570 } |
1571 | 1571 |
1572 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } | 1572 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } |
1573 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } | 1573 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } |
1574 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } | 1574 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } |
1575 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } | 1575 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } |
OLD | NEW |