| 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 | 886 |
| 887 #define RRO_FLOAT_OP_LIST(V) \ | 887 #define RRO_FLOAT_OP_LIST(V) \ |
| 888 V(Float32Add, kAVXFloat32Add, kSSEFloat32Add) \ | 888 V(Float32Add, kAVXFloat32Add, kSSEFloat32Add) \ |
| 889 V(Float64Add, kAVXFloat64Add, kSSEFloat64Add) \ | 889 V(Float64Add, kAVXFloat64Add, kSSEFloat64Add) \ |
| 890 V(Float32Sub, kAVXFloat32Sub, kSSEFloat32Sub) \ | 890 V(Float32Sub, kAVXFloat32Sub, kSSEFloat32Sub) \ |
| 891 V(Float64Sub, kAVXFloat64Sub, kSSEFloat64Sub) \ | 891 V(Float64Sub, kAVXFloat64Sub, kSSEFloat64Sub) \ |
| 892 V(Float32Mul, kAVXFloat32Mul, kSSEFloat32Mul) \ | 892 V(Float32Mul, kAVXFloat32Mul, kSSEFloat32Mul) \ |
| 893 V(Float64Mul, kAVXFloat64Mul, kSSEFloat64Mul) \ | 893 V(Float64Mul, kAVXFloat64Mul, kSSEFloat64Mul) \ |
| 894 V(Float32Div, kAVXFloat32Div, kSSEFloat32Div) \ | 894 V(Float32Div, kAVXFloat32Div, kSSEFloat32Div) \ |
| 895 V(Float64Div, kAVXFloat64Div, kSSEFloat64Div) \ | 895 V(Float64Div, kAVXFloat64Div, kSSEFloat64Div) \ |
| 896 V(Int32x4Add, kAVXInt32x4Add, kSSEInt32x4Add) \ | 896 V(I32x4Add, kAVXI32x4Add, kSSEI32x4Add) \ |
| 897 V(Int32x4Sub, kAVXInt32x4Sub, kSSEInt32x4Sub) | 897 V(I32x4Sub, kAVXI32x4Sub, kSSEI32x4Sub) |
| 898 | 898 |
| 899 #define FLOAT_UNOP_LIST(V) \ | 899 #define FLOAT_UNOP_LIST(V) \ |
| 900 V(Float32Abs, kAVXFloat32Abs, kSSEFloat32Abs) \ | 900 V(Float32Abs, kAVXFloat32Abs, kSSEFloat32Abs) \ |
| 901 V(Float64Abs, kAVXFloat64Abs, kSSEFloat64Abs) \ | 901 V(Float64Abs, kAVXFloat64Abs, kSSEFloat64Abs) \ |
| 902 V(Float32Neg, kAVXFloat32Neg, kSSEFloat32Neg) \ | 902 V(Float32Neg, kAVXFloat32Neg, kSSEFloat32Neg) \ |
| 903 V(Float64Neg, kAVXFloat64Neg, kSSEFloat64Neg) | 903 V(Float64Neg, kAVXFloat64Neg, kSSEFloat64Neg) |
| 904 | 904 |
| 905 #define RO_VISITOR(Name, opcode) \ | 905 #define RO_VISITOR(Name, opcode) \ |
| 906 void InstructionSelector::Visit##Name(Node* node) { \ | 906 void InstructionSelector::Visit##Name(Node* node) { \ |
| 907 VisitRO(this, node, opcode); \ | 907 VisitRO(this, node, opcode); \ |
| (...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1812 addressing_mode = kMode_MRI; | 1812 addressing_mode = kMode_MRI; |
| 1813 } else { | 1813 } else { |
| 1814 inputs[input_count++] = g.UseUniqueRegister(index); | 1814 inputs[input_count++] = g.UseUniqueRegister(index); |
| 1815 addressing_mode = kMode_MR1; | 1815 addressing_mode = kMode_MR1; |
| 1816 } | 1816 } |
| 1817 outputs[0] = g.DefineAsFixed(node, eax); | 1817 outputs[0] = g.DefineAsFixed(node, eax); |
| 1818 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1818 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 1819 Emit(code, 1, outputs, input_count, inputs); | 1819 Emit(code, 1, outputs, input_count, inputs); |
| 1820 } | 1820 } |
| 1821 | 1821 |
| 1822 void InstructionSelector::VisitInt32x4Splat(Node* node) { | 1822 void InstructionSelector::VisitI32x4Splat(Node* node) { |
| 1823 VisitRO(this, node, kIA32Int32x4Splat); | 1823 VisitRO(this, node, kIA32I32x4Splat); |
| 1824 } | 1824 } |
| 1825 | 1825 |
| 1826 void InstructionSelector::VisitInt32x4ExtractLane(Node* node) { | 1826 void InstructionSelector::VisitI32x4ExtractLane(Node* node) { |
| 1827 IA32OperandGenerator g(this); | 1827 IA32OperandGenerator g(this); |
| 1828 int32_t lane = OpParameter<int32_t>(node); | 1828 int32_t lane = OpParameter<int32_t>(node); |
| 1829 Emit(kIA32Int32x4ExtractLane, g.DefineAsRegister(node), | 1829 Emit(kIA32I32x4ExtractLane, g.DefineAsRegister(node), |
| 1830 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); | 1830 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane)); |
| 1831 } | 1831 } |
| 1832 | 1832 |
| 1833 void InstructionSelector::VisitInt32x4ReplaceLane(Node* node) { | 1833 void InstructionSelector::VisitI32x4ReplaceLane(Node* node) { |
| 1834 IA32OperandGenerator g(this); | 1834 IA32OperandGenerator g(this); |
| 1835 int32_t lane = OpParameter<int32_t>(node); | 1835 int32_t lane = OpParameter<int32_t>(node); |
| 1836 Emit(kIA32Int32x4ReplaceLane, g.DefineSameAsFirst(node), | 1836 Emit(kIA32I32x4ReplaceLane, g.DefineSameAsFirst(node), |
| 1837 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), | 1837 g.UseRegister(node->InputAt(0)), g.UseImmediate(lane), |
| 1838 g.Use(node->InputAt(1))); | 1838 g.Use(node->InputAt(1))); |
| 1839 } | 1839 } |
| 1840 | 1840 |
| 1841 // static | 1841 // static |
| 1842 MachineOperatorBuilder::Flags | 1842 MachineOperatorBuilder::Flags |
| 1843 InstructionSelector::SupportedMachineOperatorFlags() { | 1843 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1844 MachineOperatorBuilder::Flags flags = | 1844 MachineOperatorBuilder::Flags flags = |
| 1845 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1845 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 1846 MachineOperatorBuilder::kWord32Ctz; | 1846 MachineOperatorBuilder::kWord32Ctz; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1863 // static | 1863 // static |
| 1864 MachineOperatorBuilder::AlignmentRequirements | 1864 MachineOperatorBuilder::AlignmentRequirements |
| 1865 InstructionSelector::AlignmentRequirements() { | 1865 InstructionSelector::AlignmentRequirements() { |
| 1866 return MachineOperatorBuilder::AlignmentRequirements:: | 1866 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1867 FullUnalignedAccessSupport(); | 1867 FullUnalignedAccessSupport(); |
| 1868 } | 1868 } |
| 1869 | 1869 |
| 1870 } // namespace compiler | 1870 } // namespace compiler |
| 1871 } // namespace internal | 1871 } // namespace internal |
| 1872 } // namespace v8 | 1872 } // namespace v8 |
| OLD | NEW |