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 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 BUILD(r, WASM_I64_REINTERPRET_F64( | 1312 BUILD(r, WASM_I64_REINTERPRET_F64( |
1313 WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO))); | 1313 WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO))); |
1314 | 1314 |
1315 FOR_INT32_INPUTS(i) { | 1315 FOR_INT32_INPUTS(i) { |
1316 int64_t expected = static_cast<int64_t>(*i) * 0x300010001; | 1316 int64_t expected = static_cast<int64_t>(*i) * 0x300010001; |
1317 r.module().WriteMemory(&memory[0], expected); | 1317 r.module().WriteMemory(&memory[0], expected); |
1318 CHECK_EQ(expected, r.Call()); | 1318 CHECK_EQ(expected, r.Call()); |
1319 } | 1319 } |
1320 } | 1320 } |
1321 | 1321 |
| 1322 WASM_EXEC_TEST(SignallingNanSurvivesI64ReinterpretF64) { |
| 1323 REQUIRE(I64ReinterpretF64); |
| 1324 WasmRunner<int64_t> r(execution_mode); |
| 1325 BUILD(r, WASM_I64_REINTERPRET_F64(WASM_SEQ(kExprF64Const, 0x00, 0x00, 0x00, |
| 1326 0x00, 0x00, 0x00, 0xf4, 0x7f))); |
| 1327 |
| 1328 // This is a signalling nan. |
| 1329 CHECK_EQ(0x7ff4000000000000, r.Call()); |
| 1330 } |
| 1331 |
1322 WASM_EXEC_TEST(F64ReinterpretI64) { | 1332 WASM_EXEC_TEST(F64ReinterpretI64) { |
1323 REQUIRE(F64ReinterpretI64); | 1333 REQUIRE(F64ReinterpretI64); |
1324 WasmRunner<int64_t, int64_t> r(execution_mode); | 1334 WasmRunner<int64_t, int64_t> r(execution_mode); |
1325 int64_t* memory = r.module().AddMemoryElems<int64_t>(8); | 1335 int64_t* memory = r.module().AddMemoryElems<int64_t>(8); |
1326 | 1336 |
1327 BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO, | 1337 BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO, |
1328 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))), | 1338 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))), |
1329 WASM_GET_LOCAL(0)); | 1339 WASM_GET_LOCAL(0)); |
1330 | 1340 |
1331 FOR_INT32_INPUTS(i) { | 1341 FOR_INT32_INPUTS(i) { |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 CHECK_EQ(expected, result); | 1625 CHECK_EQ(expected, result); |
1616 } | 1626 } |
1617 } | 1627 } |
1618 } | 1628 } |
1619 } | 1629 } |
1620 | 1630 |
1621 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } | 1631 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } |
1622 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } | 1632 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } |
1623 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } | 1633 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } |
1624 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } | 1634 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } |
OLD | NEW |