Index: src/compiler/mips64/instruction-selector-mips64.cc |
diff --git a/src/compiler/mips64/instruction-selector-mips64.cc b/src/compiler/mips64/instruction-selector-mips64.cc |
index 838b263d687e86f636e25e1a03d49f3d7af69325..9c0473f309193a8d68f7c85d6a0d9a28dd4737b7 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -967,12 +967,32 @@ void VisitWordCompare(InstructionSelector* selector, Node* node, |
// Match immediates on left or right side of comparison. |
if (g.CanBeImmediate(right, opcode)) { |
- VisitCompare(selector, opcode, g.UseRegister(left), g.UseImmediate(right), |
- cont); |
+ switch (cont->condition()) { |
+ case kSignedLessThan: |
+ case kSignedGreaterThanOrEqual: |
+ case kUnsignedLessThan: |
+ case kUnsignedGreaterThanOrEqual: |
+ VisitCompare(selector, opcode, g.UseRegister(left), |
+ g.UseImmediate(right), cont); |
+ break; |
+ default: |
+ VisitCompare(selector, opcode, g.UseRegister(left), |
+ g.UseRegister(right), cont); |
+ } |
} else if (g.CanBeImmediate(left, opcode)) { |
if (!commutative) cont->Commute(); |
- VisitCompare(selector, opcode, g.UseRegister(right), g.UseImmediate(left), |
- cont); |
+ switch (cont->condition()) { |
+ case kSignedLessThan: |
+ case kSignedGreaterThanOrEqual: |
+ case kUnsignedLessThan: |
+ case kUnsignedGreaterThanOrEqual: |
+ VisitCompare(selector, opcode, g.UseRegister(right), |
+ g.UseImmediate(left), cont); |
+ break; |
+ default: |
+ VisitCompare(selector, opcode, g.UseRegister(right), |
+ g.UseRegister(left), cont); |
+ } |
} else { |
VisitCompare(selector, opcode, g.UseRegister(left), g.UseRegister(right), |
cont); |