JitX64: Removed old page table code

This commit is contained in:
MerryMage 2016-04-03 17:02:28 +01:00
parent 6eddd09f30
commit d9cf6474cf
4 changed files with 2 additions and 51 deletions

View File

@ -34,7 +34,6 @@ struct JitState {
u64 save_host_RSP; u64 save_host_RSP;
u64 return_RIP; u64 return_RIP;
void* page_table;
s32 cycles_remaining; s32 cycles_remaining;
}; };

View File

@ -161,8 +161,6 @@ void ARM_Jit::ExecuteInstructions(int num_instructions) {
reschedule = false; reschedule = false;
do { do {
//state->page_table = reinterpret_cast<void*>(Memory::current_page_table->pointers.data());
bool EFlag = (state->cpu_state.Cpsr >> 9) & 1; bool EFlag = (state->cpu_state.Cpsr >> 9) & 1;
state->cpu_state.TFlag = (state->cpu_state.Cpsr >> 5) & 1; state->cpu_state.TFlag = (state->cpu_state.Cpsr >> 5) & 1;

View File

@ -32,7 +32,7 @@ static const std::map<Gen::X64Reg, size_t> x64_reg_to_index = {
constexpr Gen::X64Reg jit_state_reg = Gen::R15; constexpr Gen::X64Reg jit_state_reg = Gen::R15;
Gen::X64Reg RegAlloc::JitStateReg() { Gen::X64Reg RegAlloc::JitStateReg() const {
return jit_state_reg; return jit_state_reg;
} }
@ -46,10 +46,6 @@ static Gen::OpArg MJitStateCpuReg(ArmReg arm_reg) {
return Gen::MDisp(jit_state_reg, offsetof(JitState, cpu_state) + offsetof(ARMul_State, Reg) + (arm_reg) * sizeof(u32)); return Gen::MDisp(jit_state_reg, offsetof(JitState, cpu_state) + offsetof(ARMul_State, Reg) + (arm_reg) * sizeof(u32));
} }
static Gen::OpArg MJitStateMemoryMap() {
return Gen::MDisp(jit_state_reg, offsetof(JitState, page_table));
}
void RegAlloc::Init(Gen::XEmitter* emitter) { void RegAlloc::Init(Gen::XEmitter* emitter) {
code = emitter; code = emitter;
@ -72,7 +68,6 @@ void RegAlloc::FlushX64(Gen::X64Reg x64_reg) {
switch (state.state) { switch (state.state) {
case X64State::State::Free: case X64State::State::Free:
case X64State::State::MemoryMap:
case X64State::State::Temp: case X64State::State::Temp:
state.state = X64State::State::Free; state.state = X64State::State::Free;
break; break;
@ -330,38 +325,6 @@ void RegAlloc::UnlockTemp(Gen::X64Reg x64_reg) {
x64_state.state = X64State::State::Free; x64_state.state = X64State::State::Free;
} }
Gen::X64Reg RegAlloc::LoadMemoryMap() {
// First check to see if it exists.
for (auto i : x64_reg_to_index) {
X64State& x64_state = x64_gpr[i.second];
if (x64_state.state == X64State::State::MemoryMap) {
ASSERT(!x64_state.locked);
x64_state.locked = true;
return i.first;
}
}
// Otherwise allocate it.
const Gen::X64Reg x64_reg = AllocReg();
X64State& x64_state = x64_gpr[x64_reg_to_index.at(x64_reg)];
x64_state.locked = true;
x64_state.state = X64State::State::MemoryMap;
code->MOV(64, R(x64_reg), MJitStateMemoryMap());
return x64_reg;
}
void RegAlloc::UnlockMemoryMap(Gen::X64Reg x64_reg) {
X64State& x64_state = x64_gpr[x64_reg_to_index.at(x64_reg)];
ASSERT(x64_state.locked);
ASSERT(x64_state.state == X64State::State::MemoryMap);
x64_state.locked = false;
}
void RegAlloc::AssertNoLocked() { void RegAlloc::AssertNoLocked() {
for (ArmReg arm_reg = 0; arm_reg < arm_gpr.size(); arm_reg++) { for (ArmReg arm_reg = 0; arm_reg < arm_gpr.size(); arm_reg++) {
ArmState& arm_state = arm_gpr[arm_reg]; ArmState& arm_state = arm_gpr[arm_reg];

View File

@ -42,7 +42,6 @@ private:
* CleanArmReg (arm_reg is valid): This x64 reg is bound to an ARM reg. * CleanArmReg (arm_reg is valid): This x64 reg is bound to an ARM reg.
* It hasn't been written to (i.e.: value is still the same as the in-memory version). * It hasn't been written to (i.e.: value is still the same as the in-memory version).
* This value WILL NOT be flushed back to memory. * This value WILL NOT be flushed back to memory.
* MemoryMap: This value holds a pointer to the ARM page table (currently unimplemented).
* UserManuallyLocked: User has called LockX64 on this register. User must call UnlockX64 to unlock. * UserManuallyLocked: User has called LockX64 on this register. User must call UnlockX64 to unlock.
*/ */
struct X64State { struct X64State {
@ -51,7 +50,6 @@ private:
Temp, Temp,
DirtyArmReg, DirtyArmReg,
CleanArmReg, CleanArmReg,
MemoryMap,
UserManuallyLocked UserManuallyLocked
}; };
@ -142,17 +140,10 @@ public:
/// Releases a temporary register /// Releases a temporary register
void UnlockTemp(Gen::X64Reg x64_reg); void UnlockTemp(Gen::X64Reg x64_reg);
// Page table:
/// Gets the x64 register with the address of the memory map in it. Allocates one if one doesn't already exist.
Gen::X64Reg LoadMemoryMap();
/// Releases the memory map register.
void UnlockMemoryMap(Gen::X64Reg x64_reg);
// JitState pointer: // JitState pointer:
/// Returns the register in which the JitState pointer is stored. /// Returns the register in which the JitState pointer is stored.
Gen::X64Reg JitStateReg(); Gen::X64Reg JitStateReg() const;
// Flush: // Flush: