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

Unified Diff: src/mips/macro-assembler-mips.cc

Issue 2102063002: MIPS: [turbofan] Fix addition for deoptimization. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase to master Created 4 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
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/macro-assembler-mips.cc
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc
index 3b8d8b1772a2eb40a3807549c01e371cd6542ee9..83436ee4aa14ac81868accab9d78e1175fe79bc8 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -5493,11 +5493,14 @@ void MacroAssembler::AddBranchOvf(Register dst, Register left, Register right,
DCHECK(!right.is(scratch));
if (left.is(right) && dst.is(left)) {
- mov(overflow_dst, right);
- right = overflow_dst;
- }
-
- if (dst.is(left)) {
+ mov(scratch, left); // Preserve left and right.
+ addu(dst, left, right); // Both are overwritten.
+ xor_(overflow_dst, dst, scratch); // Left and right are equal.
+ Label done; // Restore inputs if overflow.
+ Branch(&done, ge, overflow_dst, Operand(zero_reg));
+ mov(left, scratch); // Original left and right.
+ bind(&done);
+ } else if (dst.is(left)) {
mov(scratch, left); // Preserve left.
addu(dst, left, right); // Left is overwritten.
xor_(scratch, dst, scratch); // Original left.
« no previous file with comments | « src/compiler/mips64/code-generator-mips64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698