OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/instruction-selector-impl.h" | 6 #include "src/compiler/instruction-selector-impl.h" |
7 #include "src/compiler/node-matchers.h" | 7 #include "src/compiler/node-matchers.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 | 578 |
579 void InstructionSelector::VisitWord32Shr(Node* node) { | 579 void InstructionSelector::VisitWord32Shr(Node* node) { |
580 VisitShift(this, node, kIA32Shr); | 580 VisitShift(this, node, kIA32Shr); |
581 } | 581 } |
582 | 582 |
583 | 583 |
584 void InstructionSelector::VisitWord32Sar(Node* node) { | 584 void InstructionSelector::VisitWord32Sar(Node* node) { |
585 VisitShift(this, node, kIA32Sar); | 585 VisitShift(this, node, kIA32Sar); |
586 } | 586 } |
587 | 587 |
| 588 void InstructionSelector::VisitWasmWord64Shl(Node* node) { |
| 589 IA32OperandGenerator g(this); |
| 590 |
| 591 Node* shift = node->InputAt(2); |
| 592 InstructionOperand shift_operand; |
| 593 if (g.CanBeImmediate(shift)) { |
| 594 shift_operand = g.UseImmediate(shift); |
| 595 } else { |
| 596 shift_operand = g.UseFixed(shift, ecx); |
| 597 } |
| 598 InstructionOperand inputs[] = {g.UseFixed(node->InputAt(0), eax), |
| 599 g.UseFixed(node->InputAt(1), edx), |
| 600 shift_operand}; |
| 601 |
| 602 InstructionOperand outputs[] = { |
| 603 g.DefineAsFixed(node, eax), |
| 604 g.DefineAsFixed(NodeProperties::FindProjection(node, 1), edx)}; |
| 605 |
| 606 Emit(kIA32Shl64, 2, outputs, 3, inputs); |
| 607 } |
588 | 608 |
589 void InstructionSelector::VisitWord32Ror(Node* node) { | 609 void InstructionSelector::VisitWord32Ror(Node* node) { |
590 VisitShift(this, node, kIA32Ror); | 610 VisitShift(this, node, kIA32Ror); |
591 } | 611 } |
592 | 612 |
593 | 613 |
594 void InstructionSelector::VisitWord32Clz(Node* node) { | 614 void InstructionSelector::VisitWord32Clz(Node* node) { |
595 IA32OperandGenerator g(this); | 615 IA32OperandGenerator g(this); |
596 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); | 616 Emit(kIA32Lzcnt, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
597 } | 617 } |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1444 MachineOperatorBuilder::kFloat64RoundTruncate | | 1464 MachineOperatorBuilder::kFloat64RoundTruncate | |
1445 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1465 MachineOperatorBuilder::kFloat32RoundTiesEven | |
1446 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1466 MachineOperatorBuilder::kFloat64RoundTiesEven; |
1447 } | 1467 } |
1448 return flags; | 1468 return flags; |
1449 } | 1469 } |
1450 | 1470 |
1451 } // namespace compiler | 1471 } // namespace compiler |
1452 } // namespace internal | 1472 } // namespace internal |
1453 } // namespace v8 | 1473 } // namespace v8 |
OLD | NEW |