2016-12-28 11:23:32 -05:00
|
|
|
#pragma once
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
#include "Types.h"
|
2010-08-11 03:47:19 +00:00
|
|
|
#include "MipsJitter.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
class CMIPS;
|
|
|
|
|
|
|
|
enum MIPS_REGSIZE
|
|
|
|
{
|
2018-04-30 21:01:23 +01:00
|
|
|
MIPS_REGSIZE_32 = 0,
|
|
|
|
MIPS_REGSIZE_64 = 1,
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
2011-12-10 20:49:50 +00:00
|
|
|
enum MIPS_BRANCH_TYPE
|
|
|
|
{
|
2018-04-30 21:01:23 +01:00
|
|
|
MIPS_BRANCH_NONE = 0,
|
|
|
|
MIPS_BRANCH_NORMAL = 1,
|
|
|
|
MIPS_BRANCH_NODELAY = 2,
|
2011-12-10 20:49:50 +00:00
|
|
|
};
|
|
|
|
|
2006-06-15 04:19:30 +00:00
|
|
|
class CMIPSInstructionFactory
|
|
|
|
{
|
|
|
|
public:
|
2018-04-30 21:01:23 +01:00
|
|
|
CMIPSInstructionFactory(MIPS_REGSIZE);
|
|
|
|
virtual ~CMIPSInstructionFactory() = default;
|
2022-10-18 20:01:20 +01:00
|
|
|
virtual void CompileInstruction(uint32, CMipsJitter*, CMIPS*, uint32) = 0;
|
2019-07-09 16:08:56 +01:00
|
|
|
void Illegal();
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
2018-04-30 21:01:23 +01:00
|
|
|
void ComputeMemAccessAddr();
|
2016-07-16 21:32:23 -04:00
|
|
|
void ComputeMemAccessAddrNoXlat();
|
|
|
|
void ComputeMemAccessRef(uint32);
|
2023-07-21 16:22:15 -04:00
|
|
|
void ComputeMemAccessRefIdx(uint32);
|
2016-07-16 21:32:23 -04:00
|
|
|
void ComputeMemAccessPageRef();
|
|
|
|
|
2020-08-04 13:29:59 -04:00
|
|
|
void CheckTLBExceptions(bool);
|
2023-02-27 15:08:49 -05:00
|
|
|
void CheckTrap();
|
2018-04-30 21:01:23 +01:00
|
|
|
void Branch(Jitter::CONDITION);
|
|
|
|
void BranchLikely(Jitter::CONDITION);
|
|
|
|
|
2022-10-18 20:01:20 +01:00
|
|
|
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;
|
2022-10-18 20:01:20 +01:00
|
|
|
uint32 m_instrPosition = 0;
|
2018-04-30 21:01:23 +01:00
|
|
|
MIPS_REGSIZE m_regSize;
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|