OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 "src/compiler/int64-lowering.h" | 5 #include "src/compiler/int64-lowering.h" |
6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
7 #include "src/compiler/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/machine-operator.h" | 8 #include "src/compiler/machine-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 | 10 |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 | 295 |
296 CompareCallDescriptors( | 296 CompareCallDescriptors( |
297 OpParameter<const CallDescriptor*>( | 297 OpParameter<const CallDescriptor*>( |
298 graph()->end()->InputAt(1)->InputAt(0)), | 298 graph()->end()->InputAt(1)->InputAt(0)), |
299 wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc)); | 299 wasm::ModuleEnv::GetI32WasmCallDescriptor(zone(), desc)); |
300 } | 300 } |
301 | 301 |
302 // todo(ahaas): I added a list of missing instructions here to make merging | 302 // todo(ahaas): I added a list of missing instructions here to make merging |
303 // easier when I do them one by one. | 303 // easier when I do them one by one. |
304 // kExprI64Add: | 304 // kExprI64Add: |
| 305 TEST_F(Int64LoweringTest, Int64Add) { |
| 306 LowerGraph(graph()->NewNode(machine()->Int64Add(), Int64Constant(value(0)), |
| 307 Int64Constant(value(1))), |
| 308 MachineRepresentation::kWord64); |
| 309 |
| 310 Capture<Node*> add; |
| 311 Matcher<Node*> add_matcher = IsInt32PairAdd( |
| 312 IsInt32Constant(low_word_value(0)), IsInt32Constant(high_word_value(0)), |
| 313 IsInt32Constant(low_word_value(1)), IsInt32Constant(high_word_value(1))); |
| 314 |
| 315 EXPECT_THAT(graph()->end()->InputAt(1), |
| 316 IsReturn2(IsProjection(0, AllOf(CaptureEq(&add), add_matcher)), |
| 317 IsProjection(1, AllOf(CaptureEq(&add), add_matcher)), |
| 318 start(), start())); |
| 319 } |
305 // kExprI64Sub: | 320 // kExprI64Sub: |
306 // kExprI64Mul: | 321 // kExprI64Mul: |
307 // kExprI64DivS: | 322 // kExprI64DivS: |
308 // kExprI64DivU: | 323 // kExprI64DivU: |
309 // kExprI64RemS: | 324 // kExprI64RemS: |
310 // kExprI64RemU: | 325 // kExprI64RemU: |
311 // kExprI64Ior: | 326 // kExprI64Ior: |
312 TEST_F(Int64LoweringTest, Int64Ior) { | 327 TEST_F(Int64LoweringTest, Int64Ior) { |
313 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), | 328 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), |
314 Int64Constant(value(1))), | 329 Int64Constant(value(1))), |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 } | 490 } |
476 // kExprF64ReinterpretI64: | 491 // kExprF64ReinterpretI64: |
477 // kExprI64ReinterpretF64: | 492 // kExprI64ReinterpretF64: |
478 | 493 |
479 // kExprI64Clz: | 494 // kExprI64Clz: |
480 // kExprI64Ctz: | 495 // kExprI64Ctz: |
481 // kExprI64Popcnt: | 496 // kExprI64Popcnt: |
482 } // namespace compiler | 497 } // namespace compiler |
483 } // namespace internal | 498 } // namespace internal |
484 } // namespace v8 | 499 } // namespace v8 |
OLD | NEW |