Index: src/compiler/arm/instruction-selector-arm.cc |
diff --git a/src/compiler/arm/instruction-selector-arm.cc b/src/compiler/arm/instruction-selector-arm.cc |
index 9b593a771935c7a84757b03eec04ee7f48f841b3..b2b1a7049d1e5bb2fc7237f3316dd648d5260352 100644 |
--- a/src/compiler/arm/instruction-selector-arm.cc |
+++ b/src/compiler/arm/instruction-selector-arm.cc |
@@ -1205,6 +1205,35 @@ void InstructionSelector::VisitFloat64Add(Node* node) { |
VisitRRR(this, kArmVaddF64, node); |
} |
+namespace { |
+void VisitFloat32SubHelper(InstructionSelector* selector, Node* node) { |
+ ArmOperandGenerator g(selector); |
+ Float32BinopMatcher m(node); |
+ if (m.right().IsFloat32Mul() && selector->CanCover(node, m.right().node())) { |
+ Float32BinopMatcher mright(m.right().node()); |
+ selector->Emit(kArmVmlsF32, g.DefineSameAsFirst(node), |
+ g.UseRegister(m.left().node()), |
+ g.UseRegister(mright.left().node()), |
+ g.UseRegister(mright.right().node())); |
+ return; |
+ } |
+ VisitRRR(selector, kArmVsubF32, node); |
+} |
+ |
+void VisitFloat64SubHelper(InstructionSelector* selector, Node* node) { |
+ ArmOperandGenerator g(selector); |
+ Float64BinopMatcher m(node); |
+ if (m.right().IsFloat64Mul() && selector->CanCover(node, m.right().node())) { |
+ Float64BinopMatcher mright(m.right().node()); |
+ selector->Emit(kArmVmlsF64, g.DefineSameAsFirst(node), |
+ g.UseRegister(m.left().node()), |
+ g.UseRegister(mright.left().node()), |
+ g.UseRegister(mright.right().node())); |
+ return; |
+ } |
+ VisitRRR(selector, kArmVsubF64, node); |
+} |
+} // namespace |
void InstructionSelector::VisitFloat32Sub(Node* node) { |
ArmOperandGenerator g(this); |
@@ -1214,16 +1243,12 @@ void InstructionSelector::VisitFloat32Sub(Node* node) { |
g.UseRegister(m.right().node())); |
return; |
} |
- if (m.right().IsFloat32Mul() && CanCover(node, m.right().node())) { |
- Float32BinopMatcher mright(m.right().node()); |
- Emit(kArmVmlsF32, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()), |
- g.UseRegister(mright.left().node()), |
- g.UseRegister(mright.right().node())); |
- return; |
- } |
- VisitRRR(this, kArmVsubF32, node); |
+ VisitFloat32SubHelper(this, node); |
} |
+void InstructionSelector::VisitFloat32SubPreserveNan(Node* node) { |
+ VisitFloat32SubHelper(this, node); |
+} |
void InstructionSelector::VisitFloat64Sub(Node* node) { |
ArmOperandGenerator g(this); |
@@ -1245,16 +1270,12 @@ void InstructionSelector::VisitFloat64Sub(Node* node) { |
g.UseRegister(m.right().node())); |
return; |
} |
- if (m.right().IsFloat64Mul() && CanCover(node, m.right().node())) { |
- Float64BinopMatcher mright(m.right().node()); |
- Emit(kArmVmlsF64, g.DefineSameAsFirst(node), g.UseRegister(m.left().node()), |
- g.UseRegister(mright.left().node()), |
- g.UseRegister(mright.right().node())); |
- return; |
- } |
- VisitRRR(this, kArmVsubF64, node); |
+ VisitFloat64SubHelper(this, node); |
} |
+void InstructionSelector::VisitFloat64SubPreserveNan(Node* node) { |
+ VisitFloat64SubHelper(this, node); |
+} |
void InstructionSelector::VisitFloat32Mul(Node* node) { |
VisitRRR(this, kArmVmulF32, node); |