Fix a number of bugs in the ppc disassembler, causing valid instructions to show up as (ill). Also fix some broken indentation. Plus a panicalert for illegal instructions in ppctables. Remove some deprecated compiler flags.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1528 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
cdf64b8199
commit
162351d832
|
@ -51,7 +51,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -116,7 +115,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -179,7 +177,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -245,7 +242,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -308,7 +304,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -374,7 +369,6 @@
|
|||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
|
|
@ -582,9 +582,6 @@ namespace PPCDisasm
|
|||
int bsh = (int)PPCGETB(in);
|
||||
int mb = (int)PPCGETC(in);
|
||||
int me = (int)PPCGETM(in);
|
||||
|
||||
|
||||
|
||||
sprintf(dp->opcode,"rlw%s%c",name,in&1?'.':'\0');
|
||||
sprintf(dp->operands,"%s, %s, %s%d, %d, %d (%08x)",regnames[a],regnames[s],regsel[i],bsh,mb,me,Helper_Mask(mb, me));
|
||||
}
|
||||
|
@ -978,6 +975,7 @@ namespace PPCDisasm
|
|||
#define SPR ((inst >> 11) & 0x3ff)
|
||||
#define TBR ((inst >> 11) & 0x3ff)
|
||||
#define CRM ((inst >> 12) & 0xff)
|
||||
|
||||
inline int SEX12(unsigned int x)
|
||||
{
|
||||
return x & 0x800 ? (x|0xFFFFF000) : x;
|
||||
|
@ -1162,9 +1160,8 @@ namespace PPCDisasm
|
|||
/* instruction, or NULL if an error occured. */
|
||||
{
|
||||
ppc_word in = *(dp->instr);
|
||||
|
||||
if (dp->opcode==NULL || dp->operands==NULL)
|
||||
return (NULL); /* no buffers */
|
||||
if (!dp->opcode || !dp->operands)
|
||||
return NULL; /* no buffers */
|
||||
|
||||
#if LITTLEENDIAN
|
||||
in = (in & 0xff)<<24 | (in & 0xff00)<<8 | (in & 0xff0000)>>8 |
|
||||
|
@ -1176,6 +1173,18 @@ namespace PPCDisasm
|
|||
|
||||
switch (PPCGETIDX(in))
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
int block = in & 0x3FFFFFF;
|
||||
if (block) {
|
||||
sprintf(dp->opcode, "JITblock");
|
||||
sprintf(dp->operands, "%i", block);
|
||||
} else {
|
||||
strcpy(dp->opcode, "");
|
||||
strcpy(dp->operands, "---");
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
sprintf(dp->opcode,"HLE");
|
||||
//HLE call
|
||||
|
@ -1990,15 +1999,15 @@ namespace PPCDisasm
|
|||
case 59:
|
||||
switch (in & 0x3e) {
|
||||
case 36:
|
||||
fdabc(dp,in,"divs",6,0);
|
||||
fdabc(dp,in,"divs",5,0);
|
||||
break;
|
||||
|
||||
case 40:
|
||||
fdabc(dp,in,"subs",6,0);
|
||||
fdabc(dp,in,"subs",5,0);
|
||||
break;
|
||||
|
||||
case 42:
|
||||
fdabc(dp,in,"adds",6,0);
|
||||
fdabc(dp,in,"adds",5,0);
|
||||
break;
|
||||
|
||||
case 44:
|
||||
|
@ -2010,7 +2019,7 @@ namespace PPCDisasm
|
|||
break;
|
||||
|
||||
case 50:
|
||||
fdabc(dp,in,"muls",5,0);
|
||||
fdabc(dp,in,"muls",6,0);
|
||||
break;
|
||||
|
||||
case 56:
|
||||
|
@ -2077,7 +2086,7 @@ namespace PPCDisasm
|
|||
break;
|
||||
|
||||
case 20:
|
||||
fdabc(dp,in,"rsqrte",2,0);
|
||||
fdabc(dp,in,"rsqrte",3,0);
|
||||
break;
|
||||
|
||||
case 24:
|
||||
|
@ -2096,12 +2105,15 @@ namespace PPCDisasm
|
|||
fdabc(dp,in,"nmadd",7,0);
|
||||
break;
|
||||
|
||||
case 52:
|
||||
sprintf(dp->opcode, "XXX dp 52");
|
||||
break;
|
||||
|
||||
default:
|
||||
ill(dp,in);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
switch (PPCGETIDX2(in)) {
|
||||
case 0:
|
||||
|
@ -2204,7 +2216,8 @@ namespace PPCDisasm
|
|||
}
|
||||
return (dp->instr + 1);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// What were MS thinking?
|
||||
#ifdef _WIN32
|
||||
|
|
|
@ -645,20 +645,28 @@ void PPCTables::InitTables()
|
|||
}
|
||||
}
|
||||
|
||||
// #define OPLOG
|
||||
|
||||
#ifdef OPLOG
|
||||
namespace {
|
||||
std::vector<u32> rsplocations;
|
||||
}
|
||||
#endif
|
||||
|
||||
void PPCTables::CompileInstruction(UGeckoInstruction _inst)
|
||||
{
|
||||
dynaOpTable[_inst.OPCD](_inst);
|
||||
GekkoOPInfo *info = GetOpInfo(_inst);
|
||||
if (info) {
|
||||
#ifdef OPLOG
|
||||
if (!strcmp(info->opname, "mcrfs")) {
|
||||
rsplocations.push_back(Jit64::js.compilerPC);
|
||||
}
|
||||
#endif
|
||||
info->compileCount++;
|
||||
info->lastUse = Jit64::js.compilerPC;
|
||||
} else {
|
||||
PanicAlert("Tried to compile illegal (or unknown) instruction %08x, at %08x", _inst.hex, Jit64::js.compilerPC);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -688,7 +696,6 @@ struct inf
|
|||
void PPCTables::PrintInstructionRunCounts()
|
||||
{
|
||||
std::vector<inf> temp;
|
||||
|
||||
for (int i = 0; i < m_numInstructions; i++)
|
||||
{
|
||||
inf x;
|
||||
|
@ -697,7 +704,6 @@ void PPCTables::PrintInstructionRunCounts()
|
|||
temp.push_back(x);
|
||||
}
|
||||
std::sort(temp.begin(), temp.end());
|
||||
|
||||
for (int i = 0; i < m_numInstructions; i++)
|
||||
{
|
||||
LOG(GEKKO, "%s : %i", temp[i].name,temp[i].count);
|
||||
|
@ -724,10 +730,12 @@ void PPCTables::LogCompiledInstructions()
|
|||
}
|
||||
}
|
||||
fclose(f);
|
||||
#ifdef OPLOG
|
||||
f = fopen(StringFromFormat(FULL_LOGS_DIR "mcrfs_at.txt", time).c_str(), "w");
|
||||
for (size_t i = 0; i < rsplocations.size(); i++) {
|
||||
fprintf(f, "mcrfs: %08x\n", rsplocations[i]);
|
||||
}
|
||||
fclose(f);
|
||||
#endif
|
||||
time++;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -140,7 +139,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -228,7 +226,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -405,7 +402,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
@ -494,7 +490,6 @@
|
|||
AssemblerListingLocation="$(IntDir)\"
|
||||
WarningLevel="3"
|
||||
WarnAsError="false"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
ForcedIncludeFiles="stdafx.h"
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue