| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "src/base/adapters.h" | 7 #include "src/base/adapters.h" |
| 8 #include "src/compiler/instruction-selector-impl.h" | 8 #include "src/compiler/instruction-selector-impl.h" |
| 9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 | 727 |
| 728 | 728 |
| 729 void VisitMulHigh(InstructionSelector* selector, Node* node, | 729 void VisitMulHigh(InstructionSelector* selector, Node* node, |
| 730 ArchOpcode opcode) { | 730 ArchOpcode opcode) { |
| 731 X64OperandGenerator g(selector); | 731 X64OperandGenerator g(selector); |
| 732 Node* left = node->InputAt(0); | 732 Node* left = node->InputAt(0); |
| 733 Node* right = node->InputAt(1); | 733 Node* right = node->InputAt(1); |
| 734 if (selector->IsLive(left) && !selector->IsLive(right)) { | 734 if (selector->IsLive(left) && !selector->IsLive(right)) { |
| 735 std::swap(left, right); | 735 std::swap(left, right); |
| 736 } | 736 } |
| 737 InstructionOperand temps[] = {g.TempRegister(rax)}; |
| 737 // TODO(turbofan): We use UseUniqueRegister here to improve register | 738 // TODO(turbofan): We use UseUniqueRegister here to improve register |
| 738 // allocation. | 739 // allocation. |
| 739 selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), | 740 selector->Emit(opcode, g.DefineAsFixed(node, rdx), g.UseFixed(left, rax), |
| 740 g.UseUniqueRegister(right)); | 741 g.UseUniqueRegister(right), arraysize(temps), temps); |
| 741 } | 742 } |
| 742 | 743 |
| 743 | 744 |
| 744 void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) { | 745 void VisitDiv(InstructionSelector* selector, Node* node, ArchOpcode opcode) { |
| 745 X64OperandGenerator g(selector); | 746 X64OperandGenerator g(selector); |
| 746 InstructionOperand temps[] = {g.TempRegister(rdx)}; | 747 InstructionOperand temps[] = {g.TempRegister(rdx)}; |
| 747 selector->Emit( | 748 selector->Emit( |
| 748 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), | 749 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), |
| 749 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); | 750 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); |
| 750 } | 751 } |
| (...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1813 MachineOperatorBuilder::kFloat64RoundTruncate | | 1814 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1814 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1815 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1815 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1816 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1816 } | 1817 } |
| 1817 return flags; | 1818 return flags; |
| 1818 } | 1819 } |
| 1819 | 1820 |
| 1820 } // namespace compiler | 1821 } // namespace compiler |
| 1821 } // namespace internal | 1822 } // namespace internal |
| 1822 } // namespace v8 | 1823 } // namespace v8 |
| OLD | NEW |