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

Side by Side Diff: test/cctest/wasm/test-run-wasm-64.cc

Issue 2639353002: [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32. (Closed)
Patch Set: use memcpy instead of reinterpret_cast Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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); }
OLDNEW
« no previous file with comments | « test/cctest/wasm/test-run-wasm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698