Index: src/compiler/x64/instruction-selector-x64.cc |
diff --git a/src/compiler/x64/instruction-selector-x64.cc b/src/compiler/x64/instruction-selector-x64.cc |
index b1e1548c17e8ab1d86fa3e3fd545f8ecd63bdacc..2c1c47c6f07a273d16bf6b83604a423f8d19a52d 100644 |
--- a/src/compiler/x64/instruction-selector-x64.cc |
+++ b/src/compiler/x64/instruction-selector-x64.cc |
@@ -651,6 +651,16 @@ void InstructionSelector::VisitInt64Add(Node* node) { |
} |
+void InstructionSelector::VisitInt64AddWithOverflow(Node* node) { |
+ if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
+ FlagsContinuation cont(kOverflow, ovf); |
+ VisitBinop(this, node, kX64Add, &cont); |
+ } |
+ FlagsContinuation cont; |
+ VisitBinop(this, node, kX64Add, &cont); |
+} |
+ |
+ |
void InstructionSelector::VisitInt32Sub(Node* node) { |
X64OperandGenerator g(this); |
Int32BinopMatcher m(node); |
@@ -681,6 +691,16 @@ void InstructionSelector::VisitInt64Sub(Node* node) { |
} |
+void InstructionSelector::VisitInt64SubWithOverflow(Node* node) { |
+ if (Node* ovf = NodeProperties::FindProjection(node, 1)) { |
+ FlagsContinuation cont(kOverflow, ovf); |
+ return VisitBinop(this, node, kX64Sub, &cont); |
+ } |
+ FlagsContinuation cont; |
+ VisitBinop(this, node, kX64Sub, &cont); |
+} |
+ |
+ |
namespace { |
void VisitMul(InstructionSelector* selector, Node* node, ArchOpcode opcode) { |
@@ -1493,6 +1513,12 @@ void InstructionSelector::VisitBranch(Node* branch, BasicBlock* tbranch, |
case IrOpcode::kInt32SubWithOverflow: |
cont.OverwriteAndNegateIfEqual(kOverflow); |
return VisitBinop(this, node, kX64Sub32, &cont); |
+ case IrOpcode::kInt64AddWithOverflow: |
+ cont.OverwriteAndNegateIfEqual(kOverflow); |
+ return VisitBinop(this, node, kX64Add, &cont); |
+ case IrOpcode::kInt64SubWithOverflow: |
+ cont.OverwriteAndNegateIfEqual(kOverflow); |
+ return VisitBinop(this, node, kX64Sub, &cont); |
default: |
break; |
} |