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

Unified Diff: runtime/vm/simulator_mips.cc

Issue 802023002: Fix SLTIU instruction in MIPS assembler, disassembler, and simulator. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years 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
« runtime/vm/assembler_mips.h ('K') | « runtime/vm/disassembler_mips.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 42354)
+++ runtime/vm/simulator_mips.cc (working copy)
@@ -2183,10 +2183,11 @@
break;
}
case SLTIU: {
- // Format(instr, "slti 'rt, 'rs, 'immu");
+ // Format(instr, "sltiu 'rt, 'rs, 'imms");
uint32_t rs_val = get_register(instr->RsField());
- uint32_t imm_val = instr->UImmField();
- set_register(instr->RtField(), rs_val < imm_val ? 1 : 0);
+ int32_t imm_val = instr->SImmField(); // Sign extend to 32-bit.
+ uint32_t immu_val = static_cast<uint32_t>(imm_val); // Treat as unsigned.
+ set_register(instr->RtField(), rs_val < immu_val ? 1 : 0);
break;
}
case SDC1: {
« runtime/vm/assembler_mips.h ('K') | « runtime/vm/disassembler_mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698