Merge pull request #3658 from Tilka/helpers
Interpreter: simplify some helpers
This commit is contained in:
commit
ea82fcc24f
3 files changed
+13
-19
No files matched your search
@@ -11,11 +11,7 @@
|
||||
|
||||
void Interpreter::Helper_UpdateCR0(u32 value)
|
||||
{
|
||||
s64 sign_extended = (s64)(s32)value;
|
||||
u64 cr_val = (u64)sign_extended;
|
||||
cr_val = (cr_val & ~(1ull << 61)) | ((u64)GetXER_SO() << 61);
|
||||
|
||||
PowerPC::ppcState.cr_val[0] = cr_val;
|
||||
Helper_UpdateCRx(0, value);
|
||||
}
|
||||
|
||||
void Interpreter::Helper_UpdateCRx(int idx, u32 value)
|
||||
@@ -37,7 +33,7 @@ u32 Interpreter::Helper_Mask(int mb, int me)
|
||||
//first make 001111111111111 part
|
||||
u32 begin = 0xFFFFFFFF >> mb;
|
||||
//then make 000000000001111 part, which is used to flip the bits of the first one
|
||||
u32 end = me < 31 ? (0xFFFFFFFF >> (me + 1)) : 0;
|
||||
u32 end = 0x7FFFFFFF >> me;
|
||||
//do the bitflip
|
||||
u32 mask = begin ^ end;
|
||||
//and invert if backwards
|
||||
|
||||
@@ -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}},
|
||||
|
||||
Reference in new issue
Block a user