Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: src/compiler/x64/code-generator-x64.cc

Issue 436593002: [turbofan] Add Int32AddWithOverflow machine operator. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/x64/code-generator-x64.cc
diff --git a/src/compiler/x64/code-generator-x64.cc b/src/compiler/x64/code-generator-x64.cc
index abe921b045f0a69596a8ddb5e8094de9a88b54e6..ddf7ebd2ad0cccdb7fc8a244420594b0fb68edac 100644
--- a/src/compiler/x64/code-generator-x64.cc
+++ b/src/compiler/x64/code-generator-x64.cc
@@ -662,6 +662,12 @@ void CodeGenerator::AssembleArchBranch(Instruction* instr,
case kUnsignedGreaterThan:
__ j(above, tlabel);
break;
+ case kOverflow:
+ __ j(overflow, tlabel);
+ break;
+ case kNotOverflow:
+ __ j(no_overflow, tlabel);
+ break;
}
if (!fallthru) __ jmp(flabel, flabel_distance); // no fallthru to flabel.
__ bind(&done);
@@ -674,9 +680,11 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
X64OperandConverter i(this, instr);
Label done;
- // Materialize a full 32-bit 1 or 0 value.
+ // Materialize a full 64-bit 1 or 0 value. The result register is always the
+ // last output of the instruction.
Label check;
- Register reg = i.OutputRegister();
+ ASSERT_NE(0, instr->OutputCount());
+ Register reg = i.OutputRegister(instr->OutputCount() - 1);
Condition cc = no_condition;
switch (condition) {
case kUnorderedEqual:
@@ -739,6 +747,12 @@ void CodeGenerator::AssembleArchBoolean(Instruction* instr,
case kUnsignedGreaterThan:
cc = above;
break;
+ case kOverflow:
+ cc = overflow;
+ break;
+ case kNotOverflow:
+ cc = no_overflow;
+ break;
}
__ bind(&check);
__ setcc(cc, reg);

Powered by Google App Engine
This is Rietveld 408576698