Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #490 from Tilka/fallback_macro
JITs: add a macro for easy interpreter fallback
  • Loading branch information
neobrain committed Jun 19, 2014
2 parents 591a27e + feef0bb commit 215551c
Show file tree
Hide file tree
Showing 25 changed files with 371 additions and 945 deletions.
12 changes: 6 additions & 6 deletions Source/Core/Core/PowerPC/Jit64/Jit_Branch.cpp
Expand Up @@ -24,7 +24,7 @@ using namespace Gen;
void Jit64::sc(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

gpr.Flush();
fpr.Flush();
Expand All @@ -37,7 +37,7 @@ void Jit64::sc(UGeckoInstruction inst)
void Jit64::rfi(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

gpr.Flush();
fpr.Flush();
Expand All @@ -57,7 +57,7 @@ void Jit64::rfi(UGeckoInstruction inst)
void Jit64::bx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

// We must always process the following sentence
// even if the blocks are merged by PPCAnalyst::Flatten().
Expand Down Expand Up @@ -100,7 +100,7 @@ void Jit64::bx(UGeckoInstruction inst)
void Jit64::bcx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

// USES_CR

Expand Down Expand Up @@ -153,7 +153,7 @@ void Jit64::bcx(UGeckoInstruction inst)
void Jit64::bcctrx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

// bcctrx doesn't decrement and/or test CTR
_dbg_assert_msg_(POWERPC, inst.BO_2 & BO_DONT_DECREMENT_FLAG, "bcctrx with decrement and test CTR option is invalid!");
Expand Down Expand Up @@ -207,7 +207,7 @@ void Jit64::bcctrx(UGeckoInstruction inst)
void Jit64::bclrx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITBranchOff)
JITDISABLE(bJITBranchOff);

FixupBranch pCTRDontBranch;
if ((inst.BO & BO_DONT_DECREMENT_FLAG) == 0) // Decrement and test CTR
Expand Down
59 changes: 12 additions & 47 deletions Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp
Expand Up @@ -73,20 +73,11 @@ void Jit64::fp_tri_op(int d, int a, int b, bool reversible, bool single, void (X
void Jit64::fp_arith(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff)

if (inst.Rc)
{
FallBackToInterpreter(inst);
return;
}
JITDISABLE(bJITFloatingPointOff);
FALLBACK_IF(inst.Rc);

// Only the interpreter has "proper" support for (some) FP flags
if (inst.SUBOP5 == 25 && Core::g_CoreStartupParameter.bEnableFPRF)
{
FallBackToInterpreter(inst);
return;
}
FALLBACK_IF(inst.SUBOP5 == 25 && Core::g_CoreStartupParameter.bEnableFPRF);

bool single = inst.OPCD == 59;
switch (inst.SUBOP5)
Expand All @@ -103,20 +94,11 @@ void Jit64::fp_arith(UGeckoInstruction inst)
void Jit64::fmaddXX(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff)

if (inst.Rc)
{
FallBackToInterpreter(inst);
return;
}
JITDISABLE(bJITFloatingPointOff);
FALLBACK_IF(inst.Rc);

// Only the interpreter has "proper" support for (some) FP flags
if (inst.SUBOP5 == 29 && Core::g_CoreStartupParameter.bEnableFPRF)
{
FallBackToInterpreter(inst);
return;
}
FALLBACK_IF(inst.SUBOP5 == 29 && Core::g_CoreStartupParameter.bEnableFPRF);

bool single_precision = inst.OPCD == 59;

Expand Down Expand Up @@ -166,13 +148,8 @@ void Jit64::fmaddXX(UGeckoInstruction inst)
void Jit64::fsign(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff)

if (inst.Rc)
{
FallBackToInterpreter(inst);
return;
}
JITDISABLE(bJITFloatingPointOff);
FALLBACK_IF(inst.Rc);

int d = inst.FD;
int b = inst.FB;
Expand Down Expand Up @@ -200,13 +177,8 @@ void Jit64::fsign(UGeckoInstruction inst)
void Jit64::fmrx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff)

if (inst.Rc)
{
FallBackToInterpreter(inst);
return;
}
JITDISABLE(bJITFloatingPointOff);
FALLBACK_IF(inst.Rc);

int d = inst.FD;
int b = inst.FB;
Expand All @@ -231,13 +203,8 @@ void Jit64::fmrx(UGeckoInstruction inst)
void Jit64::fcmpx(UGeckoInstruction inst)
{
INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff)

if (jo.fpAccurateFcmp)
{
FallBackToInterpreter(inst); // turn off from debugger
return;
}
JITDISABLE(bJITFloatingPointOff);
FALLBACK_IF(jo.fpAccurateFcmp);

//bool ordered = inst.SUBOP10 == 32;
int a = inst.FA;
Expand Down Expand Up @@ -300,5 +267,3 @@ void Jit64::fcmpx(UGeckoInstruction inst)

fpr.UnlockAll();
}


0 comments on commit 215551c

Please sign in to comment.