Chromium Code Reviews| Index: src/arm/disasm-arm.cc |
| =================================================================== |
| --- src/arm/disasm-arm.cc (revision 4906) |
| +++ src/arm/disasm-arm.cc (working copy) |
| @@ -101,6 +101,7 @@ |
| void PrintSRegister(int reg); |
| void PrintDRegister(int reg); |
| int FormatVFPRegister(Instr* instr, const char* format); |
| + void PrintMovwMovt(Instr* instr); |
| int FormatVFPinstruction(Instr* instr, const char* format); |
| void PrintCondition(Instr* instr); |
| void PrintShiftRm(Instr* instr); |
| @@ -375,6 +376,23 @@ |
| } |
| +// Print the movw or movt instruction. |
| +void Decoder::PrintMovwMovt(Instr* instr) { |
| + int imm = instr->ImmedMovwMovtField(); |
| + int rd = instr->RdField(); |
| + PrintRegister(rd); |
| + if (instr->Bit(22) == 1) { |
| + // Movt instruction. |
| + out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
|
Søren Thygesen Gjesse
2010/06/21 21:39:26
According to the ARM reference manual the assemble
|
| + ", #0x%04x0000", imm); |
| + } else { |
| + // Movw instruction |
| + out_buffer_pos_ += v8i::OS::SNPrintF(out_buffer_ + out_buffer_pos_, |
| + ", #0x%04x", imm); |
| + } |
| +} |
| + |
| + |
| // FormatOption takes a formatting string and interprets it based on |
| // the current instructions. The format string points to the first |
| // character of the option string (the option escape has already been |
| @@ -430,7 +448,12 @@ |
| return 1; |
| } |
| case 'm': { |
| - if (format[1] == 'e') { // 'memop: load/store instructions |
| + if ((format[1] == 't') || (format[1] == 'w')) { |
| + // 't and 'w: movt/movw instructions. |
| + PrintMovwMovt(instr); |
| + return 2; |
| + } |
| + if (format[1] == 'e') { // 'memop: load/store instructions. |
| ASSERT(STRING_STARTS_WITH(format, "memop")); |
| if (instr->HasL()) { |
| Print("ldr"); |
| @@ -776,7 +799,7 @@ |
| if (instr->HasS()) { |
| Format(instr, "tst'cond 'rn, 'shift_op"); |
| } else { |
| - Unknown(instr); // not used by V8 |
| + Format(instr, "movw'cond 'mw"); |
| } |
| break; |
| } |
| @@ -794,7 +817,7 @@ |
| if (instr->HasS()) { |
| Format(instr, "cmp'cond 'rn, 'shift_op"); |
| } else { |
| - Unknown(instr); // not used by V8 |
| + Format(instr, "movt'cond 'mt"); |
| } |
| break; |
| } |