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

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

Issue 2639353002: [wasm] Fix I32ReinterpretF32 and I64ReinterpretF64 on ia32. (Closed)
Patch Set: 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
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 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 BUILD(r, WASM_I64_REINTERPRET_F64( 1287 BUILD(r, WASM_I64_REINTERPRET_F64(
1288 WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO))); 1288 WASM_LOAD_MEM(MachineType::Float64(), WASM_ZERO)));
1289 1289
1290 FOR_INT32_INPUTS(i) { 1290 FOR_INT32_INPUTS(i) {
1291 int64_t expected = static_cast<int64_t>(*i) * 0x300010001; 1291 int64_t expected = static_cast<int64_t>(*i) * 0x300010001;
1292 r.module().WriteMemory(&memory[0], expected); 1292 r.module().WriteMemory(&memory[0], expected);
1293 CHECK_EQ(expected, r.Call()); 1293 CHECK_EQ(expected, r.Call());
1294 } 1294 }
1295 } 1295 }
1296 1296
1297 WASM_EXEC_TEST(SignallingNanSurvivesI64ReinterpretF64) {
1298 REQUIRE(I64ReinterpretF64);
1299 WasmRunner<int64_t> r(execution_mode);
1300 BUILD(r, WASM_I64_REINTERPRET_F64(WASM_SEQ(kExprF64Const, 0x00, 0x00, 0x00,
1301 0x00, 0x00, 0x00, 0xf4, 0x7f)));
1302
1303 // This is a signalling nan.
1304 CHECK_EQ(0x7ff4000000000000, r.Call());
1305 }
1306
1297 WASM_EXEC_TEST(F64ReinterpretI64) { 1307 WASM_EXEC_TEST(F64ReinterpretI64) {
1298 REQUIRE(F64ReinterpretI64); 1308 REQUIRE(F64ReinterpretI64);
1299 WasmRunner<int64_t, int64_t> r(execution_mode); 1309 WasmRunner<int64_t, int64_t> r(execution_mode);
1300 int64_t* memory = r.module().AddMemoryElems<int64_t>(8); 1310 int64_t* memory = r.module().AddMemoryElems<int64_t>(8);
1301 1311
1302 BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO, 1312 BUILD(r, WASM_STORE_MEM(MachineType::Float64(), WASM_ZERO,
1303 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))), 1313 WASM_F64_REINTERPRET_I64(WASM_GET_LOCAL(0))),
1304 WASM_GET_LOCAL(0)); 1314 WASM_GET_LOCAL(0));
1305 1315
1306 FOR_INT32_INPUTS(i) { 1316 FOR_INT32_INPUTS(i) {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
1590 CHECK_EQ(expected, result); 1600 CHECK_EQ(expected, result);
1591 } 1601 }
1592 } 1602 }
1593 } 1603 }
1594 } 1604 }
1595 1605
1596 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); } 1606 WASM_EXEC_TEST(MixedCall_i64_0) { Run_WasmMixedCall_N(execution_mode, 0); }
1597 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); } 1607 WASM_EXEC_TEST(MixedCall_i64_1) { Run_WasmMixedCall_N(execution_mode, 1); }
1598 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); } 1608 WASM_EXEC_TEST(MixedCall_i64_2) { Run_WasmMixedCall_N(execution_mode, 2); }
1599 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); } 1609 WASM_EXEC_TEST(MixedCall_i64_3) { Run_WasmMixedCall_N(execution_mode, 3); }
OLDNEW
« src/wasm/wasm-interpreter.cc ('K') | « 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