a32_jitstate: Consolidate upper bits of location descriptor into upper_location_descriptor

Also solves a performance regression initially introduced by b6e8297e369f2dc4758bafe944e51efb8d1a2552,
primarily due to excessively mismatched load/store sizes causing less than optimal load-to-store forwarding.
This commit is contained in:
MerryMage 2019-07-25 11:40:40 +01:00
parent e41a7dc678
commit 2f2a859615
5 changed files with 86 additions and 97 deletions

View file

@ -34,10 +34,10 @@ public:
explicit LocationDescriptor(const IR::LocationDescriptor& o) {
arm_pc = static_cast<u32>(o.Value());
cpsr.T(o.Value() & (u64(0x01) << 32));
cpsr.E(o.Value() & (u64(0x10) << 32));
cpsr.T((o.Value() >> 32) & 1);
cpsr.E((o.Value() >> 32) & 2);
fpscr = (o.Value() >> 32) & FPSCR_MODE_MASK;
cpsr.IT(ITState{static_cast<u8>(o.Value() >> 40)});
fpscr = static_cast<u32>(o.Value() >> 32) & FPSCR_MODE_MASK;
}
u32 PC() const { return arm_pc; }
@ -92,12 +92,13 @@ public:
u64 UniqueHash() const noexcept {
// This value MUST BE UNIQUE.
// This calculation has to match up with EmitX64::EmitTerminalPopRSBHint
const u64 pc_u64 = u64(arm_pc);
const u64 fpscr_u64 = u64(fpscr.Value()) << 32;
const u64 it_u64 = u64(cpsr.IT().Value()) << 40;
const u64 t_u64 = cpsr.T() ? u64(0x01) << 32 : 0;
const u64 e_u64 = cpsr.E() ? u64(0x10) << 32 : 0;
return pc_u64 | fpscr_u64 | it_u64 | t_u64 | e_u64;
const u64 pc_u64 = arm_pc;
const u64 fpscr_u64 = fpscr.Value();
const u64 t_u64 = cpsr.T() ? 1 : 0;
const u64 e_u64 = cpsr.E() ? 2 : 0;
const u64 it_u64 = u64(cpsr.IT().Value()) << 8;
const u64 upper = (fpscr_u64 | t_u64 | e_u64 | it_u64) << 32;
return pc_u64 | upper;
}
operator IR::LocationDescriptor() const {