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/wasm/wasm-macro-gen.h" | 9 #include "src/wasm/wasm-macro-gen.h" |
10 | 10 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 WASM_GET_LOCAL(1)), | 413 WASM_GET_LOCAL(1)), |
414 WASM_I32_DIVS(WASM_STORE_MEM(MachineType::Int8(), | 414 WASM_I32_DIVS(WASM_STORE_MEM(MachineType::Int8(), |
415 WASM_ZERO, WASM_GET_LOCAL(0)), | 415 WASM_ZERO, WASM_GET_LOCAL(0)), |
416 WASM_GET_LOCAL(1)))); | 416 WASM_GET_LOCAL(1)))); |
417 CHECK_EQ(0, r.Call(0, 100)); | 417 CHECK_EQ(0, r.Call(0, 100)); |
418 CHECK_TRAP(r.Call(8, 0)); | 418 CHECK_TRAP(r.Call(8, 0)); |
419 CHECK_TRAP(r.Call(4, 0)); | 419 CHECK_TRAP(r.Call(4, 0)); |
420 CHECK_TRAP(r.Call(0, 0)); | 420 CHECK_TRAP(r.Call(0, 0)); |
421 } | 421 } |
422 | 422 |
423 | |
424 void TestFloat32Binop(WasmOpcode opcode, int32_t expected, float a, float b) { | 423 void TestFloat32Binop(WasmOpcode opcode, int32_t expected, float a, float b) { |
425 { | 424 { |
426 WasmRunner<int32_t> r; | 425 WasmRunner<int32_t> r; |
427 // return K op K | 426 // return K op K |
428 BUILD(r, WASM_BINOP(opcode, WASM_F32(a), WASM_F32(b))); | 427 BUILD(r, WASM_BINOP(opcode, WASM_F32(a), WASM_F32(b))); |
429 CHECK_EQ(expected, r.Call()); | 428 CHECK_EQ(expected, r.Call()); |
430 } | 429 } |
431 { | 430 { |
432 WasmRunner<int32_t> r(MachineType::Float32(), MachineType::Float32()); | 431 WasmRunner<int32_t> r(MachineType::Float32(), MachineType::Float32()); |
433 // return a op b | 432 // return a op b |
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2732 | 2731 |
2733 #if WASM_64 | 2732 #if WASM_64 |
2734 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } | 2733 TEST(Compile_Wasm_CallIndirect_Many_i64) { CompileCallIndirectMany(kAstI64); } |
2735 #endif | 2734 #endif |
2736 | 2735 |
2737 | 2736 |
2738 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); } | 2737 TEST(Compile_Wasm_CallIndirect_Many_f32) { CompileCallIndirectMany(kAstF32); } |
2739 | 2738 |
2740 | 2739 |
2741 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); } | 2740 TEST(Compile_Wasm_CallIndirect_Many_f64) { CompileCallIndirectMany(kAstF64); } |
OLD | NEW |