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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 V(Float64RoundTiesEven, kSSEFloat64Round | MiscField::encode(kRoundToNearest)) | 854 V(Float64RoundTiesEven, kSSEFloat64Round | MiscField::encode(kRoundToNearest)) |
855 | 855 |
856 #define RRO_FLOAT_OP_LIST(V) \ | 856 #define RRO_FLOAT_OP_LIST(V) \ |
857 V(Float32Add, kAVXFloat32Add, kSSEFloat32Add) \ | 857 V(Float32Add, kAVXFloat32Add, kSSEFloat32Add) \ |
858 V(Float64Add, kAVXFloat64Add, kSSEFloat64Add) \ | 858 V(Float64Add, kAVXFloat64Add, kSSEFloat64Add) \ |
859 V(Float32Sub, kAVXFloat32Sub, kSSEFloat32Sub) \ | 859 V(Float32Sub, kAVXFloat32Sub, kSSEFloat32Sub) \ |
860 V(Float64Sub, kAVXFloat64Sub, kSSEFloat64Sub) \ | 860 V(Float64Sub, kAVXFloat64Sub, kSSEFloat64Sub) \ |
861 V(Float32Mul, kAVXFloat32Mul, kSSEFloat32Mul) \ | 861 V(Float32Mul, kAVXFloat32Mul, kSSEFloat32Mul) \ |
862 V(Float64Mul, kAVXFloat64Mul, kSSEFloat64Mul) \ | 862 V(Float64Mul, kAVXFloat64Mul, kSSEFloat64Mul) \ |
863 V(Float32Div, kAVXFloat32Div, kSSEFloat32Div) \ | 863 V(Float32Div, kAVXFloat32Div, kSSEFloat32Div) \ |
864 V(Float64Div, kAVXFloat64Div, kSSEFloat64Div) | 864 V(Float64Div, kAVXFloat64Div, kSSEFloat64Div) \ |
| 865 V(Int32x4Add, kAVXInt32x4Add, kSSEInt32x4Add) \ |
| 866 V(Int32x4Sub, kAVXInt32x4Sub, kSSEInt32x4Sub) |
865 | 867 |
866 #define FLOAT_UNOP_LIST(V) \ | 868 #define FLOAT_UNOP_LIST(V) \ |
867 V(Float32Abs, kAVXFloat32Abs, kSSEFloat32Abs) \ | 869 V(Float32Abs, kAVXFloat32Abs, kSSEFloat32Abs) \ |
868 V(Float64Abs, kAVXFloat64Abs, kSSEFloat64Abs) \ | 870 V(Float64Abs, kAVXFloat64Abs, kSSEFloat64Abs) \ |
869 V(Float32Neg, kAVXFloat32Neg, kSSEFloat32Neg) \ | 871 V(Float32Neg, kAVXFloat32Neg, kSSEFloat32Neg) \ |
870 V(Float64Neg, kAVXFloat64Neg, kSSEFloat64Neg) | 872 V(Float64Neg, kAVXFloat64Neg, kSSEFloat64Neg) |
871 | 873 |
872 #define RO_VISITOR(Name, opcode) \ | 874 #define RO_VISITOR(Name, opcode) \ |
873 void InstructionSelector::Visit##Name(Node* node) { \ | 875 void InstructionSelector::Visit##Name(Node* node) { \ |
874 VisitRO(this, node, opcode); \ | 876 VisitRO(this, node, opcode); \ |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1697 addressing_mode = kMode_MRI; | 1699 addressing_mode = kMode_MRI; |
1698 } else { | 1700 } else { |
1699 inputs[input_count++] = g.UseUniqueRegister(index); | 1701 inputs[input_count++] = g.UseUniqueRegister(index); |
1700 addressing_mode = kMode_MR1; | 1702 addressing_mode = kMode_MR1; |
1701 } | 1703 } |
1702 inputs[input_count++] = g.UseUniqueRegister(value); | 1704 inputs[input_count++] = g.UseUniqueRegister(value); |
1703 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1705 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
1704 Emit(code, 0, nullptr, input_count, inputs); | 1706 Emit(code, 0, nullptr, input_count, inputs); |
1705 } | 1707 } |
1706 | 1708 |
| 1709 void InstructionSelector::VisitCreateInt32x4(Node* node) { |
| 1710 VisitRO(this, node, kIA32Int32x4Create); |
| 1711 } |
| 1712 |
| 1713 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { |
| 1714 IA32OperandGenerator g(this); |
| 1715 int32_t lane = OpParameter<int32_t>(node); |
| 1716 Emit(kIA32Int32x4ExtractLane, g.DefineAsRegister(node), |
| 1717 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); |
| 1718 } |
| 1719 |
| 1720 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { |
| 1721 IA32OperandGenerator g(this); |
| 1722 int32_t lane = OpParameter<int32_t>(node); |
| 1723 Emit(kIA32Int32x4ReplaceLane, g.DefineSameAsFirst(node), |
| 1724 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), |
| 1725 g.Use(node->InputAt(1))); |
| 1726 } |
| 1727 |
1707 // static | 1728 // static |
1708 MachineOperatorBuilder::Flags | 1729 MachineOperatorBuilder::Flags |
1709 InstructionSelector::SupportedMachineOperatorFlags() { | 1730 InstructionSelector::SupportedMachineOperatorFlags() { |
1710 MachineOperatorBuilder::Flags flags = | 1731 MachineOperatorBuilder::Flags flags = |
1711 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1732 MachineOperatorBuilder::kWord32ShiftIsSafe | |
1712 MachineOperatorBuilder::kWord32Ctz; | 1733 MachineOperatorBuilder::kWord32Ctz; |
1713 if (CpuFeatures::IsSupported(POPCNT)) { | 1734 if (CpuFeatures::IsSupported(POPCNT)) { |
1714 flags |= MachineOperatorBuilder::kWord32Popcnt; | 1735 flags |= MachineOperatorBuilder::kWord32Popcnt; |
1715 } | 1736 } |
1716 if (CpuFeatures::IsSupported(SSE4_1)) { | 1737 if (CpuFeatures::IsSupported(SSE4_1)) { |
(...skipping 12 matching lines...) Expand all Loading... |
1729 // static | 1750 // static |
1730 MachineOperatorBuilder::AlignmentRequirements | 1751 MachineOperatorBuilder::AlignmentRequirements |
1731 InstructionSelector::AlignmentRequirements() { | 1752 InstructionSelector::AlignmentRequirements() { |
1732 return MachineOperatorBuilder::AlignmentRequirements:: | 1753 return MachineOperatorBuilder::AlignmentRequirements:: |
1733 FullUnalignedAccessSupport(); | 1754 FullUnalignedAccessSupport(); |
1734 } | 1755 } |
1735 | 1756 |
1736 } // namespace compiler | 1757 } // namespace compiler |
1737 } // namespace internal | 1758 } // namespace internal |
1738 } // namespace v8 | 1759 } // namespace v8 |
OLD | NEW |