mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Jit64: Extract handling of immediate Rc
This commit is contained in:
parent
b74c3faa48
commit
2dead5009b
@ -122,6 +122,7 @@ public:
|
||||
void FinalizeCarry(Gen::CCFlags cond);
|
||||
void FinalizeCarry(bool ca);
|
||||
void ComputeRC(preg_t preg, bool needs_test = true, bool needs_sext = true);
|
||||
void FinalizeImmediateRC(s32 value);
|
||||
|
||||
void AndWithMask(Gen::X64Reg reg, u32 mask);
|
||||
void RotateLeft(int bits, Gen::X64Reg regOp, const Gen::OpArg& arg, u8 rotate);
|
||||
|
||||
@ -150,7 +150,10 @@ void Jit64::ComputeRC(preg_t preg, bool needs_test, bool needs_sext)
|
||||
|
||||
if (arg.IsImm())
|
||||
{
|
||||
MOV(64, PPCSTATE_CR(0), Imm32(arg.SImm32()));
|
||||
const s32 value = arg.SImm32();
|
||||
arg.Unlock();
|
||||
FinalizeImmediateRC(value);
|
||||
return;
|
||||
}
|
||||
else if (needs_sext)
|
||||
{
|
||||
@ -163,14 +166,6 @@ void Jit64::ComputeRC(preg_t preg, bool needs_test, bool needs_sext)
|
||||
}
|
||||
|
||||
if (CheckMergedBranch(0))
|
||||
{
|
||||
if (arg.IsImm())
|
||||
{
|
||||
s32 offset = arg.SImm32();
|
||||
arg.Unlock();
|
||||
DoMergedBranchImmediate(offset);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (needs_test)
|
||||
{
|
||||
@ -189,6 +184,13 @@ void Jit64::ComputeRC(preg_t preg, bool needs_test, bool needs_sext)
|
||||
DoMergedBranchCondition();
|
||||
}
|
||||
}
|
||||
|
||||
void Jit64::FinalizeImmediateRC(s32 value)
|
||||
{
|
||||
MOV(64, PPCSTATE_CR(0), Imm32(value));
|
||||
|
||||
if (CheckMergedBranch(0))
|
||||
DoMergedBranchImmediate(value);
|
||||
}
|
||||
|
||||
// we can't do this optimization in the emitter because MOVZX and AND have different effects on
|
||||
|
||||
Loading…
Reference in New Issue
Block a user