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 |
11 #include "test/cctest/cctest.h" | 11 #include "test/cctest/cctest.h" |
12 #include "test/cctest/compiler/value-helper.h" | 12 #include "test/cctest/compiler/value-helper.h" |
13 #include "test/cctest/wasm/wasm-run-utils.h" | 13 #include "test/cctest/wasm/wasm-run-utils.h" |
14 | 14 |
15 // using namespace v8::base; | 15 // using namespace v8::base; |
16 // using namespace v8::internal; | 16 // using namespace v8::internal; |
17 // using namespace v8::internal::compiler; | 17 // using namespace v8::internal::compiler; |
18 // using namespace v8::internal::wasm; | 18 // using namespace v8::internal::wasm; |
19 | 19 |
20 // todo(ahaas): I added a list of missing instructions here to make merging | 20 // todo(ahaas): I added a list of missing instructions here to make merging |
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) { | |
titzer
2016/03/14 14:50:45
You'll need to rebase and REQUIRE(I64Add)
| |
24 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | |
25 BUILD(r, WASM_I64_ADD(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | |
26 FOR_INT64_INPUTS(i) { | |
27 FOR_INT64_INPUTS(j) { CHECK_EQ(*i + *j, r.Call(*i, *j)); } | |
28 } | |
29 } | |
23 // kExprI64Sub: | 30 // kExprI64Sub: |
24 // kExprI64Mul: | 31 // kExprI64Mul: |
25 // kExprI64DivS: | 32 // kExprI64DivS: |
26 // kExprI64DivU: | 33 // kExprI64DivU: |
27 // kExprI64RemS: | 34 // kExprI64RemS: |
28 // kExprI64RemU: | 35 // kExprI64RemU: |
29 // kExprI64And: | 36 // kExprI64And: |
30 TEST(Run_WasmI64And) { | 37 TEST(Run_WasmI64And) { |
31 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); | 38 WasmRunner<int64_t> r(MachineType::Int64(), MachineType::Int64()); |
32 BUILD(r, WASM_I64_AND(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); | 39 BUILD(r, WASM_I64_AND(WASM_GET_LOCAL(0), WASM_GET_LOCAL(1))); |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), | 538 WASM_I64V_10(0xbcd1234000000013), WASM_I64V_10(0xbcd1234000000014), |
532 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), | 539 WASM_I64V_10(0xbcd1234000000015), WASM_I64V_10(0xbcd1234000000016), |
533 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), | 540 WASM_I64V_10(0xbcd1234000000017), WASM_I64V_10(0xbcd1234000000018), |
534 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), | 541 WASM_I64V_10(0xbcd1234000000019), WASM_I64V_10(0xbcd123400000001a), |
535 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), | 542 WASM_I64V_10(0xbcd123400000001b), WASM_I64V_10(0xbcd123400000001c), |
536 WASM_I64V_10(0xbcd123400000001d)))); | 543 WASM_I64V_10(0xbcd123400000001d)))); |
537 | 544 |
538 CHECK_EQ(i + 0xb, r.Call()); | 545 CHECK_EQ(i + 0xb, r.Call()); |
539 } | 546 } |
540 } | 547 } |
OLD | NEW |