Index: src/compiler/ia32/instruction-selector-ia32.cc |
diff --git a/src/compiler/ia32/instruction-selector-ia32.cc b/src/compiler/ia32/instruction-selector-ia32.cc |
index 7b22fff5d446525b8d9887e48cdfa3ec4a8c5bd7..8c5c192a79c4750f62e82af78d439b8527a8608c 100644 |
--- a/src/compiler/ia32/instruction-selector-ia32.cc |
+++ b/src/compiler/ia32/instruction-selector-ia32.cc |
@@ -675,6 +675,13 @@ void InstructionSelector::VisitFloat64Add(Node* node) { |
void InstructionSelector::VisitFloat32Sub(Node* node) { |
+ IA32OperandGenerator g(this); |
+ Float32BinopMatcher m(node); |
+ if (m.left().IsMinusZero()) { |
+ Emit(kSSEFloat32Neg, g.DefineSameAsFirst(node), |
+ g.UseRegister(m.right().node())); |
+ return; |
+ } |
VisitRROFloat(this, node, kAVXFloat32Sub, kSSEFloat32Sub); |
} |
@@ -682,17 +689,22 @@ void InstructionSelector::VisitFloat32Sub(Node* node) { |
void InstructionSelector::VisitFloat64Sub(Node* node) { |
IA32OperandGenerator g(this); |
Float64BinopMatcher m(node); |
- if (m.left().IsMinusZero() && m.right().IsFloat64RoundDown() && |
- CanCover(m.node(), m.right().node())) { |
- if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
- CanCover(m.right().node(), m.right().InputAt(0))) { |
- Float64BinopMatcher mright0(m.right().InputAt(0)); |
- if (mright0.left().IsMinusZero()) { |
- Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), |
- g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); |
- return; |
+ if (m.left().IsMinusZero()) { |
+ if (m.right().IsFloat64RoundDown() && |
+ CanCover(m.node(), m.right().node())) { |
+ if (m.right().InputAt(0)->opcode() == IrOpcode::kFloat64Sub && |
+ CanCover(m.right().node(), m.right().InputAt(0))) { |
+ Float64BinopMatcher mright0(m.right().InputAt(0)); |
+ if (mright0.left().IsMinusZero()) { |
+ Emit(kSSEFloat64Round | MiscField::encode(kRoundUp), |
+ g.DefineAsRegister(node), g.UseRegister(mright0.right().node())); |
+ return; |
+ } |
} |
} |
+ Emit(kSSEFloat64Neg, g.DefineSameAsFirst(node), |
+ g.UseRegister(m.right().node())); |
+ return; |
} |
VisitRROFloat(this, node, kAVXFloat64Sub, kSSEFloat64Sub); |
} |