Interpreter: simplify subtable handling

This commit is contained in:
Tillmann Karras 2016-02-20 02:20:41 +00:00
parent b291b0a7c2
commit 3b2e170f0b
2 changed files with 11 additions and 13 deletions

View File

@ -19,11 +19,11 @@ static GekkoOPInfo unknownopinfo = { "unknown_instruction", OPTYPE_UNKNOWN, FL_E
static GekkoOPTemplate primarytable[] =
{
{4, Interpreter::RunTable4, {"RunTable4", OPTYPE_SUBTABLE | (4<<24), 0, 0, 0, 0, 0}},
{19, Interpreter::RunTable19, {"RunTable19", OPTYPE_SUBTABLE | (19<<24), 0, 0, 0, 0, 0}},
{31, Interpreter::RunTable31, {"RunTable31", OPTYPE_SUBTABLE | (31<<24), 0, 0, 0, 0, 0}},
{59, Interpreter::RunTable59, {"RunTable59", OPTYPE_SUBTABLE | (59<<24), 0, 0, 0, 0, 0}},
{63, Interpreter::RunTable63, {"RunTable63", OPTYPE_SUBTABLE | (63<<24), 0, 0, 0, 0, 0}},
{4, Interpreter::RunTable4, {"RunTable4", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}},
{19, Interpreter::RunTable19, {"RunTable19", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}},
{31, Interpreter::RunTable31, {"RunTable31", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}},
{59, Interpreter::RunTable59, {"RunTable59", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}},
{63, Interpreter::RunTable63, {"RunTable63", OPTYPE_SUBTABLE, 0, 0, 0, 0, 0}},
{16, Interpreter::bcx, {"bcx", OPTYPE_SYSTEM, FL_ENDBLOCK, 1, 0, 0, 0}},
{18, Interpreter::bx, {"bx", OPTYPE_SYSTEM, FL_ENDBLOCK, 1, 0, 0, 0}},

View File

@ -37,10 +37,9 @@ const u64 m_crTable[16] =
GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
{
GekkoOPInfo *info = m_infoTable[_inst.OPCD];
if ((info->type & 0xFFFFFF) == OPTYPE_SUBTABLE)
if (info->type == OPTYPE_SUBTABLE)
{
int table = info->type>>24;
switch (table)
switch (_inst.OPCD)
{
case 4: return m_infoTable4[_inst.SUBOP10];
case 19: return m_infoTable19[_inst.SUBOP10];
@ -54,7 +53,7 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
}
else
{
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
if (info->type == OPTYPE_INVALID)
{
_assert_msg_(POWERPC,0,"GetOpInfo - invalid op %08x @ %08x", _inst.hex, PC);
return nullptr;
@ -66,10 +65,9 @@ GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst)
{
const GekkoOPInfo *info = m_infoTable[_inst.OPCD];
if ((info->type & 0xFFFFFF) == OPTYPE_SUBTABLE)
if (info->type == OPTYPE_SUBTABLE)
{
int table = info->type>>24;
switch (table)
switch (_inst.OPCD)
{
case 4: return Interpreter::m_opTable4[_inst.SUBOP10];
case 19: return Interpreter::m_opTable19[_inst.SUBOP10];
@ -83,7 +81,7 @@ Interpreter::Instruction GetInterpreterOp(UGeckoInstruction _inst)
}
else
{
if ((info->type & 0xFFFFFF) == OPTYPE_INVALID)
if (info->type == OPTYPE_INVALID)
{
_assert_msg_(POWERPC,0,"GetInterpreterOp - invalid op %08x @ %08x", _inst.hex, PC);
return nullptr;