JIT: base

all instructions are interpreted
This commit is contained in:
RSDuck
2019-06-22 01:28:32 +02:00
parent aa6ff499f9
commit c692287eba
27 changed files with 7700 additions and 2 deletions

View File

@ -0,0 +1,54 @@
#ifndef ARMJIT_COMPILER_H
#define ARMJIT_COMPILER_H
#include "../dolphin/x64Emitter.h"
#include "../ARMJIT.h"
namespace ARMJIT
{
const Gen::X64Reg RCPU = Gen::RBP;
const Gen::X64Reg RCycles = Gen::R14;
const Gen::X64Reg RCPSR = Gen::R15;
const Gen::X64Reg RSCRATCH = Gen::EAX;
const Gen::X64Reg RSCRATCH2 = Gen::EDX;
const Gen::X64Reg RSCRATCH3 = Gen::ECX;
class Compiler : public Gen::X64CodeBlock
{
public:
Compiler();
CompiledBlock CompileBlock(ARM* cpu, FetchedInstr instrs[], int instrsCount);
void StartBlock(ARM* cpu);
CompiledBlock FinaliseBlock();
void Compile(RegCache& regs, const FetchedInstr& instr);
private:
void AddCycles_C();
Gen::OpArg Comp_ShiftRegImm(int op, int amount, Gen::X64Reg rm, bool S, bool& carryUsed);
void A_Comp_ALU(const FetchedInstr& instr);
void LoadCPSR();
void SaveCPSR();
bool CPSRDirty = false;
FetchedInstr CurrentInstr;
bool Thumb;
u32 Num;
u32 R15;
u32 ConstantCycles;
};
}
#endif