#pragma once #include "PPUOpcodes.h" class PPUThread; struct ppu_interpreter { static bool MFVSCR(PPUThread&, ppu_opcode_t); static bool MTVSCR(PPUThread&, ppu_opcode_t); static bool VADDCUW(PPUThread&, ppu_opcode_t); static bool VADDFP(PPUThread&, ppu_opcode_t); static bool VADDSBS(PPUThread&, ppu_opcode_t); static bool VADDSHS(PPUThread&, ppu_opcode_t); static bool VADDSWS(PPUThread&, ppu_opcode_t); static bool VADDUBM(PPUThread&, ppu_opcode_t); static bool VADDUBS(PPUThread&, ppu_opcode_t); static bool VADDUHM(PPUThread&, ppu_opcode_t); static bool VADDUHS(PPUThread&, ppu_opcode_t); static bool VADDUWM(PPUThread&, ppu_opcode_t); static bool VADDUWS(PPUThread&, ppu_opcode_t); static bool VAND(PPUThread&, ppu_opcode_t); static bool VANDC(PPUThread&, ppu_opcode_t); static bool VAVGSB(PPUThread&, ppu_opcode_t); static bool VAVGSH(PPUThread&, ppu_opcode_t); static bool VAVGSW(PPUThread&, ppu_opcode_t); static bool VAVGUB(PPUThread&, ppu_opcode_t); static bool VAVGUH(PPUThread&, ppu_opcode_t); static bool VAVGUW(PPUThread&, ppu_opcode_t); static bool VCFSX(PPUThread&, ppu_opcode_t); static bool VCFUX(PPUThread&, ppu_opcode_t); static bool VCMPBFP(PPUThread&, ppu_opcode_t); static bool VCMPEQFP(PPUThread&, ppu_opcode_t); static bool VCMPEQUB(PPUThread&, ppu_opcode_t); static bool VCMPEQUH(PPUThread&, ppu_opcode_t); static bool VCMPEQUW(PPUThread&, ppu_opcode_t); static bool VCMPGEFP(PPUThread&, ppu_opcode_t); static bool VCMPGTFP(PPUThread&, ppu_opcode_t); static bool VCMPGTSB(PPUThread&, ppu_opcode_t); static bool VCMPGTSH(PPUThread&, ppu_opcode_t); static bool VCMPGTSW(PPUThread&, ppu_opcode_t); static bool VCMPGTUB(PPUThread&, ppu_opcode_t); static bool VCMPGTUH(PPUThread&, ppu_opcode_t); static bool VCMPGTUW(PPUThread&, ppu_opcode_t); static bool VCTSXS(PPUThread&, ppu_opcode_t); static bool VCTUXS(PPUThread&, ppu_opcode_t); static bool VEXPTEFP(PPUThread&, ppu_opcode_t); static bool VLOGEFP(PPUThread&, ppu_opcode_t); static bool VMADDFP(PPUThread&, ppu_opcode_t); static bool VMAXFP(PPUThread&, ppu_opcode_t); static bool VMAXSB(PPUThread&, ppu_opcode_t); static bool VMAXSH(PPUThread&, ppu_opcode_t); static bool VMAXSW(PPUThread&, ppu_opcode_t); static bool VMAXUB(PPUThread&, ppu_opcode_t); static bool VMAXUH(PPUThread&, ppu_opcode_t); static bool VMAXUW(PPUThread&, ppu_opcode_t); static bool VMHADDSHS(PPUThread&, ppu_opcode_t); static bool VMHRADDSHS(PPUThread&, ppu_opcode_t); static bool VMINFP(PPUThread&, ppu_opcode_t); static bool VMINSB(PPUThread&, ppu_opcode_t); static bool VMINSH(PPUThread&, ppu_opcode_t); static bool VMINSW(PPUThread&, ppu_opcode_t); static bool VMINUB(PPUThread&, ppu_opcode_t); static bool VMINUH(PPUThread&, ppu_opcode_t); static bool VMINUW(PPUThread&, ppu_opcode_t); static bool VMLADDUHM(PPUThread&, ppu_opcode_t); static bool VMRGHB(PPUThread&, ppu_opcode_t); static bool VMRGHH(PPUThread&, ppu_opcode_t); static bool VMRGHW(PPUThread&, ppu_opcode_t); static bool VMRGLB(PPUThread&, ppu_opcode_t); static bool VMRGLH(PPUThread&, ppu_opcode_t); static bool VMRGLW(PPUThread&, ppu_opcode_t); static bool VMSUMMBM(PPUThread&, ppu_opcode_t); static bool VMSUMSHM(PPUThread&, ppu_opcode_t); static bool VMSUMSHS(PPUThread&, ppu_opcode_t); static bool VMSUMUBM(PPUThread&, ppu_opcode_t); static bool VMSUMUHM(PPUThread&, ppu_opcode_t); static bool VMSUMUHS(PPUThread&, ppu_opcode_t); static bool VMULESB(PPUThread&, ppu_opcode_t); static bool VMULESH(PPUThread&, ppu_opcode_t); static bool VMULEUB(PPUThread&, ppu_opcode_t); static bool VMULEUH(PPUThread&, ppu_opcode_t); static bool VMULOSB(PPUThread&, ppu_opcode_t); static bool VMULOSH(PPUThread&, ppu_opcode_t); static bool VMULOUB(PPUThread&, ppu_opcode_t); static bool VMULOUH(PPUThread&, ppu_opcode_t); static bool VNMSUBFP(PPUThread&, ppu_opcode_t); static bool VNOR(PPUThread&, ppu_opcode_t); static bool VOR(PPUThread&, ppu_opcode_t); static bool VPERM(PPUThread&, ppu_opcode_t); static bool VPKPX(PPUThread&, ppu_opcode_t); static bool VPKSHSS(PPUThread&, ppu_opcode_t); static bool VPKSHUS(PPUThread&, ppu_opcode_t); static bool VPKSWSS(PPUThread&, ppu_opcode_t); static bool VPKSWUS(PPUThread&, ppu_opcode_t); static bool VPKUHUM(PPUThread&, ppu_opcode_t); static bool VPKUHUS(PPUThread&, ppu_opcode_t); static bool VPKUWUM(PPUThread&, ppu_opcode_t); static bool VPKUWUS(PPUThread&, ppu_opcode_t); static bool VREFP(PPUThread&, ppu_opcode_t); static bool VRFIM(PPUThread&, ppu_opcode_t); static bool VRFIN(PPUThread&, ppu_opcode_t); static bool VRFIP(PPUThread&, ppu_opcode_t); static bool VRFIZ(PPUThread&, ppu_opcode_t); static bool VRLB(PPUThread&, ppu_opcode_t); static bool VRLH(PPUThread&, ppu_opcode_t); static bool VRLW(PPUThread&, ppu_opcode_t); static bool VRSQRTEFP(PPUThread&, ppu_opcode_t); static bool VSEL(PPUThread&, ppu_opcode_t); static bool VSL(PPUThread&, ppu_opcode_t); static bool VSLB(PPUThread&, ppu_opcode_t); static bool VSLDOI(PPUThread&, ppu_opcode_t); static bool VSLH(PPUThread&, ppu_opcode_t); static bool VSLO(PPUThread&, ppu_opcode_t); static bool VSLW(PPUThread&, ppu_opcode_t); static bool VSPLTB(PPUThread&, ppu_opcode_t); static bool VSPLTH(PPUThread&, ppu_opcode_t); static bool VSPLTISB(PPUThread&, ppu_opcode_t); static bool VSPLTISH(PPUThread&, ppu_opcode_t); static bool VSPLTISW(PPUThread&, ppu_opcode_t); static bool VSPLTW(PPUThread&, ppu_opcode_t); static bool VSR(PPUThread&, ppu_opcode_t); static bool VSRAB(PPUThread&, ppu_opcode_t); static bool VSRAH(PPUThread&, ppu_opcode_t); static bool VSRAW(PPUThread&, ppu_opcode_t); static bool VSRB(PPUThread&, ppu_opcode_t); static bool VSRH(PPUThread&, ppu_opcode_t); static bool VSRO(PPUThread&, ppu_opcode_t); static bool VSRW(PPUThread&, ppu_opcode_t); static bool VSUBCUW(PPUThread&, ppu_opcode_t); static bool VSUBFP(PPUThread&, ppu_opcode_t); static bool VSUBSBS(PPUThread&, ppu_opcode_t); static bool VSUBSHS(PPUThread&, ppu_opcode_t); static bool VSUBSWS(PPUThread&, ppu_opcode_t); static bool VSUBUBM(PPUThread&, ppu_opcode_t); static bool VSUBUBS(PPUThread&, ppu_opcode_t); static bool VSUBUHM(PPUThread&, ppu_opcode_t); static bool VSUBUHS(PPUThread&, ppu_opcode_t); static bool VSUBUWM(PPUThread&, ppu_opcode_t); static bool VSUBUWS(PPUThread&, ppu_opcode_t); static bool VSUMSWS(PPUThread&, ppu_opcode_t); static bool VSUM2SWS(PPUThread&, ppu_opcode_t); static bool VSUM4SBS(PPUThread&, ppu_opcode_t); static bool VSUM4SHS(PPUThread&, ppu_opcode_t); static bool VSUM4UBS(PPUThread&, ppu_opcode_t); static bool VUPKHPX(PPUThread&, ppu_opcode_t); static bool VUPKHSB(PPUThread&, ppu_opcode_t); static bool VUPKHSH(PPUThread&, ppu_opcode_t); static bool VUPKLPX(PPUThread&, ppu_opcode_t); static bool VUPKLSB(PPUThread&, ppu_opcode_t); static bool VUPKLSH(PPUThread&, ppu_opcode_t); static bool VXOR(PPUThread&, ppu_opcode_t); static bool TDI(PPUThread&, ppu_opcode_t); static bool TWI(PPUThread&, ppu_opcode_t); static bool MULLI(PPUThread&, ppu_opcode_t); static bool SUBFIC(PPUThread&, ppu_opcode_t); static bool CMPLI(PPUThread&, ppu_opcode_t); static bool CMPI(PPUThread&, ppu_opcode_t); static bool ADDIC(PPUThread&, ppu_opcode_t); static bool ADDI(PPUThread&, ppu_opcode_t); static bool ADDIS(PPUThread&, ppu_opcode_t); static bool BC(PPUThread&, ppu_opcode_t); static bool HACK(PPUThread&, ppu_opcode_t); static bool SC(PPUThread&, ppu_opcode_t); static bool B(PPUThread&, ppu_opcode_t); static bool MCRF(PPUThread&, ppu_opcode_t); static bool BCLR(PPUThread&, ppu_opcode_t); static bool CRNOR(PPUThread&, ppu_opcode_t); static bool CRANDC(PPUThread&, ppu_opcode_t); static bool ISYNC(PPUThread&, ppu_opcode_t); static bool CRXOR(PPUThread&, ppu_opcode_t); static bool CRNAND(PPUThread&, ppu_opcode_t); static bool CRAND(PPUThread&, ppu_opcode_t); static bool CREQV(PPUThread&, ppu_opcode_t); static bool CRORC(PPUThread&, ppu_opcode_t); static bool CROR(PPUThread&, ppu_opcode_t); static bool BCCTR(PPUThread&, ppu_opcode_t); static bool RLWIMI(PPUThread&, ppu_opcode_t); static bool RLWINM(PPUThread&, ppu_opcode_t); static bool RLWNM(PPUThread&, ppu_opcode_t); static bool ORI(PPUThread&, ppu_opcode_t); static bool ORIS(PPUThread&, ppu_opcode_t); static bool XORI(PPUThread&, ppu_opcode_t); static bool XORIS(PPUThread&, ppu_opcode_t); static bool ANDI(PPUThread&, ppu_opcode_t); static bool ANDIS(PPUThread&, ppu_opcode_t); static bool RLDICL(PPUThread&, ppu_opcode_t); static bool RLDICR(PPUThread&, ppu_opcode_t); static bool RLDIC(PPUThread&, ppu_opcode_t); static bool RLDIMI(PPUThread&, ppu_opcode_t); static bool RLDCL(PPUThread&, ppu_opcode_t); static bool RLDCR(PPUThread&, ppu_opcode_t); static bool CMP(PPUThread&, ppu_opcode_t); static bool TW(PPUThread&, ppu_opcode_t); static bool LVSL(PPUThread&, ppu_opcode_t); static bool LVEBX(PPUThread&, ppu_opcode_t); static bool SUBFC(PPUThread&, ppu_opcode_t); static bool MULHDU(PPUThread&, ppu_opcode_t); static bool ADDC(PPUThread&, ppu_opcode_t); static bool MULHWU(PPUThread&, ppu_opcode_t); static bool MFOCRF(PPUThread&, ppu_opcode_t); static bool LWARX(PPUThread&, ppu_opcode_t); static bool LDX(PPUThread&, ppu_opcode_t); static bool LWZX(PPUThread&, ppu_opcode_t); static bool SLW(PPUThread&, ppu_opcode_t); static bool CNTLZW(PPUThread&, ppu_opcode_t); static bool SLD(PPUThread&, ppu_opcode_t); static bool AND(PPUThread&, ppu_opcode_t); static bool CMPL(PPUThread&, ppu_opcode_t); static bool LVSR(PPUThread&, ppu_opcode_t); static bool LVEHX(PPUThread&, ppu_opcode_t); static bool SUBF(PPUThread&, ppu_opcode_t); static bool LDUX(PPUThread&, ppu_opcode_t); static bool DCBST(PPUThread&, ppu_opcode_t); static bool LWZUX(PPUThread&, ppu_opcode_t); static bool CNTLZD(PPUThread&, ppu_opcode_t); static bool ANDC(PPUThread&, ppu_opcode_t); static bool TD(PPUThread&, ppu_opcode_t); static bool LVEWX(PPUThread&, ppu_opcode_t); static bool MULHD(PPUThread&, ppu_opcode_t); static bool MULHW(PPUThread&, ppu_opcode_t); static bool LDARX(PPUThread&, ppu_opcode_t); static bool DCBF(PPUThread&, ppu_opcode_t); static bool LBZX(PPUThread&, ppu_opcode_t); static bool LVX(PPUThread&, ppu_opcode_t); static bool NEG(PPUThread&, ppu_opcode_t); static bool LBZUX(PPUThread&, ppu_opcode_t); static bool NOR(PPUThread&, ppu_opcode_t); static bool STVEBX(PPUThread&, ppu_opcode_t); static bool SUBFE(PPUThread&, ppu_opcode_t); static bool ADDE(PPUThread&, ppu_opcode_t); static bool MTOCRF(PPUThread&, ppu_opcode_t); static bool STDX(PPUThread&, ppu_opcode_t); static bool STWCX(PPUThread&, ppu_opcode_t); static bool STWX(PPUThread&, ppu_opcode_t); static bool STVEHX(PPUThread&, ppu_opcode_t); static bool STDUX(PPUThread&, ppu_opcode_t); static bool STWUX(PPUThread&, ppu_opcode_t); static bool STVEWX(PPUThread&, ppu_opcode_t); static bool SUBFZE(PPUThread&, ppu_opcode_t); static bool ADDZE(PPUThread&, ppu_opcode_t); static bool STDCX(PPUThread&, ppu_opcode_t); static bool STBX(PPUThread&, ppu_opcode_t); static bool STVX(PPUThread&, ppu_opcode_t); static bool MULLD(PPUThread&, ppu_opcode_t); static bool SUBFME(PPUThread&, ppu_opcode_t); static bool ADDME(PPUThread&, ppu_opcode_t); static bool MULLW(PPUThread&, ppu_opcode_t); static bool DCBTST(PPUThread&, ppu_opcode_t); static bool STBUX(PPUThread&, ppu_opcode_t); static bool ADD(PPUThread&, ppu_opcode_t); static bool DCBT(PPUThread&, ppu_opcode_t); static bool LHZX(PPUThread&, ppu_opcode_t); static bool EQV(PPUThread&, ppu_opcode_t); static bool ECIWX(PPUThread&, ppu_opcode_t); static bool LHZUX(PPUThread&, ppu_opcode_t); static bool XOR(PPUThread&, ppu_opcode_t); static bool MFSPR(PPUThread&, ppu_opcode_t); static bool LWAX(PPUThread&, ppu_opcode_t); static bool DST(PPUThread&, ppu_opcode_t); static bool LHAX(PPUThread&, ppu_opcode_t); static bool LVXL(PPUThread&, ppu_opcode_t); static bool MFTB(PPUThread&, ppu_opcode_t); static bool LWAUX(PPUThread&, ppu_opcode_t); static bool DSTST(PPUThread&, ppu_opcode_t); static bool LHAUX(PPUThread&, ppu_opcode_t); static bool STHX(PPUThread&, ppu_opcode_t); static bool ORC(PPUThread&, ppu_opcode_t); static bool ECOWX(PPUThread&, ppu_opcode_t); static bool STHUX(PPUThread&, ppu_opcode_t); static bool OR(PPUThread&, ppu_opcode_t); static bool DIVDU(PPUThread&, ppu_opcode_t); static bool DIVWU(PPUThread&, ppu_opcode_t); static bool MTSPR(PPUThread&, ppu_opcode_t); static bool DCBI(PPUThread&, ppu_opcode_t); static bool NAND(PPUThread&, ppu_opcode_t); static bool STVXL(PPUThread&, ppu_opcode_t); static bool DIVD(PPUThread&, ppu_opcode_t); static bool DIVW(PPUThread&, ppu_opcode_t); static bool LVLX(PPUThread&, ppu_opcode_t); static bool LDBRX(PPUThread&, ppu_opcode_t); static bool LSWX(PPUThread&, ppu_opcode_t); static bool LWBRX(PPUThread&, ppu_opcode_t); static bool LFSX(PPUThread&, ppu_opcode_t); static bool SRW(PPUThread&, ppu_opcode_t); static bool SRD(PPUThread&, ppu_opcode_t); static bool LVRX(PPUThread&, ppu_opcode_t); static bool LSWI(PPUThread&, ppu_opcode_t); static bool LFSUX(PPUThread&, ppu_opcode_t); static bool SYNC(PPUThread&, ppu_opcode_t); static bool LFDX(PPUThread&, ppu_opcode_t); static bool LFDUX(PPUThread&, ppu_opcode_t); static bool STVLX(PPUThread&, ppu_opcode_t); static bool STDBRX(PPUThread&, ppu_opcode_t); static bool STSWX(PPUThread&, ppu_opcode_t); static bool STWBRX(PPUThread&, ppu_opcode_t); static bool STFSX(PPUThread&, ppu_opcode_t); static bool STVRX(PPUThread&, ppu_opcode_t); static bool STFSUX(PPUThread&, ppu_opcode_t); static bool STSWI(PPUThread&, ppu_opcode_t); static bool STFDX(PPUThread&, ppu_opcode_t); static bool STFDUX(PPUThread&, ppu_opcode_t); static bool LVLXL(PPUThread&, ppu_opcode_t); static bool LHBRX(PPUThread&, ppu_opcode_t); static bool SRAW(PPUThread&, ppu_opcode_t); static bool SRAD(PPUThread&, ppu_opcode_t); static bool LVRXL(PPUThread&, ppu_opcode_t); static bool DSS(PPUThread&, ppu_opcode_t); static bool SRAWI(PPUThread&, ppu_opcode_t); static bool SRADI(PPUThread&, ppu_opcode_t); static bool EIEIO(PPUThread&, ppu_opcode_t); static bool STVLXL(PPUThread&, ppu_opcode_t); static bool STHBRX(PPUThread&, ppu_opcode_t); static bool EXTSH(PPUThread&, ppu_opcode_t); static bool STVRXL(PPUThread&, ppu_opcode_t); static bool EXTSB(PPUThread&, ppu_opcode_t); static bool STFIWX(PPUThread&, ppu_opcode_t); static bool EXTSW(PPUThread&, ppu_opcode_t); static bool ICBI(PPUThread&, ppu_opcode_t); static bool DCBZ(PPUThread&, ppu_opcode_t); static bool LWZ(PPUThread&, ppu_opcode_t); static bool LWZU(PPUThread&, ppu_opcode_t); static bool LBZ(PPUThread&, ppu_opcode_t); static bool LBZU(PPUThread&, ppu_opcode_t); static bool STW(PPUThread&, ppu_opcode_t); static bool STWU(PPUThread&, ppu_opcode_t); static bool STB(PPUThread&, ppu_opcode_t); static bool STBU(PPUThread&, ppu_opcode_t); static bool LHZ(PPUThread&, ppu_opcode_t); static bool LHZU(PPUThread&, ppu_opcode_t); static bool LHA(PPUThread&, ppu_opcode_t); static bool LHAU(PPUThread&, ppu_opcode_t); static bool STH(PPUThread&, ppu_opcode_t); static bool STHU(PPUThread&, ppu_opcode_t); static bool LMW(PPUThread&, ppu_opcode_t); static bool STMW(PPUThread&, ppu_opcode_t); static bool LFS(PPUThread&, ppu_opcode_t); static bool LFSU(PPUThread&, ppu_opcode_t); static bool LFD(PPUThread&, ppu_opcode_t); static bool LFDU(PPUThread&, ppu_opcode_t); static bool STFS(PPUThread&, ppu_opcode_t); static bool STFSU(PPUThread&, ppu_opcode_t); static bool STFD(PPUThread&, ppu_opcode_t); static bool STFDU(PPUThread&, ppu_opcode_t); static bool LD(PPUThread&, ppu_opcode_t); static bool LDU(PPUThread&, ppu_opcode_t); static bool LWA(PPUThread&, ppu_opcode_t); static bool STD(PPUThread&, ppu_opcode_t); static bool STDU(PPUThread&, ppu_opcode_t); static bool FDIVS(PPUThread&, ppu_opcode_t); static bool FSUBS(PPUThread&, ppu_opcode_t); static bool FADDS(PPUThread&, ppu_opcode_t); static bool FSQRTS(PPUThread&, ppu_opcode_t); static bool FRES(PPUThread&, ppu_opcode_t); static bool FMULS(PPUThread&, ppu_opcode_t); static bool FMADDS(PPUThread&, ppu_opcode_t); static bool FMSUBS(PPUThread&, ppu_opcode_t); static bool FNMSUBS(PPUThread&, ppu_opcode_t); static bool FNMADDS(PPUThread&, ppu_opcode_t); static bool MTFSB1(PPUThread&, ppu_opcode_t); static bool MCRFS(PPUThread&, ppu_opcode_t); static bool MTFSB0(PPUThread&, ppu_opcode_t); static bool MTFSFI(PPUThread&, ppu_opcode_t); static bool MFFS(PPUThread&, ppu_opcode_t); static bool MTFSF(PPUThread&, ppu_opcode_t); static bool FCMPU(PPUThread&, ppu_opcode_t); static bool FRSP(PPUThread&, ppu_opcode_t); static bool FCTIW(PPUThread&, ppu_opcode_t); static bool FCTIWZ(PPUThread&, ppu_opcode_t); static bool FDIV(PPUThread&, ppu_opcode_t); static bool FSUB(PPUThread&, ppu_opcode_t); static bool FADD(PPUThread&, ppu_opcode_t); static bool FSQRT(PPUThread&, ppu_opcode_t); static bool FSEL(PPUThread&, ppu_opcode_t); static bool FMUL(PPUThread&, ppu_opcode_t); static bool FRSQRTE(PPUThread&, ppu_opcode_t); static bool FMSUB(PPUThread&, ppu_opcode_t); static bool FMADD(PPUThread&, ppu_opcode_t); static bool FNMSUB(PPUThread&, ppu_opcode_t); static bool FNMADD(PPUThread&, ppu_opcode_t); static bool FCMPO(PPUThread&, ppu_opcode_t); static bool FNEG(PPUThread&, ppu_opcode_t); static bool FMR(PPUThread&, ppu_opcode_t); static bool FNABS(PPUThread&, ppu_opcode_t); static bool FABS(PPUThread&, ppu_opcode_t); static bool FCTID(PPUThread&, ppu_opcode_t); static bool FCTIDZ(PPUThread&, ppu_opcode_t); static bool FCFID(PPUThread&, ppu_opcode_t); static bool UNK(PPUThread&, ppu_opcode_t); }; struct ppu_interpreter_precise final : ppu_interpreter { // TODO }; struct ppu_interpreter_fast final : ppu_interpreter { // TODO };