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 90b3e37221d7388a97eb1060b7946901f2a6ebce..8ed355018085b6650c62ae32523cd4b43fc6cd95 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -359,6 +359,13 @@ void InstructionSelector::VisitWord32Xor(Node* node) { |
return; |
} |
} |
+ if (m.right().Is(-1)) { |
+ // Use Nor for bit negation and eliminate constant loading for xori. |
+ Mips64OperandGenerator g(this); |
+ Emit(kMips64Nor, g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
+ g.TempImmediate(0)); |
+ return; |
+ } |
VisitBinop(this, node, kMips64Xor); |
} |
@@ -376,6 +383,13 @@ void InstructionSelector::VisitWord64Xor(Node* node) { |
return; |
} |
} |
+ if (m.right().Is(-1)) { |
+ // Use Nor for bit negation and eliminate constant loading for xori. |
+ Mips64OperandGenerator g(this); |
+ Emit(kMips64Nor, g.DefineAsRegister(node), g.UseRegister(m.left().node()), |
+ g.TempImmediate(0)); |
+ return; |
+ } |
VisitBinop(this, node, kMips64Xor); |
} |