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

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

Issue 2165533002: MIPS: Fix 'Port [turbofan] Introduce integer multiplication with overflow.' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | 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 859b5c209f0c7df11b915e697ffd70657b1ebc25..8b46155cc1144af090b81c4cc2fd5500b479a750 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -5648,9 +5648,16 @@ void MacroAssembler::MulBranchOvf(Register dst, Register left, Register right,
DCHECK(!scratch.is(left));
DCHECK(!scratch.is(right));
- Mul(overflow_dst, dst, left, right);
- sra(scratch, dst, 31);
- xor_(overflow_dst, overflow_dst, scratch);
+ if (IsMipsArchVariant(kMips32r6) && dst.is(right)) {
+ mov(scratch, right);
+ Mul(overflow_dst, dst, left, scratch);
+ sra(scratch, dst, 31);
+ xor_(overflow_dst, overflow_dst, scratch);
+ } else {
+ Mul(overflow_dst, dst, left, right);
+ sra(scratch, dst, 31);
+ xor_(overflow_dst, overflow_dst, scratch);
+ }
BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698