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

Unified Diff: runtime/vm/simulator_mips.cc

Issue 713993002: Fix unsigned multiplication in MIPS simulator (add assembler regression test). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « runtime/vm/intrinsifier_arm.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/simulator_mips.cc
===================================================================
--- runtime/vm/simulator_mips.cc (revision 41673)
+++ runtime/vm/simulator_mips.cc (working copy)
@@ -94,6 +94,10 @@
bool GetFValue(char* desc, double* value);
bool GetDValue(char* desc, double* value);
+ static const int32_t kSimulatorBreakpointInstruction =
+ Instr::kBreakPointInstruction |
+ (Instr::kSimulatorBreakCode << kBreakCodeShift);
+
// Set or delete a breakpoint. Returns true if successful.
bool SetBreakpoint(Instr* breakpc);
bool DeleteBreakpoint(Instr* breakpc);
@@ -282,7 +286,7 @@
void SimulatorDebugger::RedoBreakpoints() {
if (sim_->break_pc_ != NULL) {
- sim_->break_pc_->SetInstructionBits(Instr::kBreakPointInstruction);
+ sim_->break_pc_->SetInstructionBits(kSimulatorBreakpointInstruction);
}
}
@@ -1202,11 +1206,19 @@
// Adjust for extra pc increment.
set_pc(get_pc() - Instr::kInstrSize);
}
- } else {
+ } else if (instr->BreakCodeField() == Instr::kSimulatorBreakCode) {
SimulatorDebugger dbg(this);
dbg.Stop(instr, "breakpoint");
// Adjust for extra pc increment.
set_pc(get_pc() - Instr::kInstrSize);
+ } else {
+ SimulatorDebugger dbg(this);
+ set_pc(get_pc() + Instr::kInstrSize);
+ char buffer[32];
+ snprintf(buffer, sizeof(buffer), "break #0x%x", instr->BreakCodeField());
+ dbg.Stop(instr, buffer);
+ // Adjust for extra pc increment.
+ set_pc(get_pc() - Instr::kInstrSize);
}
}
@@ -1365,8 +1377,8 @@
ASSERT(instr->RdField() == 0);
ASSERT(instr->SaField() == 0);
// Format(instr, "mult 'rs, 'rt");
- int64_t rs = static_cast<int64_t>(get_register(instr->RsField()));
- int64_t rt = static_cast<int64_t>(get_register(instr->RtField()));
+ int64_t rs = get_register(instr->RsField());
+ int64_t rt = get_register(instr->RtField());
int64_t res = rs * rt;
set_hi_register(Utils::High32Bits(res));
set_lo_register(Utils::Low32Bits(res));
@@ -1376,8 +1388,8 @@
ASSERT(instr->RdField() == 0);
ASSERT(instr->SaField() == 0);
// Format(instr, "multu 'rs, 'rt");
- uint64_t rs = static_cast<uint64_t>(get_register(instr->RsField()));
- uint64_t rt = static_cast<uint64_t>(get_register(instr->RtField()));
+ uint64_t rs = static_cast<uint32_t>(get_register(instr->RsField()));
+ uint64_t rt = static_cast<uint32_t>(get_register(instr->RtField()));
uint64_t res = rs * rt;
set_hi_register(Utils::High32Bits(res));
set_lo_register(Utils::Low32Bits(res));
« no previous file with comments | « runtime/vm/intrinsifier_arm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698