Play-/Source/MIPSInstructionFactory.h

50 lines
1 KiB
C
Raw Permalink Normal View History

2016-12-28 11:23:32 -05:00
#pragma once
#include "Types.h"
#include "MipsJitter.h"
class CMIPS;
enum MIPS_REGSIZE
{
2018-04-30 21:01:23 +01:00
MIPS_REGSIZE_32 = 0,
MIPS_REGSIZE_64 = 1,
};
enum MIPS_BRANCH_TYPE
{
2018-04-30 21:01:23 +01:00
MIPS_BRANCH_NONE = 0,
MIPS_BRANCH_NORMAL = 1,
MIPS_BRANCH_NODELAY = 2,
};
class CMIPSInstructionFactory
{
public:
2018-04-30 21:01:23 +01:00
CMIPSInstructionFactory(MIPS_REGSIZE);
virtual ~CMIPSInstructionFactory() = default;
virtual void CompileInstruction(uint32, CMipsJitter*, CMIPS*, uint32) = 0;
2019-07-09 16:08:56 +01:00
void Illegal();
protected:
2018-04-30 21:01:23 +01:00
void ComputeMemAccessAddr();
2016-07-16 21:32:23 -04:00
void ComputeMemAccessAddrNoXlat();
void ComputeMemAccessRef(uint32);
void ComputeMemAccessRefIdx(uint32);
2016-07-16 21:32:23 -04:00
void ComputeMemAccessPageRef();
void CheckTLBExceptions(bool);
void CheckTrap();
2018-04-30 21:01:23 +01:00
void Branch(Jitter::CONDITION);
void BranchLikely(Jitter::CONDITION);
void SetupQuickVariables(uint32, CMipsJitter*, CMIPS*, uint32);
2018-04-30 21:01:23 +01:00
CMipsJitter* m_codeGen = nullptr;
CMIPS* m_pCtx = nullptr;
uint32 m_nOpcode = 0;
uint32 m_nAddress = 0;
uint32 m_instrPosition = 0;
2018-04-30 21:01:23 +01:00
MIPS_REGSIZE m_regSize;
};