Index: src/mips/disasm-mips.cc |
diff --git a/src/mips/disasm-mips.cc b/src/mips/disasm-mips.cc |
index 5502f4170cc995a35cab6cbb63c7798ef6952ced..590f8d27737711dabd94b228bd9bbb5beb1b8d79 100644 |
--- a/src/mips/disasm-mips.cc |
+++ b/src/mips/disasm-mips.cc |
@@ -66,6 +66,7 @@ class Decoder { |
// Printing of common values. |
void PrintRegister(int reg); |
void PrintFPURegister(int freg); |
+ void PrintFPUStatusRegister(int freg); |
void PrintRs(Instruction* instr); |
void PrintRt(Instruction* instr); |
void PrintRd(Instruction* instr); |
@@ -182,6 +183,17 @@ void Decoder::PrintFPURegister(int freg) { |
} |
+void Decoder::PrintFPUStatusRegister(int freg) { |
+ switch (freg) { |
+ case kFCSRRegister: |
+ Print("FCSR"); |
+ break; |
+ default: |
+ Print(converter_.NameOfXMMRegister(freg)); |
+ } |
+} |
+ |
+ |
void Decoder::PrintFs(Instruction* instr) { |
int freg = instr->RsValue(); |
PrintFPURegister(freg); |
@@ -476,22 +488,42 @@ int Decoder::FormatRegister(Instruction* instr, const char* format) { |
// complexity of FormatOption. |
int Decoder::FormatFPURegister(Instruction* instr, const char* format) { |
DCHECK(format[0] == 'f'); |
- if (format[1] == 's') { // 'fs: fs register. |
- int reg = instr->FsValue(); |
- PrintFPURegister(reg); |
- return 2; |
- } else if (format[1] == 't') { // 'ft: ft register. |
- int reg = instr->FtValue(); |
- PrintFPURegister(reg); |
- return 2; |
- } else if (format[1] == 'd') { // 'fd: fd register. |
- int reg = instr->FdValue(); |
- PrintFPURegister(reg); |
- return 2; |
- } else if (format[1] == 'r') { // 'fr: fr register. |
- int reg = instr->FrValue(); |
- PrintFPURegister(reg); |
- return 2; |
+ if ((CTC1 == instr->RsFieldRaw()) || (CFC1 == instr->RsFieldRaw())) { |
+ if (format[1] == 's') { // 'fs: fs register. |
+ int reg = instr->FsValue(); |
+ PrintFPUStatusRegister(reg); |
+ return 2; |
+ } else if (format[1] == 't') { // 'ft: ft register. |
+ int reg = instr->FtValue(); |
+ PrintFPUStatusRegister(reg); |
+ return 2; |
+ } else if (format[1] == 'd') { // 'fd: fd register. |
+ int reg = instr->FdValue(); |
+ PrintFPUStatusRegister(reg); |
+ return 2; |
+ } else if (format[1] == 'r') { // 'fr: fr register. |
+ int reg = instr->FrValue(); |
+ PrintFPUStatusRegister(reg); |
+ return 2; |
+ } |
+ } else { |
+ if (format[1] == 's') { // 'fs: fs register. |
+ int reg = instr->FsValue(); |
+ PrintFPURegister(reg); |
+ return 2; |
+ } else if (format[1] == 't') { // 'ft: ft register. |
+ int reg = instr->FtValue(); |
+ PrintFPURegister(reg); |
+ return 2; |
+ } else if (format[1] == 'd') { // 'fd: fd register. |
+ int reg = instr->FdValue(); |
+ PrintFPURegister(reg); |
+ return 2; |
+ } else if (format[1] == 'r') { // 'fr: fr register. |
+ int reg = instr->FrValue(); |
+ PrintFPURegister(reg); |
+ return 2; |
+ } |
} |
UNREACHABLE(); |
return -1; |