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 80079c2ef663fc4b1c8ec1e32010c0fa963301a9..64940d6792481c7be2e5140c9f2865c9ec45951f 100644 |
--- a/src/compiler/mips/instruction-selector-mips.cc |
+++ b/src/compiler/mips/instruction-selector-mips.cc |
@@ -306,6 +306,13 @@ void InstructionSelector::VisitWord32Xor(Node* node) { |
return; |
} |
} |
+ if (m.right().Is(-1)) { |
+ // Use Nor for bit negation and eliminate constant loading for xori. |
+ MipsOperandGenerator g(this); |
+ Emit(kMipsNor, g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
+ g.TempImmediate(0)); |
+ return; |
+ } |
VisitBinop(this, node, kMipsXor); |
} |