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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <limits.h> // For LONG_MIN, LONG_MAX. 5 #include <limits.h> // For LONG_MIN, LONG_MAX.
6 6
7 #if V8_TARGET_ARCH_MIPS 7 #if V8_TARGET_ARCH_MIPS
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/division-by-constant.h" 10 #include "src/base/division-by-constant.h"
(...skipping 5630 matching lines...) Expand 10 before | Expand all | Expand 10 after
5641 DCHECK(overflow_label || no_overflow_label); 5641 DCHECK(overflow_label || no_overflow_label);
5642 Register overflow_dst = t9; 5642 Register overflow_dst = t9;
5643 DCHECK(!dst.is(scratch)); 5643 DCHECK(!dst.is(scratch));
5644 DCHECK(!dst.is(overflow_dst)); 5644 DCHECK(!dst.is(overflow_dst));
5645 DCHECK(!scratch.is(overflow_dst)); 5645 DCHECK(!scratch.is(overflow_dst));
5646 DCHECK(!overflow_dst.is(left)); 5646 DCHECK(!overflow_dst.is(left));
5647 DCHECK(!overflow_dst.is(right)); 5647 DCHECK(!overflow_dst.is(right));
5648 DCHECK(!scratch.is(left)); 5648 DCHECK(!scratch.is(left));
5649 DCHECK(!scratch.is(right)); 5649 DCHECK(!scratch.is(right));
5650 5650
5651 Mul(overflow_dst, dst, left, right); 5651 if (IsMipsArchVariant(kMips32r6) && dst.is(right)) {
5652 sra(scratch, dst, 31); 5652 mov(scratch, right);
5653 xor_(overflow_dst, overflow_dst, scratch); 5653 Mul(overflow_dst, dst, left, scratch);
5654 sra(scratch, dst, 31);
5655 xor_(overflow_dst, overflow_dst, scratch);
5656 } else {
5657 Mul(overflow_dst, dst, left, right);
5658 sra(scratch, dst, 31);
5659 xor_(overflow_dst, overflow_dst, scratch);
5660 }
5654 5661
5655 BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label); 5662 BranchOvfHelperMult(this, overflow_dst, overflow_label, no_overflow_label);
5656 } 5663 }
5657 5664
5658 void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments, 5665 void MacroAssembler::CallRuntime(const Runtime::Function* f, int num_arguments,
5659 SaveFPRegsMode save_doubles, 5666 SaveFPRegsMode save_doubles,
5660 BranchDelaySlot bd) { 5667 BranchDelaySlot bd) {
5661 // All parameters are on the stack. v0 has the return value after call. 5668 // All parameters are on the stack. v0 has the return value after call.
5662 5669
5663 // If the expected number of arguments of the runtime function is 5670 // If the expected number of arguments of the runtime function is
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after
6981 if (mag.shift > 0) sra(result, result, mag.shift); 6988 if (mag.shift > 0) sra(result, result, mag.shift);
6982 srl(at, dividend, 31); 6989 srl(at, dividend, 31);
6983 Addu(result, result, Operand(at)); 6990 Addu(result, result, Operand(at));
6984 } 6991 }
6985 6992
6986 6993
6987 } // namespace internal 6994 } // namespace internal
6988 } // namespace v8 6995 } // namespace v8
6989 6996
6990 #endif // V8_TARGET_ARCH_MIPS 6997 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« 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