a32_jitstate: Only transfer required state
Importantly, reset exclusive state upon transfer.
This commit is contained in:
parent
1aa7b62e92
commit
b4884a51e0
2 changed files with 27 additions and 2 deletions
|
@ -272,13 +272,13 @@ void TransferJitState(A32JitState& dest, const A32JitState& src, bool reset_rsb)
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::SaveContext(Context& ctx) const {
|
void Jit::SaveContext(Context& ctx) const {
|
||||||
TransferJitState(ctx.impl->jit_state, impl->jit_state, false);
|
ctx.impl->jit_state.TransferJitState(impl->jit_state, false);
|
||||||
ctx.impl->invalid_cache_generation = impl->invalid_cache_generation;
|
ctx.impl->invalid_cache_generation = impl->invalid_cache_generation;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit::LoadContext(const Context& ctx) {
|
void Jit::LoadContext(const Context& ctx) {
|
||||||
bool reset_rsb = ctx.impl->invalid_cache_generation != impl->invalid_cache_generation;
|
bool reset_rsb = ctx.impl->invalid_cache_generation != impl->invalid_cache_generation;
|
||||||
TransferJitState(impl->jit_state, ctx.impl->jit_state, reset_rsb);
|
impl->jit_state.TransferJitState(ctx.impl->jit_state, reset_rsb);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string Jit::Disassemble(const IR::LocationDescriptor& descriptor) {
|
std::string Jit::Disassemble(const IR::LocationDescriptor& descriptor) {
|
||||||
|
|
|
@ -76,6 +76,31 @@ struct A32JitState {
|
||||||
u64 GetUniqueHash() const noexcept {
|
u64 GetUniqueHash() const noexcept {
|
||||||
return (static_cast<u64>(upper_location_descriptor) << 32) | (static_cast<u64>(Reg[15]));
|
return (static_cast<u64>(upper_location_descriptor) << 32) | (static_cast<u64>(Reg[15]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TransferJitState(const A32JitState& src, bool reset_rsb) {
|
||||||
|
Reg = src.Reg;
|
||||||
|
upper_location_descriptor = src.upper_location_descriptor;
|
||||||
|
cpsr_ge = src.cpsr_ge;
|
||||||
|
cpsr_q = src.cpsr_q;
|
||||||
|
cpsr_nzcv = src.cpsr_nzcv;
|
||||||
|
cpsr_jaifm = src.cpsr_jaifm;
|
||||||
|
ExtReg = src.ExtReg;
|
||||||
|
guest_MXCSR = src.guest_MXCSR;
|
||||||
|
fpsr_exc = src.fpsr_exc;
|
||||||
|
fpsr_qc = src.fpsr_qc;
|
||||||
|
fpsr_nzcv = src.fpsr_nzcv;
|
||||||
|
|
||||||
|
exclusive_state = 0;
|
||||||
|
exclusive_address = 0;
|
||||||
|
|
||||||
|
if (reset_rsb) {
|
||||||
|
ResetRSB();
|
||||||
|
} else {
|
||||||
|
rsb_ptr = src.rsb_ptr;
|
||||||
|
rsb_location_descriptors = src.rsb_location_descriptors;
|
||||||
|
rsb_codeptrs = src.rsb_codeptrs;
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
Loading…
Reference in a new issue