| 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/base/bits.h" | 6 #include "src/base/bits.h" |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
| 10 | 10 |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1153 void InstructionSelector::VisitFloat64Add(Node* node) { | 1153 void InstructionSelector::VisitFloat64Add(Node* node) { |
| 1154 VisitRRR(this, kMips64AddD, node); | 1154 VisitRRR(this, kMips64AddD, node); |
| 1155 } | 1155 } |
| 1156 | 1156 |
| 1157 | 1157 |
| 1158 void InstructionSelector::VisitFloat32Sub(Node* node) { | 1158 void InstructionSelector::VisitFloat32Sub(Node* node) { |
| 1159 VisitRRR(this, kMips64SubS, node); | 1159 VisitRRR(this, kMips64SubS, node); |
| 1160 } | 1160 } |
| 1161 | 1161 |
| 1162 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { | 1162 void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { |
| 1163 VisitRRR(this, kMips64SubS, node); | 1163 Mips64OperandGenerator g(this); |
| 1164 Emit(kMips64SubPreserveNanS, g.DefineAsRegister(node), |
| 1165 g.UseUniqueRegister(node->InputAt(0)), |
| 1166 g.UseUniqueRegister(node->InputAt(1))); |
| 1164 } | 1167 } |
| 1165 | 1168 |
| 1166 void InstructionSelector::VisitFloat64Sub(Node* node) { | 1169 void InstructionSelector::VisitFloat64Sub(Node* node) { |
| 1167 Mips64OperandGenerator g(this); | 1170 Mips64OperandGenerator g(this); |
| 1168 Float64BinopMatcher m(node); | 1171 Float64BinopMatcher m(node); |
| 1169 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && | 1172 if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && |
| 1170 CanCover(m.node(), m.right().node())) { | 1173 CanCover(m.node(), m.right().node())) { |
| 1171 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && | 1174 if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
| 1172 CanCover(m.right().node(), m.right().InputAt(0))) { | 1175 CanCover(m.right().node(), m.right().InputAt(0))) { |
| 1173 Float64BinopMatcher mright0(m.right().InputAt(0)); | 1176 Float64BinopMatcher mright0(m.right().InputAt(0)); |
| 1174 if (mright0.left().IsMinusZero()) { | 1177 if (mright0.left().IsMinusZero()) { |
| 1175 Emit(kMips64Float64RoundUp, g.DefineAsRegister(node), | 1178 Emit(kMips64Float64RoundUp, g.DefineAsRegister(node), |
| 1176 g.UseRegister(mright0.right().node())); | 1179 g.UseRegister(mright0.right().node())); |
| 1177 return; | 1180 return; |
| 1178 } | 1181 } |
| 1179 } | 1182 } |
| 1180 } | 1183 } |
| 1181 VisitRRR(this, kMips64SubD, node); | 1184 VisitRRR(this, kMips64SubD, node); |
| 1182 } | 1185 } |
| 1183 | 1186 |
| 1184 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { | 1187 void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { |
| 1185 VisitRRR(this, kMips64SubD, node); | 1188 Mips64OperandGenerator g(this); |
| 1189 Emit(kMips64SubPreserveNanD, g.DefineAsRegister(node), |
| 1190 g.UseUniqueRegister(node->InputAt(0)), |
| 1191 g.UseUniqueRegister(node->InputAt(1))); |
| 1186 } | 1192 } |
| 1187 | 1193 |
| 1188 void InstructionSelector::VisitFloat32Mul(Node* node) { | 1194 void InstructionSelector::VisitFloat32Mul(Node* node) { |
| 1189 VisitRRR(this, kMips64MulS, node); | 1195 VisitRRR(this, kMips64MulS, node); |
| 1190 } | 1196 } |
| 1191 | 1197 |
| 1192 | 1198 |
| 1193 void InstructionSelector::VisitFloat64Mul(Node* node) { | 1199 void InstructionSelector::VisitFloat64Mul(Node* node) { |
| 1194 VisitRRR(this, kMips64MulD, node); | 1200 VisitRRR(this, kMips64MulD, node); |
| 1195 } | 1201 } |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2069 } else { | 2075 } else { |
| 2070 DCHECK(kArchVariant == kMips64r2); | 2076 DCHECK(kArchVariant == kMips64r2); |
| 2071 return MachineOperatorBuilder::AlignmentRequirements:: | 2077 return MachineOperatorBuilder::AlignmentRequirements:: |
| 2072 NoUnalignedAccessSupport(); | 2078 NoUnalignedAccessSupport(); |
| 2073 } | 2079 } |
| 2074 } | 2080 } |
| 2075 | 2081 |
| 2076 } // namespace compiler | 2082 } // namespace compiler |
| 2077 } // namespace internal | 2083 } // namespace internal |
| 2078 } // namespace v8 | 2084 } // namespace v8 |
| OLD | NEW |