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 cf748fe186514d3cff310a2e6a7128281220ed7f..662f0106b9c1be61d8f776d3ff21c9300cbf03bd 100644 |
--- a/src/compiler/mips64/instruction-selector-mips64.cc |
+++ b/src/compiler/mips64/instruction-selector-mips64.cc |
@@ -347,11 +347,35 @@ void InstructionSelector::VisitWord64Or(Node* node) { |
void InstructionSelector::VisitWord32Xor(Node* node) { |
+ Int32BinopMatcher m(node); |
+ if (m.left().IsWord32Or() && CanCover(node, m.left().node()) && |
+ m.right().Is(-1)) { |
+ Int32BinopMatcher mleft(m.left().node()); |
+ if (!mleft.right().HasValue()) { |
+ Mips64OperandGenerator g(this); |
+ Emit(kMips64Nor, g.DefineAsRegister(node), |
+ g.UseRegister(mleft.left().node()), |
+ g.UseRegister(mleft.right().node())); |
+ return; |
+ } |
+ } |
VisitBinop(this, node, kMips64Xor); |
} |
void InstructionSelector::VisitWord64Xor(Node* node) { |
+ Int64BinopMatcher m(node); |
+ if (m.left().IsWord64Or() && CanCover(node, m.left().node()) && |
+ m.right().Is(-1)) { |
+ Int64BinopMatcher mleft(m.left().node()); |
+ if (!mleft.right().HasValue()) { |
+ Mips64OperandGenerator g(this); |
+ Emit(kMips64Nor, g.DefineAsRegister(node), |
+ g.UseRegister(mleft.left().node()), |
+ g.UseRegister(mleft.right().node())); |
+ return; |
+ } |
+ } |
VisitBinop(this, node, kMips64Xor); |
} |