Index: src/compiler/mips/instruction-selector-mips.cc |
diff --git a/src/compiler/mips/instruction-selector-mips.cc b/src/compiler/mips/instruction-selector-mips.cc |
index f3fafaab4104fe502c33b50c4ec2e4866974c875..e389a6b483e0fe097941f1feac76d488649a686a 100644 |
--- a/src/compiler/mips/instruction-selector-mips.cc |
+++ b/src/compiler/mips/instruction-selector-mips.cc |
@@ -799,10 +799,14 @@ static void VisitCompare(InstructionSelector* selector, InstructionCode opcode, |
void VisitFloat32Compare(InstructionSelector* selector, Node* node, |
FlagsContinuation* cont) { |
MipsOperandGenerator g(selector); |
- Node* left = node->InputAt(0); |
- Node* right = node->InputAt(1); |
- VisitCompare(selector, kMipsCmpS, g.UseRegister(left), g.UseRegister(right), |
- cont); |
+ Float32BinopMatcher m(node); |
+ InstructionOperand lhs, rhs; |
+ |
+ lhs = m.left().IsZero() ? g.UseImmediate(m.left().node()) |
+ : g.UseRegister(m.left().node()); |
+ rhs = m.right().IsZero() ? g.UseImmediate(m.right().node()) |
+ : g.UseRegister(m.right().node()); |
+ VisitCompare(selector, kMipsCmpS, lhs, rhs, cont); |
} |
@@ -810,10 +814,14 @@ void VisitFloat32Compare(InstructionSelector* selector, Node* node, |
void VisitFloat64Compare(InstructionSelector* selector, Node* node, |
FlagsContinuation* cont) { |
MipsOperandGenerator g(selector); |
- Node* left = node->InputAt(0); |
- Node* right = node->InputAt(1); |
- VisitCompare(selector, kMipsCmpD, g.UseRegister(left), g.UseRegister(right), |
- cont); |
+ Float64BinopMatcher m(node); |
+ InstructionOperand lhs, rhs; |
+ |
+ lhs = m.left().IsZero() ? g.UseImmediate(m.left().node()) |
+ : g.UseRegister(m.left().node()); |
+ rhs = m.right().IsZero() ? g.UseImmediate(m.right().node()) |
+ : g.UseRegister(m.right().node()); |
+ VisitCompare(selector, kMipsCmpD, lhs, rhs, cont); |
} |