OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #include "src/s390/frames-s390.h" | 9 #include "src/s390/frames-s390.h" |
10 | 10 |
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1125 void InstructionSelector::VisitFloat32Add(Node* node) { | 1125 void InstructionSelector::VisitFloat32Add(Node* node) { |
1126 VisitRRR(this, kS390_AddFloat, node); | 1126 VisitRRR(this, kS390_AddFloat, node); |
1127 } | 1127 } |
1128 | 1128 |
1129 void InstructionSelector::VisitFloat64Add(Node* node) { | 1129 void InstructionSelector::VisitFloat64Add(Node* node) { |
1130 // TODO(mbrandy): detect multiply-add | 1130 // TODO(mbrandy): detect multiply-add |
1131 VisitRRR(this, kS390_AddDouble, node); | 1131 VisitRRR(this, kS390_AddDouble, node); |
1132 } | 1132 } |
1133 | 1133 |
1134 void InstructionSelector::VisitFloat32Sub(Node* node) { | 1134 void InstructionSelector::VisitFloat32Sub(Node* node) { |
1135 S390OperandGenerator g(this); | |
1136 Float32BinopMatcher m(node); | |
1137 if (m.left().IsMinusZero()) { | |
1138 Emit(kS390_NegDouble, g.DefineAsRegister(node), | |
1139 g.UseRegister(m.right().node())); | |
1140 return; | |
1141 } | |
1142 VisitRRR(this, kS390_SubFloat, node); | |
1143 } | |
1144 | |
1145 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { | |
1146 S390OperandGenerator g(this); | |
1147 VisitRRR(this, kS390_SubFloat, node); | 1135 VisitRRR(this, kS390_SubFloat, node); |
1148 } | 1136 } |
1149 | 1137 |
1150 void InstructionSelector::VisitFloat64Sub(Node* node) { | 1138 void InstructionSelector::VisitFloat64Sub(Node* node) { |
1151 // TODO(mbrandy): detect multiply-subtract | 1139 // TODO(mbrandy): detect multiply-subtract |
1152 S390OperandGenerator g(this); | |
1153 Float64BinopMatcher m(node); | |
1154 if (m.left().IsMinusZero()) { | |
1155 if (m.right().IsFloat64RoundDown() && | |
1156 CanCover(m.node(), m.right().node())) { | |
1157 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && | |
1158 CanCover(m.right().node(), m.right().InputAt(0))) { | |
1159 Float64BinopMatcher mright0(m.right().InputAt(0)); | |
1160 if (mright0.left().IsMinusZero()) { | |
1161 // -floor(-x) = ceil(x) | |
1162 Emit(kS390_CeilDouble, g.DefineAsRegister(node), | |
1163 g.UseRegister(mright0.right().node())); | |
1164 return; | |
1165 } | |
1166 } | |
1167 } | |
1168 Emit(kS390_NegDouble, g.DefineAsRegister(node), | |
1169 g.UseRegister(m.right().node())); | |
1170 return; | |
1171 } | |
1172 VisitRRR(this, kS390_SubDouble, node); | 1140 VisitRRR(this, kS390_SubDouble, node); |
1173 } | 1141 } |
1174 | 1142 |
1175 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { | |
1176 VisitRRR(this, kS390_SubDouble, node); | |
1177 } | |
1178 | |
1179 void InstructionSelector::VisitFloat32Mul(Node* node) { | 1143 void InstructionSelector::VisitFloat32Mul(Node* node) { |
1180 VisitRRR(this, kS390_MulFloat, node); | 1144 VisitRRR(this, kS390_MulFloat, node); |
1181 } | 1145 } |
1182 | 1146 |
1183 void InstructionSelector::VisitFloat64Mul(Node* node) { | 1147 void InstructionSelector::VisitFloat64Mul(Node* node) { |
1184 // TODO(mbrandy): detect negate | 1148 // TODO(mbrandy): detect negate |
1185 VisitRRR(this, kS390_MulDouble, node); | 1149 VisitRRR(this, kS390_MulDouble, node); |
1186 } | 1150 } |
1187 | 1151 |
1188 void InstructionSelector::VisitFloat32Div(Node* node) { | 1152 void InstructionSelector::VisitFloat32Div(Node* node) { |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1890 // static | 1854 // static |
1891 MachineOperatorBuilder::AlignmentRequirements | 1855 MachineOperatorBuilder::AlignmentRequirements |
1892 InstructionSelector::AlignmentRequirements() { | 1856 InstructionSelector::AlignmentRequirements() { |
1893 return MachineOperatorBuilder::AlignmentRequirements:: | 1857 return MachineOperatorBuilder::AlignmentRequirements:: |
1894 FullUnalignedAccessSupport(); | 1858 FullUnalignedAccessSupport(); |
1895 } | 1859 } |
1896 | 1860 |
1897 } // namespace compiler | 1861 } // namespace compiler |
1898 } // namespace internal | 1862 } // namespace internal |
1899 } // namespace v8 | 1863 } // namespace v8 |
OLD | NEW |