| 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 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 addressing_mode = kMode_MRI; | 1684 addressing_mode = kMode_MRI; |
| 1685 } else { | 1685 } else { |
| 1686 inputs[input_count++] = g.UseUniqueRegister(index); | 1686 inputs[input_count++] = g.UseUniqueRegister(index); |
| 1687 addressing_mode = kMode_MR1; | 1687 addressing_mode = kMode_MR1; |
| 1688 } | 1688 } |
| 1689 inputs[input_count++] = g.UseUniqueRegister(value); | 1689 inputs[input_count++] = g.UseUniqueRegister(value); |
| 1690 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1690 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 1691 Emit(code, 0, nullptr, input_count, inputs); | 1691 Emit(code, 0, nullptr, input_count, inputs); |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 void InstructionSelector::VisitCreateInt32x4(Node* node) { |
| 1695 IA32OperandGenerator g(this); |
| 1696 Emit(kIA32Int32x4Create, g.DefineAsRegister(node), g.Use(node->InputAt(0))); |
| 1697 } |
| 1698 |
| 1699 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { |
| 1700 IA32OperandGenerator g(this); |
| 1701 int32_t lane = OpParameter<int32_t>(node); |
| 1702 Emit(kIA32Int32x4ExtractLane, g.DefineAsRegister(node), |
| 1703 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); |
| 1704 } |
| 1705 |
| 1706 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { |
| 1707 IA32OperandGenerator g(this); |
| 1708 int32_t lane = OpParameter<int32_t>(node); |
| 1709 Emit(kIA32Int32x4ReplaceLane, g.DefineSameAsFirst(node), |
| 1710 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), |
| 1711 g.Use(node->InputAt(1))); |
| 1712 } |
| 1713 |
| 1714 void InstructionSelector::VisitInt32x4Add(Node* node) { |
| 1715 IA32OperandGenerator g(this); |
| 1716 Emit(kIA32Int32x4Add, g.DefineSameAsFirst(node), |
| 1717 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
| 1718 } |
| 1719 |
| 1720 void InstructionSelector::VisitInt32x4Sub(Node* node) { |
| 1721 IA32OperandGenerator g(this); |
| 1722 Emit(kIA32Int32x4Sub, g.DefineSameAsFirst(node), |
| 1723 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1))); |
| 1724 } |
| 1725 |
| 1694 // static | 1726 // static |
| 1695 MachineOperatorBuilder::Flags | 1727 MachineOperatorBuilder::Flags |
| 1696 InstructionSelector::SupportedMachineOperatorFlags() { | 1728 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1697 MachineOperatorBuilder::Flags flags = | 1729 MachineOperatorBuilder::Flags flags = |
| 1698 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1730 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 1699 MachineOperatorBuilder::kWord32Ctz; | 1731 MachineOperatorBuilder::kWord32Ctz; |
| 1700 if (CpuFeatures::IsSupported(POPCNT)) { | 1732 if (CpuFeatures::IsSupported(POPCNT)) { |
| 1701 flags |= MachineOperatorBuilder::kWord32Popcnt; | 1733 flags |= MachineOperatorBuilder::kWord32Popcnt; |
| 1702 } | 1734 } |
| 1703 if (CpuFeatures::IsSupported(SSE4_1)) { | 1735 if (CpuFeatures::IsSupported(SSE4_1)) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1716 // static | 1748 // static |
| 1717 MachineOperatorBuilder::AlignmentRequirements | 1749 MachineOperatorBuilder::AlignmentRequirements |
| 1718 InstructionSelector::AlignmentRequirements() { | 1750 InstructionSelector::AlignmentRequirements() { |
| 1719 return MachineOperatorBuilder::AlignmentRequirements:: | 1751 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1720 FullUnalignedAccessSupport(); | 1752 FullUnalignedAccessSupport(); |
| 1721 } | 1753 } |
| 1722 | 1754 |
| 1723 } // namespace compiler | 1755 } // namespace compiler |
| 1724 } // namespace internal | 1756 } // namespace internal |
| 1725 } // namespace v8 | 1757 } // namespace v8 |
| OLD | NEW |