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

Unified Diff: runtime/vm/disassembler_mips.cc

Issue 12519007: Adds MIPS instructions to simulator, assembler, disassembler (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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 | « runtime/vm/assembler_mips_test.cc ('k') | runtime/vm/simulator_mips.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/disassembler_mips.cc
===================================================================
--- runtime/vm/disassembler_mips.cc (revision 19730)
+++ runtime/vm/disassembler_mips.cc (working copy)
@@ -37,6 +37,7 @@
void DecodeSpecial(Instr* instr);
void DecodeSpecial2(Instr* instr);
+ void DecodeSpecial3(Instr* instr);
// Convenience functions.
char* get_buffer() const { return buffer_; }
@@ -176,6 +177,7 @@
void MIPSDecoder::DecodeSpecial(Instr* instr) {
+ ASSERT(instr->OpcodeField() == SPECIAL);
switch (instr->FunctionField()) {
case ADDU: {
Format(instr, "addu 'rd, 'rs, 'rt");
@@ -227,6 +229,7 @@
void MIPSDecoder::DecodeSpecial2(Instr* instr) {
+ ASSERT(instr->OpcodeField() == SPECIAL2);
switch (instr->FunctionField()) {
case CLO: {
Format(instr, "clo 'rd, 'rs");
@@ -245,6 +248,18 @@
}
+void MIPSDecoder::DecodeSpecial3(Instr* instr) {
+ ASSERT(instr->OpcodeField() == SPECIAL3);
+ switch (instr->FunctionField()) {
+ default: {
+ OS::PrintErr("DecodeSpecial3: 0x%x\n", instr->InstructionBits());
+ UNREACHABLE();
+ break;
+ }
+ }
+}
+
+
void MIPSDecoder::InstructionDecode(Instr* instr) {
switch (instr->OpcodeField()) {
case SPECIAL: {
@@ -255,26 +270,54 @@
DecodeSpecial2(instr);
break;
}
- case ADDI: {
- Format(instr, "addi 'rt, 'rs, 'immu");
+ case SPECIAL3: {
+ DecodeSpecial3(instr);
break;
}
case ADDIU: {
- Format(instr, "addiu 'rt, 'rs, 'immu");
+ Format(instr, "addiu 'rt, 'rs, 'imms");
break;
}
case ANDI: {
Format(instr, "andi 'rt, 'rs, 'immu");
break;
}
+ case LB: {
+ Format(instr, "lb 'rt, 'imms('rs)");
+ break;
+ }
+ case LBU: {
+ Format(instr, "lbu 'rt, 'imms('rs)");
+ break;
+ }
+ case LH: {
+ Format(instr, "lh 'rt, 'imms('rs)");
+ break;
+ }
case LUI: {
Format(instr, "lui 'rt, 'immu");
break;
}
+ case LW: {
+ Format(instr, "lw 'rt, 'imms('rs)");
+ break;
+ }
case ORI: {
Format(instr, "ori 'rt, 'rs, 'immu");
break;
}
+ case SB: {
+ Format(instr, "sb 'rt, 'imms('rs)");
+ break;
+ }
+ case SH: {
+ Format(instr, "sh 'rt, 'imms('rs)");
+ break;
+ }
+ case SW: {
+ Format(instr, "sw 'rt, 'imms('rs)");
+ break;
+ }
default: {
OS::PrintErr("Undecoded instruction: 0x%x\n", instr->InstructionBits());
UNREACHABLE();
« no previous file with comments | « runtime/vm/assembler_mips_test.cc ('k') | runtime/vm/simulator_mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698