| 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 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 | 984 |
| 985 void InstructionSelector::VisitFloat64Mod(Node* node) { | 985 void InstructionSelector::VisitFloat64Mod(Node* node) { |
| 986 IA32OperandGenerator g(this); | 986 IA32OperandGenerator g(this); |
| 987 InstructionOperand temps[] = {g.TempRegister(eax)}; | 987 InstructionOperand temps[] = {g.TempRegister(eax)}; |
| 988 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), | 988 Emit(kSSEFloat64Mod, g.DefineSameAsFirst(node), |
| 989 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, | 989 g.UseRegister(node->InputAt(0)), g.UseRegister(node->InputAt(1)), 1, |
| 990 temps); | 990 temps); |
| 991 } | 991 } |
| 992 | 992 |
| 993 | 993 |
| 994 void InstructionSelector::VisitFloat32Max(Node* node) { | |
| 995 VisitRROFloat(this, node, kAVXFloat32Max, kSSEFloat32Max); | |
| 996 } | |
| 997 | |
| 998 | |
| 999 void InstructionSelector::VisitFloat64Max(Node* node) { | 994 void InstructionSelector::VisitFloat64Max(Node* node) { |
| 1000 VisitRROFloat(this, node, kAVXFloat64Max, kSSEFloat64Max); | 995 IA32OperandGenerator g(this); |
| 1001 } | 996 InstructionOperand temps[] = {g.TempRegister()}; |
| 1002 | 997 Emit(kSSEFloat64Max, g.DefineSameAsFirst(node), |
| 1003 | 998 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)), |
| 1004 void InstructionSelector::VisitFloat32Min(Node* node) { | 999 arraysize(temps), temps); |
| 1005 VisitRROFloat(this, node, kAVXFloat32Min, kSSEFloat32Min); | |
| 1006 } | 1000 } |
| 1007 | 1001 |
| 1008 | 1002 |
| 1009 void InstructionSelector::VisitFloat64Min(Node* node) { | 1003 void InstructionSelector::VisitFloat64Min(Node* node) { |
| 1010 VisitRROFloat(this, node, kAVXFloat64Min, kSSEFloat64Min); | 1004 IA32OperandGenerator g(this); |
| 1005 InstructionOperand temps[] = {g.TempRegister()}; |
| 1006 Emit(kSSEFloat64Min, g.DefineSameAsFirst(node), |
| 1007 g.UseRegister(node->InputAt(0)), g.Use(node->InputAt(1)), |
| 1008 arraysize(temps), temps); |
| 1011 } | 1009 } |
| 1012 | 1010 |
| 1013 | 1011 |
| 1014 void InstructionSelector::VisitFloat32Abs(Node* node) { | 1012 void InstructionSelector::VisitFloat32Abs(Node* node) { |
| 1015 IA32OperandGenerator g(this); | 1013 IA32OperandGenerator g(this); |
| 1016 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Abs, kSSEFloat32Abs); | 1014 VisitFloatUnop(this, node, node->InputAt(0), kAVXFloat32Abs, kSSEFloat32Abs); |
| 1017 } | 1015 } |
| 1018 | 1016 |
| 1019 | 1017 |
| 1020 void InstructionSelector::VisitFloat64Abs(Node* node) { | 1018 void InstructionSelector::VisitFloat64Abs(Node* node) { |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1669 } | 1667 } |
| 1670 inputs[input_count++] = g.UseUniqueRegister(value); | 1668 inputs[input_count++] = g.UseUniqueRegister(value); |
| 1671 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); | 1669 InstructionCode code = opcode | AddressingModeField::encode(addressing_mode); |
| 1672 Emit(code, 0, nullptr, input_count, inputs); | 1670 Emit(code, 0, nullptr, input_count, inputs); |
| 1673 } | 1671 } |
| 1674 | 1672 |
| 1675 // static | 1673 // static |
| 1676 MachineOperatorBuilder::Flags | 1674 MachineOperatorBuilder::Flags |
| 1677 InstructionSelector::SupportedMachineOperatorFlags() { | 1675 InstructionSelector::SupportedMachineOperatorFlags() { |
| 1678 MachineOperatorBuilder::Flags flags = | 1676 MachineOperatorBuilder::Flags flags = |
| 1679 MachineOperatorBuilder::kFloat32Max | | |
| 1680 MachineOperatorBuilder::kFloat32Min | | |
| 1681 MachineOperatorBuilder::kFloat64Max | | |
| 1682 MachineOperatorBuilder::kFloat64Min | | |
| 1683 MachineOperatorBuilder::kWord32ShiftIsSafe | | 1677 MachineOperatorBuilder::kWord32ShiftIsSafe | |
| 1684 MachineOperatorBuilder::kWord32Ctz; | 1678 MachineOperatorBuilder::kWord32Ctz; |
| 1685 if (CpuFeatures::IsSupported(POPCNT)) { | 1679 if (CpuFeatures::IsSupported(POPCNT)) { |
| 1686 flags |= MachineOperatorBuilder::kWord32Popcnt; | 1680 flags |= MachineOperatorBuilder::kWord32Popcnt; |
| 1687 } | 1681 } |
| 1688 if (CpuFeatures::IsSupported(SSE4_1)) { | 1682 if (CpuFeatures::IsSupported(SSE4_1)) { |
| 1689 flags |= MachineOperatorBuilder::kFloat32RoundDown | | 1683 flags |= MachineOperatorBuilder::kFloat32RoundDown | |
| 1690 MachineOperatorBuilder::kFloat64RoundDown | | 1684 MachineOperatorBuilder::kFloat64RoundDown | |
| 1691 MachineOperatorBuilder::kFloat32RoundUp | | 1685 MachineOperatorBuilder::kFloat32RoundUp | |
| 1692 MachineOperatorBuilder::kFloat64RoundUp | | 1686 MachineOperatorBuilder::kFloat64RoundUp | |
| 1693 MachineOperatorBuilder::kFloat32RoundTruncate | | 1687 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 1694 MachineOperatorBuilder::kFloat64RoundTruncate | | 1688 MachineOperatorBuilder::kFloat64RoundTruncate | |
| 1695 MachineOperatorBuilder::kFloat32RoundTiesEven | | 1689 MachineOperatorBuilder::kFloat32RoundTiesEven | |
| 1696 MachineOperatorBuilder::kFloat64RoundTiesEven; | 1690 MachineOperatorBuilder::kFloat64RoundTiesEven; |
| 1697 } | 1691 } |
| 1698 return flags; | 1692 return flags; |
| 1699 } | 1693 } |
| 1700 | 1694 |
| 1701 // static | 1695 // static |
| 1702 MachineOperatorBuilder::AlignmentRequirements | 1696 MachineOperatorBuilder::AlignmentRequirements |
| 1703 InstructionSelector::AlignmentRequirements() { | 1697 InstructionSelector::AlignmentRequirements() { |
| 1704 return MachineOperatorBuilder::AlignmentRequirements:: | 1698 return MachineOperatorBuilder::AlignmentRequirements:: |
| 1705 FullUnalignedAccessSupport(); | 1699 FullUnalignedAccessSupport(); |
| 1706 } | 1700 } |
| 1707 | 1701 |
| 1708 } // namespace compiler | 1702 } // namespace compiler |
| 1709 } // namespace internal | 1703 } // namespace internal |
| 1710 } // namespace v8 | 1704 } // namespace v8 |
| OLD | NEW |