[ARM32] Moves loadstore extend flag to backpatch code.

This commit is contained in:
Ryan Houdek 2014-11-29 06:47:07 +00:00
parent 32dc105aa3
commit 52c6fb180b
3 changed files with 28 additions and 4 deletions

View File

@ -60,6 +60,7 @@ private:
FLAG_SIZE_F32 = (1 << 5),
FLAG_SIZE_F64 = (1 << 6),
FLAG_REVERSE = (1 << 7),
FLAG_EXTEND = (1 << 8),
};
u32 m_fastmem_size;

View File

@ -300,6 +300,9 @@ u32 JitArm::EmitBackpatchRoutine(ARMXEmitter* emit, u32 flags, bool fastmem, boo
else if (flags & BackPatchInfo::FLAG_SIZE_16)
emit->REV16(RS, RS);
}
if (flags & BackPatchInfo::FLAG_EXTEND)
emit->SXTH(RS, RS);
}
}
else
@ -590,7 +593,6 @@ void JitArm::InitBackpatch()
m_backpatch_info[flags] = info;
}
// 16bit - reverse
{
flags =
@ -612,6 +614,27 @@ void JitArm::InitBackpatch()
m_backpatch_info[flags] = info;
}
// 16bit - sign extend
{
flags =
BackPatchInfo::FLAG_LOAD |
BackPatchInfo::FLAG_SIZE_16 |
BackPatchInfo::FLAG_EXTEND;
EmitBackpatchRoutine(this, flags, false, false, R0);
code_end = GetWritableCodePtr();
info.m_slowmem_size = (code_end - code_base) / 4;
SetCodePtr(code_base);
info.m_fastmem_trouble_inst_offset =
EmitBackpatchRoutine(this, flags, true, false, R0);
code_end = GetWritableCodePtr();
info.m_fastmem_size = (code_end - code_base) / 4;
SetCodePtr(code_base);
m_backpatch_info[flags] = info;
}
// 32bit - reverse
{
flags =

View File

@ -347,13 +347,13 @@ void JitArm::SafeLoadToReg(ARMReg dest, s32 addr, s32 offsetReg, int accessSize,
if (reverse)
flags |= BackPatchInfo::FLAG_REVERSE;
if (signExtend)
flags |= BackPatchInfo::FLAG_EXTEND;
EmitBackpatchRoutine(this, flags,
SConfig::GetInstance().m_LocalCoreStartupParameter.bFastmem,
!(is_immediate && Memory::IsRAMAddress(imm_addr)), dest);
if (signExtend) // Only on 16 loads
SXTH(dest, dest);
if (update)
MOV(gpr.R(addr), rA);
}