Some JIT fixes
This commit is contained in:
@@ -1003,7 +1003,6 @@ void JIT::ldr(u32 instr) {
|
||||
// regs.cop0.FireException(Cop0::GetTLBExceptionCode(regs.cop0.tlbError, Cop0::LOAD), 0, regs.oldPC);
|
||||
Util::panic("[JIT]: Unhandled TLBL exception in LDR!");
|
||||
} else {
|
||||
Util::panic("[JIT]: Implement constant LDR!");
|
||||
const s32 shift = 8 * ((address ^ 7) & 7);
|
||||
const u64 mask = 0xFFFFFFFFFFFFFFFF >> shift;
|
||||
const u64 data = mem.Read<u64>(regs, paddr & ~7);
|
||||
@@ -1073,7 +1072,7 @@ void JIT::lhu(u32 instr) {
|
||||
emitMemberFunctionCall(&Cop0::MapVAddr, ®s.cop0);
|
||||
|
||||
code.mov(code.ARG2, code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, paddr);
|
||||
code.mov(code.ARG3, code.qword[code.ARG4]);
|
||||
emitMemberFunctionCall(&Mem::Read<u16>, &mem);
|
||||
regs.Write<u16>(RT(instr), code.rax);
|
||||
}
|
||||
@@ -1110,13 +1109,15 @@ void JIT::lw(u32 instr) {
|
||||
}
|
||||
|
||||
code.mov(code.ARG2, Cop0::LOAD);
|
||||
|
||||
regs.Read<s64>(RS(instr), code.ARG3);
|
||||
code.add(code.ARG3, offset);
|
||||
|
||||
code.mov(code.ARG4, reinterpret_cast<uintptr_t>(&paddr));
|
||||
emitMemberFunctionCall(&Cop0::MapVAddr, ®s.cop0);
|
||||
|
||||
code.mov(code.ARG2, code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, paddr);
|
||||
code.mov(code.ARG3, code.qword[code.ARG4]);
|
||||
emitMemberFunctionCall(&Mem::Read<u32>, &mem);
|
||||
regs.Write<s32>(RT(instr), code.rax);
|
||||
}
|
||||
@@ -1366,7 +1367,7 @@ void JIT::sw(const u32 instr) {
|
||||
code.lea(code.ARG2,
|
||||
code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, physical);
|
||||
code.mov(code.ARG4, regs.Read<s64>(RT(instr)));
|
||||
regs.Read<s64>(RT(instr), code.ARG4);
|
||||
emitMemberFunctionCall(&Mem::WriteJIT<u32>, &mem);
|
||||
}
|
||||
|
||||
@@ -1391,7 +1392,7 @@ void JIT::sw(const u32 instr) {
|
||||
code.mov(code.ARG2,
|
||||
code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, physical);
|
||||
regs.Read<s64>(RT(instr), code.rcx);
|
||||
regs.Read<s64>(RT(instr), code.ARG4);
|
||||
emitMemberFunctionCall(&Mem::WriteJIT<u32>, &mem);
|
||||
}
|
||||
|
||||
@@ -1400,33 +1401,33 @@ void JIT::sw(const u32 instr) {
|
||||
|
||||
if (regs.IsRegConstant(RT(instr))) {
|
||||
const s16 offset = instr;
|
||||
regs.Read<s64>(RS(instr), code.rdx);
|
||||
code.add(code.ARG3, offset);
|
||||
|
||||
code.mov(code.ARG2, Cop0::STORE);
|
||||
|
||||
regs.Read<s64>(RS(instr), code.ARG3);
|
||||
code.add(code.ARG3, offset);
|
||||
|
||||
code.mov(code.ARG4, reinterpret_cast<uintptr_t>(&physical));
|
||||
emitMemberFunctionCall(&Cop0::MapVAddr, ®s.cop0);
|
||||
|
||||
code.mov(code.ARG2, code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, physical);
|
||||
code.mov(code.ARG4, regs.Read<s64>(RT(instr)));
|
||||
code.mov(code.ARG3, code.qword[code.ARG4]);
|
||||
regs.Read<s64>(RT(instr), code.ARG4);
|
||||
emitMemberFunctionCall(&Mem::WriteJIT<u32>, &mem);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const s16 offset = instr;
|
||||
code.mov(code.ARG2, Cop0::STORE);
|
||||
|
||||
regs.Read<s64>(RS(instr), code.rdx);
|
||||
code.add(code.ARG3, offset);
|
||||
|
||||
code.mov(code.ARG2, Cop0::STORE);
|
||||
|
||||
code.mov(code.ARG4, reinterpret_cast<uintptr_t>(&physical));
|
||||
emitMemberFunctionCall(&Cop0::MapVAddr, ®s.cop0);
|
||||
|
||||
code.mov(code.ARG2, code.ptr[code.rbp + (reinterpret_cast<uintptr_t>(®s) - reinterpret_cast<uintptr_t>(this))]);
|
||||
code.mov(code.ARG3, physical);
|
||||
code.mov(code.ARG3, code.qword[code.ARG4]);
|
||||
regs.Read<s64>(RT(instr), code.ARG4);
|
||||
emitMemberFunctionCall(&Mem::WriteJIT<u32>, &mem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user