| 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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 X64OperandGenerator g(selector); | 756 X64OperandGenerator g(selector); |
| 757 InstructionOperand temps[] = {g.TempRegister(rdx)}; | 757 InstructionOperand temps[] = {g.TempRegister(rdx)}; |
| 758 selector->Emit( | 758 selector->Emit( |
| 759 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), | 759 opcode, g.DefineAsFixed(node, rax), g.UseFixed(node->InputAt(0), rax), |
| 760 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); | 760 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); |
| 761 } | 761 } |
| 762 | 762 |
| 763 | 763 |
| 764 void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode opcode) { | 764 void VisitMod(InstructionSelector* selector, Node* node, ArchOpcode opcode) { |
| 765 X64OperandGenerator g(selector); | 765 X64OperandGenerator g(selector); |
| 766 selector->Emit(opcode, g.DefineAsFixed(node, rdx), | 766 InstructionOperand temps[] = {g.TempRegister(rax)}; |
| 767 g.UseFixed(node->InputAt(0), rax), | 767 selector->Emit( |
| 768 g.UseUniqueRegister(node->InputAt(1))); | 768 opcode, g.DefineAsFixed(node, rdx), g.UseFixed(node->InputAt(0), rax), |
| 769 g.UseUniqueRegister(node->InputAt(1)), arraysize(temps), temps); |
| 769 } | 770 } |
| 770 | 771 |
| 771 } // namespace | 772 } // namespace |
| 772 | 773 |
| 773 | 774 |
| 774 void InstructionSelector::VisitInt32Mul(Node* node) { | 775 void InstructionSelector::VisitInt32Mul(Node* node) { |
| 775 Int32ScaleMatcher m(node, true); | 776 Int32ScaleMatcher m(node, true); |
| 776 if (m.matches()) { | 777 if (m.matches()) { |
| 777 Node* index = node->InputAt(0); | 778 Node* index = node->InputAt(0); |
| 778 Node* base = m.power_of_two_plus_one() ? index : nullptr; | 779 Node* base = m.power_of_two_plus_one() ? index : nullptr; |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1893 MachineOperatorBuilder::kFloat64RoundTruncate | | 1894 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1894 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1895 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1895 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1896 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1896 } | 1897 } |
| 1897 return flags; | 1898 return flags; |
| 1898 } | 1899 } |
| 1899 | 1900 |
| 1900 } // namespace compiler | 1901 } // namespace compiler |
| 1901 } // namespace internal | 1902 } // namespace internal |
| 1902 } // namespace v8 | 1903 } // namespace v8 |
| OLD | NEW |