Fix up the disassembly a little.

--HG--
extra : convert_revision : 7bdf68f445b79b1b5dbcdfa5fa1005c68d03724c
This commit is contained in:
Gabe Black 2006-11-14 01:28:11 -05:00
parent 14cb2264c8
commit 6b95f24145
2 changed files with 37 additions and 19 deletions

View file

@ -76,19 +76,22 @@ output decoder {{
{
std::stringstream response;
bool load = flags[IsLoad];
bool save = flags[IsStore];
bool store = flags[IsStore];
printMnemonic(response, mnemonic);
if(save)
if(store)
{
printReg(response, _srcRegIdx[0]);
ccprintf(response, ", ");
}
ccprintf(response, "[ ");
printReg(response, _srcRegIdx[!save ? 0 : 1]);
ccprintf(response, "[");
if(_srcRegIdx[!store ? 0 : 1] != 0)
{
printSrcReg(response, !store ? 0 : 1);
ccprintf(response, " + ");
printReg(response, _srcRegIdx[!save ? 1 : 2]);
ccprintf(response, " ]");
}
printSrcReg(response, !store ? 1 : 2);
ccprintf(response, "]");
if(load)
{
ccprintf(response, ", ");
@ -111,12 +114,16 @@ output decoder {{
printReg(response, _srcRegIdx[0]);
ccprintf(response, ", ");
}
ccprintf(response, "[ ");
ccprintf(response, "[");
if(_srcRegIdx[!save ? 0 : 1] != 0)
{
printReg(response, _srcRegIdx[!save ? 0 : 1]);
ccprintf(response, " + ");
}
if(imm >= 0)
ccprintf(response, " + 0x%x ]", imm);
ccprintf(response, "0x%x]", imm);
else
ccprintf(response, " + -0x%x ]", -imm);
ccprintf(response, "-0x%x]", -imm);
if(load)
{
ccprintf(response, ", ");

View file

@ -153,8 +153,13 @@ output decoder {{
printMnemonic(response, mnemonic);
ccprintf(response, " ");
//If the first reg is %g0, don't print it.
//This improves readability
if(_srcRegIdx[0] != 0)
{
printSrcReg(response, 0);
ccprintf(response, ", ");
}
printSrcReg(response, 1);
ccprintf(response, ", %%%s", regName);
@ -169,8 +174,14 @@ output decoder {{
printMnemonic(response, mnemonic);
ccprintf(response, " ");
//If the first reg is %g0, don't print it.
//This improves readability
if(_srcRegIdx[0] != 0)
{
printSrcReg(response, 0);
ccprintf(response, ", 0x%x, %%%s", imm, regName);
ccprintf(response, ", ");
}
ccprintf(response, "0x%x, %%%s", imm, regName);
return response.str();
}