GekkoDisassembler: fix/improve disassembly for a few instructions

This commit is contained in:
Fiora 2014-09-15 16:12:46 -07:00
parent 68b2d86daf
commit 7368c2ee9e
1 changed files with 25 additions and 22 deletions

View File

@ -89,6 +89,10 @@ static const char* cmpname[4] = {
"cmpw", "cmpd", "cmplw", "cmpld" "cmpw", "cmpd", "cmplw", "cmpld"
}; };
static const char* ps_cmpname[4] = {
"ps_cmpu0", "ps_cmpo0", "ps_cmpu1", "ps_cmpo1"
};
static const char* b_ext[4] = { static const char* b_ext[4] = {
"", "l", "a", "la" "", "l", "a", "la"
}; };
@ -379,7 +383,7 @@ void GekkoDisassembler::cmpi(u32 in, int uimm)
i = (int)PPCGETCRD(in); i = (int)PPCGETCRD(in);
if (i != 0) if (i != 0)
{ {
m_operands += StringFromFormat("cr%c,", '0' + i); m_operands += StringFromFormat("cr%c, ", '0' + i);
} }
m_operands += imm(in, uimm, 2, false); m_operands += imm(in, uimm, 2, false);
@ -977,10 +981,15 @@ void GekkoDisassembler::ps(u32 inst)
switch ((inst >> 1) & 0x1F) switch ((inst >> 1) & 0x1F)
{ {
case 6: case 6:
m_opcode = "ps_lux"; m_opcode = inst & 0x40 ? "psq_lux" : "psq_lx";
m_operands = StringFromFormat("p%u, (r%u + r%u)", FD, RA, RB); m_operands = StringFromFormat("p%u, (r%u + r%u)", FD, RA, RB);
return; return;
case 7:
m_opcode = inst & 0x40 ? "psq_stux" : "psq_stx";
m_operands = StringFromFormat("(r%u + r%u), p%u", RA, RB, FS);
return;
case 18: case 18:
m_opcode = "ps_div"; m_opcode = "ps_div";
m_operands = StringFromFormat("p%u, p%u/p%u", FD, FA, FB); m_operands = StringFromFormat("p%u, p%u/p%u", FD, FA, FB);
@ -1091,25 +1100,18 @@ void GekkoDisassembler::ps(u32 inst)
return; return;
case 0: case 0:
m_opcode = "ps_cmpu0";
m_operands = "ps_cmpu0";
return;
case 32: case 32:
m_opcode = "ps_cmpq0";
m_operands = "ps_cmpo0";
return;
case 64: case 64:
m_opcode = "ps_cmpu1";
m_operands = "ps_cmpu1";
return;
case 96: case 96:
m_opcode = "ps_cmpo1"; {
m_operands = "ps_cmpo1"; m_opcode = ps_cmpname[(inst >> 6) & 0x3];
return;
int i = (int)PPCGETCRD(inst);
if (i != 0)
m_operands += StringFromFormat("cr%c, ", '0' + i);
m_operands += StringFromFormat("p%u, p%u", FA, FB);
return;
}
case 528: case 528:
m_opcode = "ps_merge00"; m_opcode = "ps_merge00";
m_operands = StringFromFormat("p%u, p%u[0],p%u[0]", FD, FA, FB); m_operands = StringFromFormat("p%u, p%u[0],p%u[0]", FD, FA, FB);
@ -1131,9 +1133,10 @@ void GekkoDisassembler::ps(u32 inst)
return; return;
case 1014: case 1014:
m_opcode = "dcbz_l"; if (inst & PPCDMASK)
m_operands = ""; ill(inst);
return; else
dab(inst, "dcbz_l", 3, 0, 0, 0, 0);
} }
// default: // default:
@ -1152,7 +1155,7 @@ void GekkoDisassembler::ps_mem(u32 inst)
case 57: case 57:
m_opcode = "psq_lu"; m_opcode = "psq_lu";
m_operands = ""; m_operands = StringFromFormat("p%u, %i(r%u)", RS, SEX12(inst & 0xFFF), RA);;
break; break;
case 60: case 60:
@ -1162,7 +1165,7 @@ void GekkoDisassembler::ps_mem(u32 inst)
case 61: case 61:
m_opcode = "psq_stu"; m_opcode = "psq_stu";
m_operands = StringFromFormat("r%u, p%u ?", RA, RS); m_operands = StringFromFormat("%i(r%u), p%u", SEX12(inst & 0xFFF), RA, RS);
break; break;
} }
} }