2006-06-15 04:19:30 +00:00
|
|
|
#ifndef _COP_VU_H_
|
|
|
|
#define _COP_VU_H_
|
|
|
|
|
|
|
|
#include "MIPSCoprocessor.h"
|
|
|
|
#include "MIPSReflection.h"
|
|
|
|
|
|
|
|
class CCOP_VU : public CMIPSCoprocessor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CCOP_VU(MIPS_REGSIZE);
|
|
|
|
|
2010-09-03 21:13:57 +00:00
|
|
|
virtual void CompileInstruction(uint32, CMipsJitter*, CMIPS*);
|
2006-06-15 04:19:30 +00:00
|
|
|
virtual void GetInstruction(uint32, char*);
|
|
|
|
virtual void GetArguments(uint32, uint32, char*);
|
|
|
|
virtual uint32 GetEffectiveAddress(uint32, uint32);
|
2011-12-10 20:49:50 +00:00
|
|
|
virtual MIPS_BRANCH_TYPE IsBranch(uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
2009-03-30 04:57:52 +00:00
|
|
|
typedef void (CCOP_VU::*InstructionFuncConstant)();
|
|
|
|
|
2006-06-15 04:19:30 +00:00
|
|
|
void SetupReflectionTables();
|
|
|
|
|
|
|
|
static void ReflMnemI(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, char*, unsigned int);
|
|
|
|
|
|
|
|
static void ReflOpRtFd(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpRtId(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
2011-10-23 20:22:29 +00:00
|
|
|
static void ReflOpImm15(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
2006-06-15 04:19:30 +00:00
|
|
|
static void ReflOpAccFsFt(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFtOffRs(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
2012-10-09 01:56:38 +00:00
|
|
|
static void ReflOpVi27(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflGeneral[64];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflCop2[32];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflV[64];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflVX0[32];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflVX1[32];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflVX2[32];
|
|
|
|
MIPSReflection::INSTRUCTION m_ReflVX3[32];
|
|
|
|
|
|
|
|
MIPSReflection::SUBTABLE m_ReflGeneralTable;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflCop2Table;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflVTable;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflVX0Table;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflVX1Table;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflVX2Table;
|
|
|
|
MIPSReflection::SUBTABLE m_ReflVX3Table;
|
|
|
|
|
2012-04-01 00:57:23 +00:00
|
|
|
static InstructionFuncConstant m_pOpCop2[0x20];
|
|
|
|
static InstructionFuncConstant m_pOpVector[0x40];
|
|
|
|
static InstructionFuncConstant m_pOpVx0[0x20];
|
|
|
|
static InstructionFuncConstant m_pOpVx1[0x20];
|
|
|
|
static InstructionFuncConstant m_pOpVx2[0x20];
|
|
|
|
static InstructionFuncConstant m_pOpVx3[0x20];
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
//General
|
2012-04-01 00:57:23 +00:00
|
|
|
void LQC2();
|
|
|
|
void SQC2();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//COP2
|
2012-04-01 00:57:23 +00:00
|
|
|
void QMFC2();
|
|
|
|
void CFC2();
|
|
|
|
void QMTC2();
|
|
|
|
void CTC2();
|
|
|
|
void V();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Vector
|
2012-04-01 00:57:23 +00:00
|
|
|
void VADDbc();
|
|
|
|
void VSUBbc();
|
|
|
|
void VMADDbc();
|
|
|
|
void VMSUBbc();
|
|
|
|
void VMAXbc();
|
|
|
|
void VMINIbc();
|
|
|
|
void VMULbc();
|
|
|
|
void VMULq();
|
|
|
|
void VMULi();
|
|
|
|
void VMINIi();
|
|
|
|
void VADDq();
|
2011-11-22 06:40:29 +00:00
|
|
|
void VMADDq();
|
2012-05-02 03:46:45 +00:00
|
|
|
void VMADDi();
|
2011-11-22 06:40:29 +00:00
|
|
|
void VMSUBq();
|
2015-03-08 23:28:30 -05:00
|
|
|
void VSUBi();
|
|
|
|
void VMSUBi();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VADD();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VMADD();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VMUL();
|
|
|
|
void VMAX();
|
|
|
|
void VSUB();
|
2011-11-22 06:40:29 +00:00
|
|
|
void VMSUB();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VOPMSUB();
|
|
|
|
void VMINI();
|
2012-06-22 05:05:20 +00:00
|
|
|
void VIADD();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VIADDI();
|
2015-03-14 04:28:51 -04:00
|
|
|
void VIOR();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VCALLMS();
|
2012-10-09 01:56:38 +00:00
|
|
|
void VCALLMSR();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VX0();
|
|
|
|
void VX1();
|
|
|
|
void VX2();
|
|
|
|
void VX3();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Vx (Common)
|
2012-04-01 00:57:23 +00:00
|
|
|
void VADDAbc();
|
|
|
|
void VSUBAbc();
|
|
|
|
void VMULAbc();
|
2011-11-22 06:40:29 +00:00
|
|
|
void VMULAq();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VMADDAbc();
|
|
|
|
void VMSUBAbc();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//V0
|
2012-04-01 00:57:23 +00:00
|
|
|
void VITOF0();
|
|
|
|
void VFTOI0();
|
|
|
|
void VADDA();
|
2015-01-01 18:13:24 -05:00
|
|
|
void VSUBA();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VMOVE();
|
2015-02-18 22:30:48 -05:00
|
|
|
void VLQI();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VDIV();
|
2012-06-22 05:05:20 +00:00
|
|
|
void VMTIR();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VRNEXT();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//V1
|
2012-04-01 00:57:23 +00:00
|
|
|
void VITOF4();
|
|
|
|
void VFTOI4();
|
|
|
|
void VABS();
|
2012-10-09 01:56:38 +00:00
|
|
|
void VMADDA();
|
2011-11-22 06:40:29 +00:00
|
|
|
void VMSUBA();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VMR32();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VSQI();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VSQRT();
|
2012-10-21 01:30:33 +00:00
|
|
|
void VMFIR();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VRGET();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//V2
|
2012-04-01 00:57:23 +00:00
|
|
|
void VITOF12();
|
2009-12-16 05:55:51 +00:00
|
|
|
void VFTOI12();
|
2012-05-02 03:46:45 +00:00
|
|
|
void VMULAi();
|
2011-10-23 20:22:29 +00:00
|
|
|
void VMULA();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VOPMULA();
|
|
|
|
void VRSQRT();
|
2014-10-02 00:12:18 -04:00
|
|
|
void VILWR();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VRINIT();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//V3
|
2012-04-01 00:57:23 +00:00
|
|
|
void VITOF15();
|
2013-10-27 03:22:26 +00:00
|
|
|
void VFTOI15();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VCLIP();
|
2015-03-08 23:28:30 -05:00
|
|
|
void VMADDAi();
|
|
|
|
void VMSUBAi();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VNOP();
|
|
|
|
void VWAITQ();
|
2014-10-02 00:12:18 -04:00
|
|
|
void VISWR();
|
2012-04-01 00:57:23 +00:00
|
|
|
void VRXOR();
|
|
|
|
|
|
|
|
uint8 m_nBc;
|
|
|
|
uint8 m_nDest;
|
|
|
|
uint8 m_nFSF;
|
|
|
|
uint8 m_nFTF;
|
|
|
|
|
|
|
|
uint8 m_nFS;
|
|
|
|
uint8 m_nFT;
|
|
|
|
uint8 m_nFD;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2011-10-23 20:22:29 +00:00
|
|
|
uint8 m_nIT;
|
|
|
|
uint8 m_nIS;
|
|
|
|
uint8 m_nID;
|
|
|
|
uint8 m_nImm5;
|
|
|
|
uint16 m_nImm15;
|
|
|
|
|
2006-06-15 04:19:30 +00:00
|
|
|
//Reflection tables
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflGeneral[64];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflCop2[32];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflV[64];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflVX0[32];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflVX1[32];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflVX2[32];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflVX3[32];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|