2006-06-15 04:19:30 +00:00
|
|
|
#ifndef _MIPSINSTRUCTIONFACTORY_H_
|
|
|
|
#define _MIPSINSTRUCTIONFACTORY_H_
|
|
|
|
|
2007-12-01 04:08:34 +00:00
|
|
|
#include "Types.h"
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
class CMIPS;
|
2008-04-09 02:52:38 +00:00
|
|
|
class CCodeGen;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
enum MIPS_REGSIZE
|
|
|
|
{
|
|
|
|
MIPS_REGSIZE_32 = 0,
|
|
|
|
MIPS_REGSIZE_64 = 1,
|
|
|
|
};
|
|
|
|
|
|
|
|
class CMIPSInstructionFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CMIPSInstructionFactory(MIPS_REGSIZE);
|
|
|
|
virtual ~CMIPSInstructionFactory();
|
2008-04-09 02:52:38 +00:00
|
|
|
virtual void CompileInstruction(uint32, CCodeGen*, CMIPS*, bool) = 0;
|
2006-06-15 04:19:30 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
static void ComputeMemAccessAddr();
|
|
|
|
static void Branch(bool);
|
|
|
|
static void BranchLikely(bool);
|
|
|
|
|
|
|
|
static void Illegal();
|
2008-04-09 02:52:38 +00:00
|
|
|
static void SetupQuickVariables(uint32, CCodeGen*, CMIPS*);
|
2006-06-15 04:19:30 +00:00
|
|
|
|
2008-04-09 02:52:38 +00:00
|
|
|
static CCodeGen* m_codeGen;
|
2008-04-07 00:51:28 +00:00
|
|
|
static CMIPS* m_pCtx;
|
|
|
|
static uint32 m_nOpcode;
|
|
|
|
static uint32 m_nAddress;
|
2006-06-15 04:19:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|