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 = IsInt32AddPair( |
| 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 // kExprI64And: | 326 // kExprI64And: |
312 // kExprI64Ior: | 327 // kExprI64Ior: |
313 TEST_F(Int64LoweringTest, Int64Ior) { | 328 TEST_F(Int64LoweringTest, Int64Ior) { |
314 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), | 329 LowerGraph(graph()->NewNode(machine()->Word64Or(), Int64Constant(value(0)), |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 // kExprF64SConvertI64: | 420 // kExprF64SConvertI64: |
406 // kExprF64UConvertI64: | 421 // kExprF64UConvertI64: |
407 // kExprI64SConvertF32: | 422 // kExprI64SConvertF32: |
408 // kExprI64SConvertF64: | 423 // kExprI64SConvertF64: |
409 // kExprI64UConvertF32: | 424 // kExprI64UConvertF32: |
410 // kExprI64UConvertF64: | 425 // kExprI64UConvertF64: |
411 | 426 |
412 } // namespace compiler | 427 } // namespace compiler |
413 } // namespace internal | 428 } // namespace internal |
414 } // namespace v8 | 429 } // namespace v8 |
OLD | NEW |