2014-06-28 01:53:52 -04:00
|
|
|
#pragma once
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
#include "MIPSCoprocessor.h"
|
|
|
|
#include "MIPSReflection.h"
|
|
|
|
|
|
|
|
class CCOP_FPU : public CMIPSCoprocessor
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CCOP_FPU(MIPS_REGSIZE);
|
2016-08-29 22:22:34 +09:00
|
|
|
void CompileInstruction(uint32, CMipsJitter*, CMIPS*) override;
|
|
|
|
void GetInstruction(uint32, char*) override;
|
|
|
|
void GetArguments(uint32, uint32, char*) override;
|
|
|
|
uint32 GetEffectiveAddress(uint32, uint32) override;
|
|
|
|
MIPS_BRANCH_TYPE IsBranch(uint32) override;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetupReflectionTables();
|
|
|
|
|
|
|
|
static void ReflOpRtFs(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpRtFcs(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFdFs(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFdFt(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFsFt(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpCcFsFt(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFdFsFt(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpFtOffRs(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
static void ReflOpCcOff(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32, char*, unsigned int);
|
|
|
|
|
|
|
|
static uint32 ReflEaOffset(MIPSReflection::INSTRUCTION*, CMIPS*, uint32, uint32);
|
|
|
|
|
2014-09-28 02:37:55 -04:00
|
|
|
MIPSReflection::INSTRUCTION m_reflGeneral[64];
|
|
|
|
MIPSReflection::INSTRUCTION m_reflCop1[32];
|
|
|
|
MIPSReflection::INSTRUCTION m_reflBc1[4];
|
|
|
|
MIPSReflection::INSTRUCTION m_reflS[64];
|
|
|
|
MIPSReflection::INSTRUCTION m_reflW[64];
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2014-09-28 02:37:55 -04:00
|
|
|
MIPSReflection::SUBTABLE m_reflGeneralTable;
|
|
|
|
MIPSReflection::SUBTABLE m_reflCop1Table;
|
|
|
|
MIPSReflection::SUBTABLE m_reflBc1Table;
|
|
|
|
MIPSReflection::SUBTABLE m_reflSTable;
|
|
|
|
MIPSReflection::SUBTABLE m_reflWTable;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
private:
|
2009-03-30 04:57:52 +00:00
|
|
|
typedef void (CCOP_FPU::*InstructionFuncConstant)();
|
|
|
|
|
2014-09-28 02:37:55 -04:00
|
|
|
uint8 m_ft = 0;
|
|
|
|
uint8 m_fs = 0;
|
|
|
|
uint8 m_fd = 0;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2014-09-28 02:37:55 -04:00
|
|
|
static const uint32 m_ccMask[8];
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2014-06-28 01:53:52 -04:00
|
|
|
void SetCCBit(bool, uint32);
|
|
|
|
void PushCCBit(uint32);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2014-09-28 02:37:55 -04:00
|
|
|
static InstructionFuncConstant m_opGeneral[0x20];
|
|
|
|
static InstructionFuncConstant m_opSingle[0x40];
|
|
|
|
static InstructionFuncConstant m_opWord[0x40];
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//General
|
2014-06-28 01:53:52 -04:00
|
|
|
void MFC1();
|
2010-04-29 03:47:06 +00:00
|
|
|
void CFC1();
|
2014-06-28 01:53:52 -04:00
|
|
|
void MTC1();
|
|
|
|
void CTC1();
|
|
|
|
void BC1();
|
|
|
|
void S();
|
|
|
|
void W();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Branch
|
2014-06-28 01:53:52 -04:00
|
|
|
void BC1F();
|
|
|
|
void BC1T();
|
|
|
|
void BC1FL();
|
|
|
|
void BC1TL();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Single
|
2014-06-28 01:53:52 -04:00
|
|
|
void ADD_S();
|
|
|
|
void SUB_S();
|
|
|
|
void MUL_S();
|
|
|
|
void DIV_S();
|
|
|
|
void SQRT_S();
|
|
|
|
void ABS_S();
|
|
|
|
void MOV_S();
|
|
|
|
void NEG_S();
|
2010-04-29 03:47:06 +00:00
|
|
|
void TRUNC_W_S();
|
2011-10-17 23:15:56 +00:00
|
|
|
void RSQRT_S();
|
2014-06-28 01:53:52 -04:00
|
|
|
void ADDA_S();
|
2011-11-22 02:55:52 +00:00
|
|
|
void SUBA_S();
|
2014-06-28 01:53:52 -04:00
|
|
|
void MULA_S();
|
|
|
|
void MADD_S();
|
|
|
|
void MSUB_S();
|
2014-06-30 22:40:02 -04:00
|
|
|
void MADDA_S();
|
|
|
|
void MSUBA_S();
|
2014-06-28 01:53:52 -04:00
|
|
|
void CVT_W_S();
|
2014-06-28 01:56:13 -04:00
|
|
|
void MAX_S();
|
|
|
|
void MIN_S();
|
2015-04-23 02:01:47 -04:00
|
|
|
void C_F_S();
|
2014-06-28 01:53:52 -04:00
|
|
|
void C_EQ_S();
|
|
|
|
void C_LT_S();
|
|
|
|
void C_LE_S();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Word
|
2014-06-28 01:53:52 -04:00
|
|
|
void CVT_S_W();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Misc
|
2014-06-28 01:53:52 -04:00
|
|
|
void LWC1();
|
|
|
|
void SWC1();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
//Reflection tables
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflGeneral[64];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflCop1[32];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflBc1[4];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflS[64];
|
|
|
|
static MIPSReflection::INSTRUCTION m_cReflW[64];
|
|
|
|
};
|