mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Jit64: turn 32 bit addresses into offsets
This commit is contained in:
@ -43,6 +43,18 @@
|
||||
// to address as much as possible in a one-byte offset form.
|
||||
#define RPPCSTATE RBP
|
||||
|
||||
namespace Gen
|
||||
{
|
||||
|
||||
inline OpArg MPIC(const void* address, X64Reg scale_reg, int scale = SCALE_1)
|
||||
{
|
||||
ptrdiff_t offset = PPCSTATE_OFS(address);
|
||||
_dbg_assert_(DYNA_REC, FitsInS32(offset));
|
||||
return MComplex(RPPCSTATE, scale_reg, scale, offset);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Use these to control the instruction selection
|
||||
// #define INSTRUCTION_START FallBackToInterpreter(inst); return;
|
||||
// #define INSTRUCTION_START PPCTables::CountInstruction(inst);
|
||||
|
@ -173,11 +173,11 @@ private:
|
||||
u32 all_ones = (1ULL << sbits) - 1;
|
||||
if ((all_ones & mask) == all_ones)
|
||||
{
|
||||
MoveOpArgToReg(sbits, MDisp(RSCRATCH, 0));
|
||||
MoveOpArgToReg(sbits, MatR(RSCRATCH));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_code->MOVZX(32, sbits, m_dst_reg, MDisp(RSCRATCH, 0));
|
||||
m_code->MOVZX(32, sbits, m_dst_reg, MatR(RSCRATCH));
|
||||
m_code->AND(32, R(m_dst_reg), Imm32(mask));
|
||||
if (m_sign_extend)
|
||||
m_code->MOVSX(32, sbits, m_dst_reg, R(m_dst_reg));
|
||||
|
@ -14,8 +14,8 @@ namespace MMIO { class Mapping; }
|
||||
|
||||
// We offset by 0x80 because the range of one byte memory offsets is
|
||||
// -0x80..0x7f.
|
||||
#define PPCSTATE(x) MDisp(RPPCSTATE, \
|
||||
(int) ((char *) &PowerPC::ppcState.x - (char *) &PowerPC::ppcState) - 0x80)
|
||||
#define PPCSTATE_OFS(x) ((u8*)(x) - (u8*)&PowerPC::ppcState - 0x80)
|
||||
#define PPCSTATE(x) MDisp(RPPCSTATE, PPCSTATE_OFS(&PowerPC::ppcState.x))
|
||||
// In case you want to disable the ppcstate register:
|
||||
// #define PPCSTATE(x) M(&PowerPC::ppcState.x)
|
||||
#define PPCSTATE_LR PPCSTATE(spr[SPR_LR])
|
||||
|
Reference in New Issue
Block a user