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

Unified Diff: runtime/vm/disassembler_mips.cc

Issue 12545024: Adds a few MIPS arithmetic instructions to the 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
Index: runtime/vm/disassembler_mips.cc
===================================================================
--- runtime/vm/disassembler_mips.cc (revision 19704)
+++ runtime/vm/disassembler_mips.cc (working copy)
@@ -36,6 +36,7 @@
void Format(Instr* instr, const char* format);
void DecodeSpecial(Instr* instr);
+ void DecodeSpecial2(Instr* instr);
// Convenience functions.
char* get_buffer() const { return buffer_; }
@@ -176,6 +177,30 @@
void MIPSDecoder::DecodeSpecial(Instr* instr) {
switch (instr->FunctionField()) {
+ case ADDU: {
+ Format(instr, "addu 'rd, 'rs, 'rt");
+ break;
+ }
+ case AND: {
+ Format(instr, "and 'rd, 'rs, 'rt");
+ break;
+ }
+ case DIV: {
+ Format(instr, "div 'rs, 'rt");
+ break;
+ }
+ case DIVU: {
+ Format(instr, "divu 'rs, 'rt");
+ break;
+ }
+ case MFHI: {
+ Format(instr, "mfhi 'rd");
+ break;
+ }
+ case MFLO: {
+ Format(instr, "mflo 'rd");
+ break;
+ }
case SLL: {
if ((instr->RdField() == R0) &&
(instr->RtField() == R0) &&
@@ -201,12 +226,45 @@
}
+void MIPSDecoder::DecodeSpecial2(Instr* instr) {
+ switch (instr->FunctionField()) {
+ case CLO: {
+ Format(instr, "clo 'rd, 'rs");
+ }
+ case CLZ: {
+ Format(instr, "clz 'rd, 'rs");
+ }
+ default: {
+ OS::PrintErr("DecodeSpecial2: 0x%x\n", instr->InstructionBits());
+ UNREACHABLE();
+ break;
+ }
+ }
+}
+
+
void MIPSDecoder::InstructionDecode(Instr* instr) {
switch (instr->OpcodeField()) {
case SPECIAL: {
DecodeSpecial(instr);
break;
}
+ case SPECIAL2: {
+ DecodeSpecial2(instr);
+ break;
+ }
+ case ADDI: {
+ Format(instr, "addi 'rt, 'rs, 'immu");
+ break;
+ }
+ case ADDIU: {
+ Format(instr, "addiu 'rt, 'rs, 'immu");
+ break;
+ }
+ case ANDI: {
+ Format(instr, "andi 'rt, 'rs, 'immu");
+ break;
+ }
case ORI: {
Format(instr, "ori 'rt, 'rs, 'immu");
break;

Powered by Google App Engine
This is Rietveld 408576698