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 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add); | 922 VisitRROFloat(this, node, kAVXFloat32Add, kSSEFloat32Add); |
923 } | 923 } |
924 | 924 |
925 | 925 |
926 void InstructionSelector::VisitFloat64Add(Node* node) { | 926 void InstructionSelector::VisitFloat64Add(Node* node) { |
927 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add); | 927 VisitRROFloat(this, node, kAVXFloat64Add, kSSEFloat64Add); |
928 } | 928 } |
929 | 929 |
930 | 930 |
931 void InstructionSelector::VisitFloat32Sub(Node* node) { | 931 void InstructionSelector::VisitFloat32Sub(Node* node) { |
932 IA32OperandGenerator g(this); | |
933 Float32BinopMatcher m(node); | |
934 if (m.left().IsMinusZero()) { | |
935 VisitFloatUnop(this, node, m.right().node(), kAVXFloat32Neg, | |
936 kSSEFloat32Neg); | |
937 return; | |
938 } | |
939 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); | |
940 } | |
941 | |
942 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { | |
943 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); | 932 VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); |
944 } | 933 } |
945 | 934 |
946 void InstructionSelector::VisitFloat64Sub(Node* node) { | 935 void InstructionSelector::VisitFloat64Sub(Node* node) { |
947 IA32OperandGenerator g(this); | |
948 Float64BinopMatcher m(node); | |
949 if (m.left().IsMinusZero()) { | |
950 if (m.right().IsFloat64RoundDown() && | |
951 CanCover(m.node(), m.right().node())) { | |
952 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && | |
953 CanCover(m.right().node(), m.right().InputAt(0))) { | |
954 Float64BinopMatcher mright0(m.right().InputAt(0)); | |
955 if (mright0.left().IsMinusZero()) { | |
956 Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), | |
957 g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); | |
958 return; | |
959 } | |
960 } | |
961 } | |
962 VisitFloatUnop(this, node, m.right().node(), kAVXFloat64Neg, | |
963 kSSEFloat64Neg); | |
964 return; | |
965 } | |
966 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); | 936 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); |
967 } | 937 } |
968 | 938 |
969 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { | |
970 VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); | |
971 } | |
972 | |
973 void InstructionSelector::VisitFloat32Mul(Node* node) { | 939 void InstructionSelector::VisitFloat32Mul(Node* node) { |
974 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul); | 940 VisitRROFloat(this, node, kAVXFloat32Mul, kSSEFloat32Mul); |
975 } | 941 } |
976 | 942 |
977 | 943 |
978 void InstructionSelector::VisitFloat64Mul(Node* node) { | 944 void InstructionSelector::VisitFloat64Mul(Node* node) { |
979 VisitRROFloat(this, node, kAVXFloat64Mul, kSSEFloat64Mul); | 945 VisitRROFloat(this, node, kAVXFloat64Mul, kSSEFloat64Mul); |
980 } | 946 } |
981 | 947 |
982 | 948 |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 // static | 1691 // static |
1726 MachineOperatorBuilder::AlignmentRequirements | 1692 MachineOperatorBuilder::AlignmentRequirements |
1727 InstructionSelector::AlignmentRequirements() { | 1693 InstructionSelector::AlignmentRequirements() { |
1728 return MachineOperatorBuilder::AlignmentRequirements:: | 1694 return MachineOperatorBuilder::AlignmentRequirements:: |
1729 FullUnalignedAccessSupport(); | 1695 FullUnalignedAccessSupport(); |
1730 } | 1696 } |
1731 | 1697 |
1732 } // namespace compiler | 1698 } // namespace compiler |
1733 } // namespace internal | 1699 } // namespace internal |
1734 } // namespace v8 | 1700 } // namespace v8 |
OLD | NEW |