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

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

Issue 7236025: MIPS: Minor bug fixes to macro-asm and simulator. (Closed)
Patch Set: Created 9 years, 6 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 | src/mips/simulator-mips.cc » ('j') | 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 913bfa5e683e5d4aeecfb2bb623c3b7d94e40002..a520562b32abce8e22fa429e1ffddadab6937998 100644
--- a/src/mips/macro-assembler-mips.cc
+++ b/src/mips/macro-assembler-mips.cc
@@ -837,11 +837,11 @@ void MacroAssembler::Trunc_uw_d(FPURegister fd, FPURegister fs) {
void MacroAssembler::Trunc_uw_d(FPURegister fd, Register rs) {
ASSERT(!fd.is(f22));
- ASSERT(!rs.is(t6));
+ ASSERT(!rs.is(t8));
// Load 2^31 into f22.
- Or(t6, zero_reg, 0x80000000);
- Cvt_d_uw(f22, t6);
+ Or(t8, zero_reg, 0x80000000);
+ Cvt_d_uw(f22, t8);
// Test if f22 > fd.
c(OLT, D, fd, f22);
@@ -856,7 +856,7 @@ void MacroAssembler::Trunc_uw_d(FPURegister fd, Register rs) {
sub_d(f22, fd, f22);
trunc_w_d(f22, f22);
mfc1(rs, f22);
- or_(rs, rs, t6);
+ or_(rs, rs, t8);
Label done;
Branch(&done);
@@ -2563,8 +2563,8 @@ void MacroAssembler::AllocateHeapNumberWithValue(Register result,
Register scratch1,
Register scratch2,
Label* gc_required) {
- LoadRoot(t6, Heap::kHeapNumberMapRootIndex);
- AllocateHeapNumber(result, scratch1, scratch2, t6, gc_required);
+ LoadRoot(t8, Heap::kHeapNumberMapRootIndex);
+ AllocateHeapNumber(result, scratch1, scratch2, t8, gc_required);
sdc1(value, FieldMemOperand(result, HeapNumber::kValueOffset));
}
@@ -3249,23 +3249,18 @@ void MacroAssembler::AdduAndCheckForOverflow(Register dst,
ASSERT(!overflow_dst.is(right));
ASSERT(!left.is(right));
- // TODO(kalmard) There must be a way to optimize dst == left and dst == right
- // cases.
-
if (dst.is(left)) {
- addu(overflow_dst, left, right);
- xor_(dst, overflow_dst, left);
- xor_(scratch, overflow_dst, right);
- and_(scratch, scratch, dst);
- mov(dst, overflow_dst);
- mov(overflow_dst, scratch);
+ mov(scratch, left); // Preserve left.
+ addu(dst, left, right); // Left is overwritten.
+ xor_(scratch, dst, scratch); // Original left.
+ xor_(overflow_dst, dst, right);
+ and_(overflow_dst, overflow_dst, scratch);
} else if (dst.is(right)) {
- addu(overflow_dst, left, right);
- xor_(dst, overflow_dst, right);
- xor_(scratch, overflow_dst, left);
- and_(scratch, scratch, dst);
- mov(dst, overflow_dst);
- mov(overflow_dst, scratch);
+ mov(scratch, right); // Preserve right.
+ addu(dst, left, right); // Right is overwritten.
+ xor_(scratch, dst, scratch); // Original right.
+ xor_(overflow_dst, dst, left);
+ and_(overflow_dst, overflow_dst, scratch);
} else {
addu(dst, left, right);
xor_(overflow_dst, dst, left);
@@ -3289,23 +3284,18 @@ void MacroAssembler::SubuAndCheckForOverflow(Register dst,
ASSERT(!scratch.is(left));
ASSERT(!scratch.is(right));
- // TODO(kalmard) There must be a way to optimize dst == left and dst == right
- // cases.
-
if (dst.is(left)) {
- subu(overflow_dst, left, right);
- xor_(scratch, overflow_dst, left);
- xor_(dst, left, right);
- and_(scratch, scratch, dst);
- mov(dst, overflow_dst);
- mov(overflow_dst, scratch);
+ mov(scratch, left); // Preserve left.
+ subu(dst, left, right); // Left is overwritten.
+ xor_(overflow_dst, dst, scratch); // scratch is original left.
+ xor_(scratch, scratch, right); // scratch is original left.
+ and_(overflow_dst, scratch, overflow_dst);
} else if (dst.is(right)) {
- subu(overflow_dst, left, right);
- xor_(dst, left, right);
- xor_(scratch, overflow_dst, left);
- and_(scratch, scratch, dst);
- mov(dst, overflow_dst);
- mov(overflow_dst, scratch);
+ mov(scratch, right); // Preserve right.
+ subu(dst, left, right); // Right is overwritten.
+ xor_(overflow_dst, dst, left);
+ xor_(scratch, left, scratch); // Original right.
+ and_(overflow_dst, scratch, overflow_dst);
} else {
subu(dst, left, right);
xor_(overflow_dst, dst, left);
« no previous file with comments | « no previous file | src/mips/simulator-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698