More common things moved out from the GFX plugins. No visible changes.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@27 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-07-18 19:33:55 +00:00
parent ca13c54855
commit b3c55018a6
36 changed files with 857 additions and 924 deletions

View File

@ -279,13 +279,11 @@ union UGQR
{
unsigned ST_TYPE : 3;
unsigned : 5;
// signed ST_SCALE : 6;
unsigned ST_SCALE : 6;
unsigned ST_SCALE : 6;
unsigned : 2;
unsigned LD_TYPE : 3;
unsigned : 5;
// signed LD_SCALE : 6;
unsigned LD_SCALE : 6;
unsigned LD_SCALE : 6;
unsigned : 2;
};

View File

@ -346,6 +346,7 @@ namespace Jit64
js.blockStart = emaddress;
js.fifoBytesThisBlock = 0;
js.curBlock = &b;
js.blockSetsQuantizers = false;
//Analyze the block, collect all instructions it is made of (including inlining,
//if that is enabled), reorder instructions for optimal performance, and join joinable instructions.

View File

@ -49,6 +49,7 @@ namespace Jit64
int downcountAmount;
bool isLastInstruction;
bool blockSetsQuantizers;
int fifoBytesThisBlock;

View File

@ -95,12 +95,14 @@ const double m_dequantizeTableD[] =
(1 << 4), (1 << 3), (1 << 2), (1 << 1),
};
// The big problem is likely instructions that set the quantizers in the same block.
// We will have to break block after quantizers are written to.
u32 temp;
void psq_st(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
if (!Core::GetStartupParameter().bOptimizeQuantizers)
if (js.blockSetsQuantizers || !Core::GetStartupParameter().bOptimizeQuantizers)
{
Default(inst);
return;
@ -220,7 +222,7 @@ void psq_l(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
if (!Core::GetStartupParameter().bOptimizeQuantizers)
if (js.blockSetsQuantizers || !Core::GetStartupParameter().bOptimizeQuantizers)
{
Default(inst);
return;
@ -296,6 +298,14 @@ void psq_l(UGeckoInstruction inst)
ADD(32, gpr.R(inst.RA), Imm32(offset));
}
break;
/*
Dynamic quantizer. Todo when we have a test set.
MOVZX(32, 8, EAX, M(((char *)&PowerPC::ppcState.spr[SPR_GQR0 + inst.I]) + 3)); // it's in the high byte.
AND(32, R(EAX), Imm8(0x3F));
MOV(32, R(ECX), Imm32((u32)&m_dequantizeTableD));
MOVDDUP(r, MComplex(RCX, EAX, 8, 0));
*/
#endif
default:
// 4 0

View File

@ -35,15 +35,32 @@ namespace Jit64
{
case SPR_LR:
case SPR_CTR:
gpr.Lock(d);
gpr.LoadToX64(d,true);
MOV(32, M(&PowerPC::ppcState.spr[iIndex]), gpr.R(d));
gpr.UnlockAll();
// These are safe to do the easy way, see the bottom of this function.
break;
case SPR_GQR0:
case SPR_GQR0 + 1:
case SPR_GQR0 + 2:
case SPR_GQR0 + 3:
case SPR_GQR0 + 4:
case SPR_GQR0 + 5:
case SPR_GQR0 + 6:
case SPR_GQR0 + 7:
js.blockSetsQuantizers = false;
// Prevent recompiler from compiling in old quantizer values.
// TODO - actually save the set state and use it in following quantizer ops.
break;
// TODO - break block if quantizers are written to.
default:
Default(inst);
return;
}
// OK, this is easy.
gpr.Lock(d);
gpr.LoadToX64(d,true);
MOV(32, M(&PowerPC::ppcState.spr[iIndex]), gpr.R(d));
gpr.UnlockAll();
}
void mfspr(UGeckoInstruction inst)