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 10 matching lines...) Expand all Loading... |
21 // easier when I do them one by one. | 21 // easier when I do them one by one. |
22 // kExprI64Add: | 22 // kExprI64Add: |
23 TEST(Run_WasmI64Add) { | 23 TEST(Run_WasmI64Add) { |
24 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 24 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
25 BUILD(r, WASM_I64_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 25 BUILD(r, WASM_I64_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
26 FOR_INT64_INPUTS(i) { | 26 FOR_INT64_INPUTS(i) { |
27 FOR_INT64_INPUTS(j) { CHECK_EQ(*i + *j, r.Call(*i, *j)); } | 27 FOR_INT64_INPUTS(j) { CHECK_EQ(*i + *j, r.Call(*i, *j)); } |
28 } | 28 } |
29 } | 29 } |
30 // kExprI64Sub: | 30 // kExprI64Sub: |
| 31 TEST(Run_WasmI64Sub) { |
| 32 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
| 33 BUILD(r, WASM_I64_SUB(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
| 34 FOR_INT64_INPUTS(i) { |
| 35 FOR_INT64_INPUTS(j) { CHECK_EQ(*i - *j, r.Call(*i, *j)); } |
| 36 } |
| 37 } |
31 // kExprI64Mul: | 38 // kExprI64Mul: |
32 // kExprI64DivS: | 39 // kExprI64DivS: |
33 // kExprI64DivU: | 40 // kExprI64DivU: |
34 // kExprI64RemS: | 41 // kExprI64RemS: |
35 // kExprI64RemU: | 42 // kExprI64RemU: |
36 // kExprI64And: | 43 // kExprI64And: |
37 TEST(Run_WasmI64And) { | 44 TEST(Run_WasmI64And) { |
38 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 45 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
39 BUILD(r, WASM_I64_AND(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 46 BUILD(r, WASM_I64_AND(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
40 FOR_INT64_INPUTS(i) { | 47 FOR_INT64_INPUTS(i) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), | 490 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), |
484 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), | 491 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), |
485 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), | 492 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), |
486 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), | 493 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), |
487 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), | 494 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), |
488 WASM_I64V_10(0xbcd123400000001d)))); | 495 WASM_I64V_10(0xbcd123400000001d)))); |
489 | 496 |
490 CHECK_EQ(i + 0xb, r.Call()); | 497 CHECK_EQ(i + 0xb, r.Call()); |
491 } | 498 } |
492 } | 499 } |
OLD | NEW |