Add flags field to R5900 opcodes

This commit is contained in:
Kingcom 2014-08-16 20:33:45 +02:00
parent 7e5b6dee9c
commit a8c5454724
2 changed files with 276 additions and 268 deletions

View File

@ -39,40 +39,44 @@ namespace R5900
{ {
// Generates an entry for the given opcode name. // Generates an entry for the given opcode name.
// Assumes the default function naming schemes for interpreter and recompiler functions. // Assumes the default function naming schemes for interpreter and recompiler functions.
# define MakeOpcode( name, cycles ) \ # define MakeOpcode( name, cycles, flags ) \
static const OPCODE name = { \ static const OPCODE name = { \
#name, \ #name, \
cycles, \ cycles, \
flags, \
NULL, \ NULL, \
::R5900::Interpreter::OpcodeImpl::name, \ ::R5900::Interpreter::OpcodeImpl::name, \
::R5900::Dynarec::OpcodeImpl::rec##name, \ ::R5900::Dynarec::OpcodeImpl::rec##name, \
::R5900::OpcodeDisasm::name \ ::R5900::OpcodeDisasm::name \
} }
# define MakeOpcodeM( name, cycles ) \ # define MakeOpcodeM( name, cycles, flags ) \
static const OPCODE name = { \ static const OPCODE name = { \
#name, \ #name, \
cycles, \ cycles, \
flags, \
NULL, \ NULL, \
::R5900::Interpreter::OpcodeImpl::MMI::name, \ ::R5900::Interpreter::OpcodeImpl::MMI::name, \
::R5900::Dynarec::OpcodeImpl::MMI::rec##name, \ ::R5900::Dynarec::OpcodeImpl::MMI::rec##name, \
::R5900::OpcodeDisasm::name \ ::R5900::OpcodeDisasm::name \
} }
# define MakeOpcode0( name, cycles ) \ # define MakeOpcode0( name, cycles, flags ) \
static const OPCODE name = { \ static const OPCODE name = { \
#name, \ #name, \
cycles, \ cycles, \
flags, \
NULL, \ NULL, \
::R5900::Interpreter::OpcodeImpl::COP0::name, \ ::R5900::Interpreter::OpcodeImpl::COP0::name, \
::R5900::Dynarec::OpcodeImpl::COP0::rec##name, \ ::R5900::Dynarec::OpcodeImpl::COP0::rec##name, \
::R5900::OpcodeDisasm::name \ ::R5900::OpcodeDisasm::name \
} }
# define MakeOpcode1( name, cycles ) \ # define MakeOpcode1( name, cycles, flags ) \
static const OPCODE name = { \ static const OPCODE name = { \
#name, \ #name, \
cycles, \ cycles, \
flags, \
NULL, \ NULL, \
::R5900::Interpreter::OpcodeImpl::COP1::name, \ ::R5900::Interpreter::OpcodeImpl::COP1::name, \
::R5900::Dynarec::OpcodeImpl::COP1::rec##name, \ ::R5900::Dynarec::OpcodeImpl::COP1::rec##name, \
@ -83,6 +87,7 @@ namespace R5900
static const OPCODE name = { \ static const OPCODE name = { \
#name, \ #name, \
0, \ 0, \
0, \
R5900::Opcodes::Class_##name, \ R5900::Opcodes::Class_##name, \
NULL, \ NULL, \
NULL, \ NULL, \
@ -113,10 +118,10 @@ namespace R5900
using namespace Cycles; using namespace Cycles;
MakeOpcode( Unknown, Default ); MakeOpcode( Unknown, Default, 0 );
MakeOpcode( MMI_Unknown, Default ); MakeOpcode( MMI_Unknown, Default, 0 );
MakeOpcode( COP0_Unknown, Default ); MakeOpcode( COP0_Unknown, Default, 0 );
MakeOpcode( COP1_Unknown, Default ); MakeOpcode( COP1_Unknown, Default, 0 );
// Class Subset Opcodes // Class Subset Opcodes
// (not really opcodes, but rather entire subsets of other opcode classes) // (not really opcodes, but rather entire subsets of other opcode classes)
@ -135,250 +140,250 @@ namespace R5900
// Misc Junk // Misc Junk
MakeOpcode( COP2, Default ); MakeOpcode( COP2, Default, 0 );
MakeOpcode( CACHE, Default ); MakeOpcode( CACHE, Default, 0 );
MakeOpcode( PREF, Default ); MakeOpcode( PREF, Default, 0 );
MakeOpcode( SYSCALL, Default ); MakeOpcode( SYSCALL, Default, 0 );
MakeOpcode( BREAK, Default ); MakeOpcode( BREAK, Default, 0 );
MakeOpcode( SYNC, Default ); MakeOpcode( SYNC, Default, 0 );
// Branch/Jump Opcodes // Branch/Jump Opcodes
MakeOpcode( J , Default ); MakeOpcode( J , Default, 0 );
MakeOpcode( JAL, Default ); MakeOpcode( JAL, Default, 0 );
MakeOpcode( JR, Default ); MakeOpcode( JR, Default, 0 );
MakeOpcode( JALR, Default ); MakeOpcode( JALR, Default, 0 );
MakeOpcode( BEQ, Branch ); MakeOpcode( BEQ, Branch, 0 );
MakeOpcode( BNE, Branch ); MakeOpcode( BNE, Branch, 0 );
MakeOpcode( BLEZ, Branch ); MakeOpcode( BLEZ, Branch, 0 );
MakeOpcode( BGTZ, Branch ); MakeOpcode( BGTZ, Branch, 0 );
MakeOpcode( BEQL, Branch ); MakeOpcode( BEQL, Branch, 0 );
MakeOpcode( BNEL, Branch ); MakeOpcode( BNEL, Branch, 0 );
MakeOpcode( BLEZL, Branch ); MakeOpcode( BLEZL, Branch, 0 );
MakeOpcode( BGTZL, Branch ); MakeOpcode( BGTZL, Branch, 0 );
MakeOpcode( BLTZ, Branch ); MakeOpcode( BLTZ, Branch, 0 );
MakeOpcode( BGEZ, Branch ); MakeOpcode( BGEZ, Branch, 0 );
MakeOpcode( BLTZL, Branch ); MakeOpcode( BLTZL, Branch, 0 );
MakeOpcode( BGEZL, Branch ); MakeOpcode( BGEZL, Branch, 0 );
MakeOpcode( BLTZAL, Branch ); MakeOpcode( BLTZAL, Branch, 0 );
MakeOpcode( BGEZAL, Branch ); MakeOpcode( BGEZAL, Branch, 0 );
MakeOpcode( BLTZALL, Branch ); MakeOpcode( BLTZALL, Branch, 0 );
MakeOpcode( BGEZALL, Branch ); MakeOpcode( BGEZALL, Branch, 0 );
MakeOpcode( TGEI, Branch ); MakeOpcode( TGEI, Branch, 0 );
MakeOpcode( TGEIU, Branch ); MakeOpcode( TGEIU, Branch, 0 );
MakeOpcode( TLTI, Branch ); MakeOpcode( TLTI, Branch, 0 );
MakeOpcode( TLTIU, Branch ); MakeOpcode( TLTIU, Branch, 0 );
MakeOpcode( TEQI, Branch ); MakeOpcode( TEQI, Branch, 0 );
MakeOpcode( TNEI, Branch ); MakeOpcode( TNEI, Branch, 0 );
MakeOpcode( TGE, Branch ); MakeOpcode( TGE, Branch, 0 );
MakeOpcode( TGEU, Branch ); MakeOpcode( TGEU, Branch, 0 );
MakeOpcode( TLT, Branch ); MakeOpcode( TLT, Branch, 0 );
MakeOpcode( TLTU, Branch ); MakeOpcode( TLTU, Branch, 0 );
MakeOpcode( TEQ, Branch ); MakeOpcode( TEQ, Branch, 0 );
MakeOpcode( TNE, Branch ); MakeOpcode( TNE, Branch, 0 );
// Arithmetic // Arithmetic
MakeOpcode( MULT, Mult ); MakeOpcode( MULT, Mult, 0 );
MakeOpcode( MULTU, Mult ); MakeOpcode( MULTU, Mult, 0 );
MakeOpcode( MULT1, Mult ); MakeOpcode( MULT1, Mult, 0 );
MakeOpcode( MULTU1, Mult ); MakeOpcode( MULTU1, Mult, 0 );
MakeOpcode( MADD, Mult ); MakeOpcode( MADD, Mult, 0 );
MakeOpcode( MADDU, Mult ); MakeOpcode( MADDU, Mult, 0 );
MakeOpcode( MADD1, Mult ); MakeOpcode( MADD1, Mult, 0 );
MakeOpcode( MADDU1, Mult ); MakeOpcode( MADDU1, Mult, 0 );
MakeOpcode( DIV, Div ); MakeOpcode( DIV, Div, 0 );
MakeOpcode( DIVU, Div ); MakeOpcode( DIVU, Div, 0 );
MakeOpcode( DIV1, Div ); MakeOpcode( DIV1, Div, 0 );
MakeOpcode( DIVU1, Div ); MakeOpcode( DIVU1, Div, 0 );
MakeOpcode( ADDI, Default ); MakeOpcode( ADDI, Default, 0 );
MakeOpcode( ADDIU, Default ); MakeOpcode( ADDIU, Default, 0 );
MakeOpcode( DADDI, Default ); MakeOpcode( DADDI, Default, 0 );
MakeOpcode( DADDIU, Default ); MakeOpcode( DADDIU, Default, 0 );
MakeOpcode( DADD, Default ); MakeOpcode( DADD, Default, 0 );
MakeOpcode( DADDU, Default ); MakeOpcode( DADDU, Default, 0 );
MakeOpcode( DSUB, Default ); MakeOpcode( DSUB, Default, 0 );
MakeOpcode( DSUBU, Default ); MakeOpcode( DSUBU, Default, 0 );
MakeOpcode( ADD, Default ); MakeOpcode( ADD, Default, 0 );
MakeOpcode( ADDU, Default ); MakeOpcode( ADDU, Default, 0 );
MakeOpcode( SUB, Default ); MakeOpcode( SUB, Default, 0 );
MakeOpcode( SUBU, Default ); MakeOpcode( SUBU, Default, 0 );
MakeOpcode( ANDI, Default ); MakeOpcode( ANDI, Default, 0 );
MakeOpcode( ORI, Default ); MakeOpcode( ORI, Default, 0 );
MakeOpcode( XORI, Default ); MakeOpcode( XORI, Default, 0 );
MakeOpcode( AND, Default ); MakeOpcode( AND, Default, 0 );
MakeOpcode( OR, Default ); MakeOpcode( OR, Default, 0 );
MakeOpcode( XOR, Default ); MakeOpcode( XOR, Default, 0 );
MakeOpcode( NOR, Default ); MakeOpcode( NOR, Default, 0 );
MakeOpcode( SLTI, Default ); MakeOpcode( SLTI, Default, 0 );
MakeOpcode( SLTIU, Default ); MakeOpcode( SLTIU, Default, 0 );
MakeOpcode( SLT, Default ); MakeOpcode( SLT, Default, 0 );
MakeOpcode( SLTU, Default ); MakeOpcode( SLTU, Default, 0 );
MakeOpcode( LUI, Default ); MakeOpcode( LUI, Default, 0 );
MakeOpcode( SLL, Default ); MakeOpcode( SLL, Default, 0 );
MakeOpcode( SRL, Default ); MakeOpcode( SRL, Default, 0 );
MakeOpcode( SRA, Default ); MakeOpcode( SRA, Default, 0 );
MakeOpcode( SLLV, Default ); MakeOpcode( SLLV, Default, 0 );
MakeOpcode( SRLV, Default ); MakeOpcode( SRLV, Default, 0 );
MakeOpcode( SRAV, Default ); MakeOpcode( SRAV, Default, 0 );
MakeOpcode( MOVZ, Default ); MakeOpcode( MOVZ, Default, 0 );
MakeOpcode( MOVN, Default ); MakeOpcode( MOVN, Default, 0 );
MakeOpcode( DSLLV, Default ); MakeOpcode( DSLLV, Default, 0 );
MakeOpcode( DSRLV, Default ); MakeOpcode( DSRLV, Default, 0 );
MakeOpcode( DSRAV, Default ); MakeOpcode( DSRAV, Default, 0 );
MakeOpcode( DSLL, Default ); MakeOpcode( DSLL, Default, 0 );
MakeOpcode( DSRL, Default ); MakeOpcode( DSRL, Default, 0 );
MakeOpcode( DSRA, Default ); MakeOpcode( DSRA, Default, 0 );
MakeOpcode( DSLL32, Default ); MakeOpcode( DSLL32, Default, 0 );
MakeOpcode( DSRL32, Default ); MakeOpcode( DSRL32, Default, 0 );
MakeOpcode( DSRA32, Default ); MakeOpcode( DSRA32, Default, 0 );
MakeOpcode( MFHI, Default ); MakeOpcode( MFHI, Default, 0 );
MakeOpcode( MTHI, Default ); MakeOpcode( MTHI, Default, 0 );
MakeOpcode( MFLO, Default ); MakeOpcode( MFLO, Default, 0 );
MakeOpcode( MTLO, Default ); MakeOpcode( MTLO, Default, 0 );
MakeOpcode( MFSA, Default ); MakeOpcode( MFSA, Default, 0 );
MakeOpcode( MTSA, Default ); MakeOpcode( MTSA, Default, 0 );
MakeOpcode( MTSAB, Default ); MakeOpcode( MTSAB, Default, 0 );
MakeOpcode( MTSAH, Default ); MakeOpcode( MTSAH, Default, 0 );
MakeOpcode( MFHI1, Default ); MakeOpcode( MFHI1, Default, 0 );
MakeOpcode( MTHI1, Default ); MakeOpcode( MTHI1, Default, 0 );
MakeOpcode( MFLO1, Default ); MakeOpcode( MFLO1, Default, 0 );
MakeOpcode( MTLO1, Default ); MakeOpcode( MTLO1, Default, 0 );
// Loads! // Loads!
MakeOpcode( LDL, Load ); MakeOpcode( LDL, Load, 0 );
MakeOpcode( LDR, Load ); MakeOpcode( LDR, Load, 0 );
MakeOpcode( LQ, Load ); MakeOpcode( LQ, Load, 0 );
MakeOpcode( LB, Load ); MakeOpcode( LB, Load, 0 );
MakeOpcode( LH, Load ); MakeOpcode( LH, Load, 0 );
MakeOpcode( LWL, Load ); MakeOpcode( LWL, Load, 0 );
MakeOpcode( LW, Load ); MakeOpcode( LW, Load, 0 );
MakeOpcode( LBU, Load ); MakeOpcode( LBU, Load, 0 );
MakeOpcode( LHU, Load ); MakeOpcode( LHU, Load, 0 );
MakeOpcode( LWR, Load ); MakeOpcode( LWR, Load, 0 );
MakeOpcode( LWU, Load ); MakeOpcode( LWU, Load, 0 );
MakeOpcode( LWC1, Load ); MakeOpcode( LWC1, Load, 0 );
MakeOpcode( LQC2, Load ); MakeOpcode( LQC2, Load, 0 );
MakeOpcode( LD, Load ); MakeOpcode( LD, Load, 0 );
// Stores! // Stores!
MakeOpcode( SQ, Store ); MakeOpcode( SQ, Store, 0 );
MakeOpcode( SB, Store ); MakeOpcode( SB, Store, 0 );
MakeOpcode( SH, Store ); MakeOpcode( SH, Store, 0 );
MakeOpcode( SWL, Store ); MakeOpcode( SWL, Store, 0 );
MakeOpcode( SW, Store ); MakeOpcode( SW, Store, 0 );
MakeOpcode( SDL, Store ); MakeOpcode( SDL, Store, 0 );
MakeOpcode( SDR, Store ); MakeOpcode( SDR, Store, 0 );
MakeOpcode( SWR, Store ); MakeOpcode( SWR, Store, 0 );
MakeOpcode( SWC1, Store ); MakeOpcode( SWC1, Store, 0 );
MakeOpcode( SQC2, Store ); MakeOpcode( SQC2, Store, 0 );
MakeOpcode( SD, Store ); MakeOpcode( SD, Store, 0 );
// Multimedia Instructions! // Multimedia Instructions!
MakeOpcodeM( PLZCW, MMI_Default ); MakeOpcodeM( PLZCW, MMI_Default, 0 );
MakeOpcodeM( PMFHL, MMI_Default ); MakeOpcodeM( PMFHL, MMI_Default, 0 );
MakeOpcodeM( PMTHL, MMI_Default ); MakeOpcodeM( PMTHL, MMI_Default, 0 );
MakeOpcodeM( PSLLH, MMI_Default ); MakeOpcodeM( PSLLH, MMI_Default, 0 );
MakeOpcodeM( PSRLH, MMI_Default ); MakeOpcodeM( PSRLH, MMI_Default, 0 );
MakeOpcodeM( PSRAH, MMI_Default ); MakeOpcodeM( PSRAH, MMI_Default, 0 );
MakeOpcodeM( PSLLW, MMI_Default ); MakeOpcodeM( PSLLW, MMI_Default, 0 );
MakeOpcodeM( PSRLW, MMI_Default ); MakeOpcodeM( PSRLW, MMI_Default, 0 );
MakeOpcodeM( PSRAW, MMI_Default ); MakeOpcodeM( PSRAW, MMI_Default, 0 );
MakeOpcodeM( PADDW, MMI_Default ); MakeOpcodeM( PADDW, MMI_Default, 0 );
MakeOpcodeM( PADDH, MMI_Default ); MakeOpcodeM( PADDH, MMI_Default, 0 );
MakeOpcodeM( PADDB, MMI_Default ); MakeOpcodeM( PADDB, MMI_Default, 0 );
MakeOpcodeM( PADDSW, MMI_Default ); MakeOpcodeM( PADDSW, MMI_Default, 0 );
MakeOpcodeM( PADDSH, MMI_Default ); MakeOpcodeM( PADDSH, MMI_Default, 0 );
MakeOpcodeM( PADDSB, MMI_Default ); MakeOpcodeM( PADDSB, MMI_Default, 0 );
MakeOpcodeM( PADDUW, MMI_Default ); MakeOpcodeM( PADDUW, MMI_Default, 0 );
MakeOpcodeM( PADDUH, MMI_Default ); MakeOpcodeM( PADDUH, MMI_Default, 0 );
MakeOpcodeM( PADDUB, MMI_Default ); MakeOpcodeM( PADDUB, MMI_Default, 0 );
MakeOpcodeM( PSUBW, MMI_Default ); MakeOpcodeM( PSUBW, MMI_Default, 0 );
MakeOpcodeM( PSUBH, MMI_Default ); MakeOpcodeM( PSUBH, MMI_Default, 0 );
MakeOpcodeM( PSUBB, MMI_Default ); MakeOpcodeM( PSUBB, MMI_Default, 0 );
MakeOpcodeM( PSUBSW, MMI_Default ); MakeOpcodeM( PSUBSW, MMI_Default, 0 );
MakeOpcodeM( PSUBSH, MMI_Default ); MakeOpcodeM( PSUBSH, MMI_Default, 0 );
MakeOpcodeM( PSUBSB, MMI_Default ); MakeOpcodeM( PSUBSB, MMI_Default, 0 );
MakeOpcodeM( PSUBUW, MMI_Default ); MakeOpcodeM( PSUBUW, MMI_Default, 0 );
MakeOpcodeM( PSUBUH, MMI_Default ); MakeOpcodeM( PSUBUH, MMI_Default, 0 );
MakeOpcodeM( PSUBUB, MMI_Default ); MakeOpcodeM( PSUBUB, MMI_Default, 0 );
MakeOpcodeM( PCGTW, MMI_Default ); MakeOpcodeM( PCGTW, MMI_Default, 0 );
MakeOpcodeM( PMAXW, MMI_Default ); MakeOpcodeM( PMAXW, MMI_Default, 0 );
MakeOpcodeM( PMAXH, MMI_Default ); MakeOpcodeM( PMAXH, MMI_Default, 0 );
MakeOpcodeM( PCGTH, MMI_Default ); MakeOpcodeM( PCGTH, MMI_Default, 0 );
MakeOpcodeM( PCGTB, MMI_Default ); MakeOpcodeM( PCGTB, MMI_Default, 0 );
MakeOpcodeM( PEXTLW, MMI_Default ); MakeOpcodeM( PEXTLW, MMI_Default, 0 );
MakeOpcodeM( PEXTLH, MMI_Default ); MakeOpcodeM( PEXTLH, MMI_Default, 0 );
MakeOpcodeM( PEXTLB, MMI_Default ); MakeOpcodeM( PEXTLB, MMI_Default, 0 );
MakeOpcodeM( PEXT5, MMI_Default ); MakeOpcodeM( PEXT5, MMI_Default, 0 );
MakeOpcodeM( PPACW, MMI_Default ); MakeOpcodeM( PPACW, MMI_Default, 0 );
MakeOpcodeM( PPACH, MMI_Default ); MakeOpcodeM( PPACH, MMI_Default, 0 );
MakeOpcodeM( PPACB, MMI_Default ); MakeOpcodeM( PPACB, MMI_Default, 0 );
MakeOpcodeM( PPAC5, MMI_Default ); MakeOpcodeM( PPAC5, MMI_Default, 0 );
MakeOpcodeM( PABSW, MMI_Default ); MakeOpcodeM( PABSW, MMI_Default, 0 );
MakeOpcodeM( PABSH, MMI_Default ); MakeOpcodeM( PABSH, MMI_Default, 0 );
MakeOpcodeM( PCEQW, MMI_Default ); MakeOpcodeM( PCEQW, MMI_Default, 0 );
MakeOpcodeM( PMINW, MMI_Default ); MakeOpcodeM( PMINW, MMI_Default, 0 );
MakeOpcodeM( PMINH, MMI_Default ); MakeOpcodeM( PMINH, MMI_Default, 0 );
MakeOpcodeM( PADSBH, MMI_Default ); MakeOpcodeM( PADSBH, MMI_Default, 0 );
MakeOpcodeM( PCEQH, MMI_Default ); MakeOpcodeM( PCEQH, MMI_Default, 0 );
MakeOpcodeM( PCEQB, MMI_Default ); MakeOpcodeM( PCEQB, MMI_Default, 0 );
MakeOpcodeM( PEXTUW, MMI_Default ); MakeOpcodeM( PEXTUW, MMI_Default, 0 );
MakeOpcodeM( PEXTUH, MMI_Default ); MakeOpcodeM( PEXTUH, MMI_Default, 0 );
MakeOpcodeM( PEXTUB, MMI_Default ); MakeOpcodeM( PEXTUB, MMI_Default, 0 );
MakeOpcodeM( PSLLVW, MMI_Default ); MakeOpcodeM( PSLLVW, MMI_Default, 0 );
MakeOpcodeM( PSRLVW, MMI_Default ); MakeOpcodeM( PSRLVW, MMI_Default, 0 );
MakeOpcodeM( QFSRV, MMI_Default ); MakeOpcodeM( QFSRV, MMI_Default, 0 );
MakeOpcodeM( PMADDH, MMI_Mult ); MakeOpcodeM( PMADDH, MMI_Mult, 0 );
MakeOpcodeM( PHMADH, MMI_Mult ); MakeOpcodeM( PHMADH, MMI_Mult, 0 );
MakeOpcodeM( PMSUBH, MMI_Mult ); MakeOpcodeM( PMSUBH, MMI_Mult, 0 );
MakeOpcodeM( PHMSBH, MMI_Mult ); MakeOpcodeM( PHMSBH, MMI_Mult, 0 );
MakeOpcodeM( PMULTH, MMI_Mult ); MakeOpcodeM( PMULTH, MMI_Mult, 0 );
MakeOpcodeM( PMADDW, MMI_Mult ); MakeOpcodeM( PMADDW, MMI_Mult, 0 );
MakeOpcodeM( PMSUBW, MMI_Mult ); MakeOpcodeM( PMSUBW, MMI_Mult, 0 );
MakeOpcodeM( PMFHI, MMI_Mult ); MakeOpcodeM( PMFHI, MMI_Mult, 0 );
MakeOpcodeM( PMFLO, MMI_Mult ); MakeOpcodeM( PMFLO, MMI_Mult, 0 );
MakeOpcodeM( PMULTW, MMI_Mult ); MakeOpcodeM( PMULTW, MMI_Mult, 0 );
MakeOpcodeM( PMADDUW, MMI_Mult ); MakeOpcodeM( PMADDUW, MMI_Mult, 0 );
MakeOpcodeM( PMULTUW, MMI_Mult ); MakeOpcodeM( PMULTUW, MMI_Mult, 0 );
MakeOpcodeM( PDIVUW, MMI_Div ); MakeOpcodeM( PDIVUW, MMI_Div, 0 );
MakeOpcodeM( PDIVW, MMI_Div ); MakeOpcodeM( PDIVW, MMI_Div, 0 );
MakeOpcodeM( PDIVBW, MMI_Div ); MakeOpcodeM( PDIVBW, MMI_Div, 0 );
MakeOpcodeM( PINTH, MMI_Default ); MakeOpcodeM( PINTH, MMI_Default, 0 );
MakeOpcodeM( PCPYLD, MMI_Default ); MakeOpcodeM( PCPYLD, MMI_Default, 0 );
MakeOpcodeM( PAND, MMI_Default ); MakeOpcodeM( PAND, MMI_Default, 0 );
MakeOpcodeM( PXOR, MMI_Default ); MakeOpcodeM( PXOR, MMI_Default, 0 );
MakeOpcodeM( PEXEH, MMI_Default ); MakeOpcodeM( PEXEH, MMI_Default, 0 );
MakeOpcodeM( PREVH, MMI_Default ); MakeOpcodeM( PREVH, MMI_Default, 0 );
MakeOpcodeM( PEXEW, MMI_Default ); MakeOpcodeM( PEXEW, MMI_Default, 0 );
MakeOpcodeM( PROT3W, MMI_Default ); MakeOpcodeM( PROT3W, MMI_Default, 0 );
MakeOpcodeM( PSRAVW, MMI_Default ); MakeOpcodeM( PSRAVW, MMI_Default, 0 );
MakeOpcodeM( PMTHI, MMI_Default ); MakeOpcodeM( PMTHI, MMI_Default, 0 );
MakeOpcodeM( PMTLO, MMI_Default ); MakeOpcodeM( PMTLO, MMI_Default, 0 );
MakeOpcodeM( PINTEH, MMI_Default ); MakeOpcodeM( PINTEH, MMI_Default, 0 );
MakeOpcodeM( PCPYUD, MMI_Default ); MakeOpcodeM( PCPYUD, MMI_Default, 0 );
MakeOpcodeM( POR, MMI_Default ); MakeOpcodeM( POR, MMI_Default, 0 );
MakeOpcodeM( PNOR, MMI_Default ); MakeOpcodeM( PNOR, MMI_Default, 0 );
MakeOpcodeM( PEXCH, MMI_Default ); MakeOpcodeM( PEXCH, MMI_Default, 0 );
MakeOpcodeM( PCPYH, MMI_Default ); MakeOpcodeM( PCPYH, MMI_Default, 0 );
MakeOpcodeM( PEXCW, MMI_Default ); MakeOpcodeM( PEXCW, MMI_Default, 0 );
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// COP0 Instructions // COP0 Instructions
@ -386,21 +391,21 @@ namespace R5900
MakeOpcodeClass( COP0_C0 ); MakeOpcodeClass( COP0_C0 );
MakeOpcodeClass( COP0_BC0 ); MakeOpcodeClass( COP0_BC0 );
MakeOpcode0( MFC0, CopDefault ); MakeOpcode0( MFC0, CopDefault, 0 );
MakeOpcode0( MTC0, CopDefault ); MakeOpcode0( MTC0, CopDefault, 0 );
MakeOpcode0( BC0F, Branch ); MakeOpcode0( BC0F, Branch, 0 );
MakeOpcode0( BC0T, Branch ); MakeOpcode0( BC0T, Branch, 0 );
MakeOpcode0( BC0FL, Branch ); MakeOpcode0( BC0FL, Branch, 0 );
MakeOpcode0( BC0TL, Branch ); MakeOpcode0( BC0TL, Branch, 0 );
MakeOpcode0( TLBR, CopDefault ); MakeOpcode0( TLBR, CopDefault, 0 );
MakeOpcode0( TLBWI, CopDefault ); MakeOpcode0( TLBWI, CopDefault, 0 );
MakeOpcode0( TLBWR, CopDefault ); MakeOpcode0( TLBWR, CopDefault, 0 );
MakeOpcode0( TLBP, CopDefault ); MakeOpcode0( TLBP, CopDefault, 0 );
MakeOpcode0( ERET, CopDefault ); MakeOpcode0( ERET, CopDefault, 0 );
MakeOpcode0( EI, CopDefault ); MakeOpcode0( EI, CopDefault, 0 );
MakeOpcode0( DI, CopDefault ); MakeOpcode0( DI, CopDefault, 0 );
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
// COP1 Instructions! // COP1 Instructions!
@ -409,44 +414,44 @@ namespace R5900
MakeOpcodeClass( COP1_S ); MakeOpcodeClass( COP1_S );
MakeOpcodeClass( COP1_W ); // contains CVT_S instruction *only* MakeOpcodeClass( COP1_W ); // contains CVT_S instruction *only*
MakeOpcode1( MFC1, CopDefault ); MakeOpcode1( MFC1, CopDefault, 0 );
MakeOpcode1( CFC1, CopDefault ); MakeOpcode1( CFC1, CopDefault, 0 );
MakeOpcode1( MTC1, CopDefault ); MakeOpcode1( MTC1, CopDefault, 0 );
MakeOpcode1( CTC1, CopDefault ); MakeOpcode1( CTC1, CopDefault, 0 );
MakeOpcode1( BC1F, Branch ); MakeOpcode1( BC1F, Branch, 0 );
MakeOpcode1( BC1T, Branch ); MakeOpcode1( BC1T, Branch, 0 );
MakeOpcode1( BC1FL, Branch ); MakeOpcode1( BC1FL, Branch, 0 );
MakeOpcode1( BC1TL, Branch ); MakeOpcode1( BC1TL, Branch, 0 );
MakeOpcode1( ADD_S, CopDefault ); MakeOpcode1( ADD_S, CopDefault, 0 );
MakeOpcode1( ADDA_S, CopDefault ); MakeOpcode1( ADDA_S, CopDefault, 0 );
MakeOpcode1( SUB_S, CopDefault ); MakeOpcode1( SUB_S, CopDefault, 0 );
MakeOpcode1( SUBA_S, CopDefault ); MakeOpcode1( SUBA_S, CopDefault, 0 );
MakeOpcode1( ABS_S, CopDefault ); MakeOpcode1( ABS_S, CopDefault, 0 );
MakeOpcode1( MOV_S, CopDefault ); MakeOpcode1( MOV_S, CopDefault, 0 );
MakeOpcode1( NEG_S, CopDefault ); MakeOpcode1( NEG_S, CopDefault, 0 );
MakeOpcode1( MAX_S, CopDefault ); MakeOpcode1( MAX_S, CopDefault, 0 );
MakeOpcode1( MIN_S, CopDefault ); MakeOpcode1( MIN_S, CopDefault, 0 );
MakeOpcode1( MUL_S, FPU_Mult ); MakeOpcode1( MUL_S, FPU_Mult, 0 );
MakeOpcode1( DIV_S, 6*8 ); MakeOpcode1( DIV_S, 6*8, 0 );
MakeOpcode1( SQRT_S, 6*8 ); MakeOpcode1( SQRT_S, 6*8, 0 );
MakeOpcode1( RSQRT_S, 8*8 ); MakeOpcode1( RSQRT_S, 8*8, 0 );
MakeOpcode1( MULA_S, FPU_Mult ); MakeOpcode1( MULA_S, FPU_Mult, 0 );
MakeOpcode1( MADD_S, FPU_Mult ); MakeOpcode1( MADD_S, FPU_Mult, 0 );
MakeOpcode1( MSUB_S, FPU_Mult ); MakeOpcode1( MSUB_S, FPU_Mult, 0 );
MakeOpcode1( MADDA_S, FPU_Mult ); MakeOpcode1( MADDA_S, FPU_Mult, 0 );
MakeOpcode1( MSUBA_S, FPU_Mult ); MakeOpcode1( MSUBA_S, FPU_Mult, 0 );
MakeOpcode1( C_F, CopDefault ); MakeOpcode1( C_F, CopDefault, 0 );
MakeOpcode1( C_EQ, CopDefault ); MakeOpcode1( C_EQ, CopDefault, 0 );
MakeOpcode1( C_LT, CopDefault ); MakeOpcode1( C_LT, CopDefault, 0 );
MakeOpcode1( C_LE, CopDefault ); MakeOpcode1( C_LE, CopDefault, 0 );
MakeOpcode1( CVT_S, CopDefault ); MakeOpcode1( CVT_S, CopDefault, 0 );
MakeOpcode1( CVT_W, CopDefault ); MakeOpcode1( CVT_W, CopDefault, 0 );
} }
namespace OpcodeTables namespace OpcodeTables

View File

@ -79,6 +79,9 @@ namespace R5900
// Number of cycles this instruction normally uses. // Number of cycles this instruction normally uses.
u8 cycles; u8 cycles;
// Information about the opcode
u32 flags;
const OPCODE& (*getsubclass)(u32 op); const OPCODE& (*getsubclass)(u32 op);
// Process the instruction using the interpreter. // Process the instruction using the interpreter.