| 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 g.UseFixed(node, stX_0), g.Use(node->InputAt(0))); | 1076 g.UseFixed(node, stX_0), g.Use(node->InputAt(0))); |
| 1077 } | 1077 } |
| 1078 | 1078 |
| 1079 | 1079 |
| 1080 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { | 1080 void InstructionSelector::VisitFloat64RoundTiesEven(Node* node) { |
| 1081 X87OperandGenerator g(this); | 1081 X87OperandGenerator g(this); |
| 1082 Emit(kX87Float64Round | MiscField::encode(kRoundToNearest), | 1082 Emit(kX87Float64Round | MiscField::encode(kRoundToNearest), |
| 1083 g.UseFixed(node, stX_0), g.Use(node->InputAt(0))); | 1083 g.UseFixed(node, stX_0), g.Use(node->InputAt(0))); |
| 1084 } | 1084 } |
| 1085 | 1085 |
| 1086 void InstructionSelector::VisitFloat32Neg(Node* node) { UNREACHABLE(); } | 1086 void InstructionSelector::VisitFloat32Neg(Node* node) { |
| 1087 X87OperandGenerator g(this); |
| 1088 Emit(kX87PushFloat32, g.NoOutput(), g.Use(node->InputAt(0))); |
| 1089 Emit(kX87Float32Neg, g.DefineAsFixed(node, stX_0), 0, nullptr); |
| 1090 } |
| 1087 | 1091 |
| 1088 void InstructionSelector::VisitFloat64Neg(Node* node) { UNREACHABLE(); } | 1092 void InstructionSelector::VisitFloat64Neg(Node* node) { |
| 1093 X87OperandGenerator g(this); |
| 1094 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
| 1095 Emit(kX87Float64Neg, g.DefineAsFixed(node, stX_0), 0, nullptr); |
| 1096 } |
| 1089 | 1097 |
| 1090 void InstructionSelector::VisitFloat64Ieee754Binop(Node* node, | 1098 void InstructionSelector::VisitFloat64Ieee754Binop(Node* node, |
| 1091 InstructionCode opcode) { | 1099 InstructionCode opcode) { |
| 1092 X87OperandGenerator g(this); | 1100 X87OperandGenerator g(this); |
| 1093 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); | 1101 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(0))); |
| 1094 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); | 1102 Emit(kX87PushFloat64, g.NoOutput(), g.Use(node->InputAt(1))); |
| 1095 Emit(opcode, g.DefineAsFixed(node, stX_0), 0, nullptr)->MarkAsCall(); | 1103 Emit(opcode, g.DefineAsFixed(node, stX_0), 0, nullptr)->MarkAsCall(); |
| 1096 } | 1104 } |
| 1097 | 1105 |
| 1098 void InstructionSelector::VisitFloat64Ieee754Unop(Node* node, | 1106 void InstructionSelector::VisitFloat64Ieee754Unop(Node* node, |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1708 } | 1716 } |
| 1709 inputs[input_count++] = g.UseUniqueRegister(value); | 1717 inputs[input_count++] = g.UseUniqueRegister(value); |
| 1710 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1718 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 1711 Emit(code, 0, nullptr, input_count, inputs); | 1719 Emit(code, 0, nullptr, input_count, inputs); |
| 1712 } | 1720 } |
| 1713 | 1721 |
| 1714 // static | 1722 // static |
| 1715 MachineOperatorBuilder::Flags | 1723 MachineOperatorBuilder::Flags |
| 1716 InstructionSelector::SupportedMachineOperatorFlags() { | 1724 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1717 MachineOperatorBuilder::Flags flags = | 1725 MachineOperatorBuilder::Flags flags = |
| 1718 MachineOperatorBuilder::kWord32ShiftIsSafe; | 1726 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 1727 MachineOperatorBuilder::kFloat32Neg | MachineOperatorBuilder::kFloat64Neg; |
| 1719 if (CpuFeatures::IsSupported(POPCNT)) { | 1728 if (CpuFeatures::IsSupported(POPCNT)) { |
| 1720 flags |= MachineOperatorBuilder::kWord32Popcnt; | 1729 flags |= MachineOperatorBuilder::kWord32Popcnt; |
| 1721 } | 1730 } |
| 1722 | 1731 |
| 1723 flags |= MachineOperatorBuilder::kFloat32RoundDown | | 1732 flags |= MachineOperatorBuilder::kFloat32RoundDown | |
| 1724 MachineOperatorBuilder::kFloat64RoundDown | | 1733 MachineOperatorBuilder::kFloat64RoundDown | |
| 1725 MachineOperatorBuilder::kFloat32RoundUp | | 1734 MachineOperatorBuilder::kFloat32RoundUp | |
| 1726 MachineOperatorBuilder::kFloat64RoundUp | | 1735 MachineOperatorBuilder::kFloat64RoundUp | |
| 1727 MachineOperatorBuilder::kFloat32RoundTruncate | | 1736 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 1728 MachineOperatorBuilder::kFloat64RoundTruncate | | 1737 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1729 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1738 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1730 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1739 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1731 return flags; | 1740 return flags; |
| 1732 } | 1741 } |
| 1733 | 1742 |
| 1734 // static | 1743 // static |
| 1735 MachineOperatorBuilder::AlignmentRequirements | 1744 MachineOperatorBuilder::AlignmentRequirements |
| 1736 InstructionSelector::AlignmentRequirements() { | 1745 InstructionSelector::AlignmentRequirements() { |
| 1737 return MachineOperatorBuilder::AlignmentRequirements:: | 1746 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1738 FullUnalignedAccessSupport(); | 1747 FullUnalignedAccessSupport(); |
| 1739 } | 1748 } |
| 1740 | 1749 |
| 1741 } // namespace compiler | 1750 } // namespace compiler |
| 1742 } // namespace internal | 1751 } // namespace internal |
| 1743 } // namespace v8 | 1752 } // namespace v8 |
| OLD | NEW |