a32_emit_x64: Update upper_location_descriptor in BXWritePC based on final location

This commit is contained in:
MerryMage 2021-02-07 20:29:09 +00:00
parent 714b0b9a8b
commit f229a68aed
2 changed files with 6 additions and 1 deletions

View file

@ -67,6 +67,10 @@ A32::LocationDescriptor A32EmitContext::Location() const {
return A32::LocationDescriptor{block.Location()};
}
A32::LocationDescriptor A32EmitContext::EndLocation() const {
return A32::LocationDescriptor{block.EndLocation()};
}
bool A32EmitContext::IsSingleStep() const {
return Location().SingleStepping();
}
@ -732,7 +736,7 @@ void A32EmitX64::EmitA32BXWritePC(A32EmitContext& ctx, IR::Inst* inst) {
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
auto& arg = args[0];
const u32 upper_without_t = (ctx.Location().SetSingleStepping(false).UniqueHash() >> 32) & 0xFFFFFFFE;
const u32 upper_without_t = (ctx.EndLocation().SetSingleStepping(false).UniqueHash() >> 32) & 0xFFFFFFFE;
// Pseudocode:
// if (new_pc & 1) {

View file

@ -29,6 +29,7 @@ struct A32EmitContext final : public EmitContext {
A32EmitContext(const A32::UserConfig& conf, RegAlloc& reg_alloc, IR::Block& block);
A32::LocationDescriptor Location() const;
A32::LocationDescriptor EndLocation() const;
bool IsSingleStep() const;
FP::FPCR FPCR(bool fpcr_controlled = true) const override;