Merge pull request #11136 from AdmiralCurtiss/gqr-array
Jit64: Convert constantGqr to std::array.
This commit is contained in:
commit
333ede5416
|
@ -948,7 +948,7 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
|
||||||
js.downcountAmount = 0;
|
js.downcountAmount = 0;
|
||||||
js.skipInstructions = 0;
|
js.skipInstructions = 0;
|
||||||
js.carryFlag = CarryFlag::InPPCState;
|
js.carryFlag = CarryFlag::InPPCState;
|
||||||
js.constantGqr.clear();
|
js.constantGqrValid = BitSet8();
|
||||||
|
|
||||||
// Assume that GQR values don't change often at runtime. Many paired-heavy games use largely float
|
// Assume that GQR values don't change often at runtime. Many paired-heavy games use largely float
|
||||||
// loads and stores,
|
// loads and stores,
|
||||||
|
@ -979,6 +979,7 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
|
||||||
CMP_or_TEST(32, PPCSTATE(spr[SPR_GQR0 + gqr]), Imm32(value));
|
CMP_or_TEST(32, PPCSTATE(spr[SPR_GQR0 + gqr]), Imm32(value));
|
||||||
J_CC(CC_NZ, target);
|
J_CC(CC_NZ, target);
|
||||||
}
|
}
|
||||||
|
js.constantGqrValid = gqr_static;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,10 +35,6 @@ void Jit64::psq_stXX(UGeckoInstruction inst)
|
||||||
int w = indexed ? inst.Wx : inst.W;
|
int w = indexed ? inst.Wx : inst.W;
|
||||||
FALLBACK_IF(!a);
|
FALLBACK_IF(!a);
|
||||||
|
|
||||||
auto it = js.constantGqr.find(i);
|
|
||||||
bool gqrIsConstant = it != js.constantGqr.end();
|
|
||||||
u32 gqrValue = gqrIsConstant ? it->second & 0xffff : 0;
|
|
||||||
|
|
||||||
RCX64Reg scratch_guard = gpr.Scratch(RSCRATCH_EXTRA);
|
RCX64Reg scratch_guard = gpr.Scratch(RSCRATCH_EXTRA);
|
||||||
RCOpArg Ra = update ? gpr.Bind(a, RCMode::ReadWrite) : gpr.Use(a, RCMode::Read);
|
RCOpArg Ra = update ? gpr.Bind(a, RCMode::ReadWrite) : gpr.Use(a, RCMode::Read);
|
||||||
RCOpArg Rb = indexed ? gpr.Use(b, RCMode::Read) : RCOpArg::Imm32((u32)offset);
|
RCOpArg Rb = indexed ? gpr.Use(b, RCMode::Read) : RCOpArg::Imm32((u32)offset);
|
||||||
|
@ -56,8 +52,10 @@ void Jit64::psq_stXX(UGeckoInstruction inst)
|
||||||
else
|
else
|
||||||
CVTPD2PS(XMM0, Rs); // pair
|
CVTPD2PS(XMM0, Rs); // pair
|
||||||
|
|
||||||
|
const bool gqrIsConstant = js.constantGqrValid[i];
|
||||||
if (gqrIsConstant)
|
if (gqrIsConstant)
|
||||||
{
|
{
|
||||||
|
const u32 gqrValue = js.constantGqr[i] & 0xffff;
|
||||||
int type = gqrValue & 0x7;
|
int type = gqrValue & 0x7;
|
||||||
|
|
||||||
// Paired stores (other than w/type zero) don't yield any real change in
|
// Paired stores (other than w/type zero) don't yield any real change in
|
||||||
|
@ -126,10 +124,6 @@ void Jit64::psq_lXX(UGeckoInstruction inst)
|
||||||
int w = indexed ? inst.Wx : inst.W;
|
int w = indexed ? inst.Wx : inst.W;
|
||||||
FALLBACK_IF(!a);
|
FALLBACK_IF(!a);
|
||||||
|
|
||||||
auto it = js.constantGqr.find(i);
|
|
||||||
bool gqrIsConstant = it != js.constantGqr.end();
|
|
||||||
u32 gqrValue = gqrIsConstant ? it->second >> 16 : 0;
|
|
||||||
|
|
||||||
RCX64Reg scratch_guard = gpr.Scratch(RSCRATCH_EXTRA);
|
RCX64Reg scratch_guard = gpr.Scratch(RSCRATCH_EXTRA);
|
||||||
RCX64Reg Ra = gpr.Bind(a, update ? RCMode::ReadWrite : RCMode::Read);
|
RCX64Reg Ra = gpr.Bind(a, update ? RCMode::ReadWrite : RCMode::Read);
|
||||||
RCOpArg Rb = indexed ? gpr.Use(b, RCMode::Read) : RCOpArg::Imm32((u32)offset);
|
RCOpArg Rb = indexed ? gpr.Use(b, RCMode::Read) : RCOpArg::Imm32((u32)offset);
|
||||||
|
@ -142,8 +136,10 @@ void Jit64::psq_lXX(UGeckoInstruction inst)
|
||||||
if (update && !jo.memcheck)
|
if (update && !jo.memcheck)
|
||||||
MOV(32, Ra, R(RSCRATCH_EXTRA));
|
MOV(32, Ra, R(RSCRATCH_EXTRA));
|
||||||
|
|
||||||
|
const bool gqrIsConstant = js.constantGqrValid[i];
|
||||||
if (gqrIsConstant)
|
if (gqrIsConstant)
|
||||||
{
|
{
|
||||||
|
const u32 gqrValue = js.constantGqr[i] >> 16;
|
||||||
GenQuantizedLoad(w == 1, static_cast<EQuantizeType>(gqrValue & 0x7), (gqrValue & 0x3F00) >> 8);
|
GenQuantizedLoad(w == 1, static_cast<EQuantizeType>(gqrValue & 0x7), (gqrValue & 0x3F00) >> 8);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -83,7 +83,8 @@ protected:
|
||||||
Gen::FixupBranch exceptionHandler;
|
Gen::FixupBranch exceptionHandler;
|
||||||
|
|
||||||
bool assumeNoPairedQuantize;
|
bool assumeNoPairedQuantize;
|
||||||
std::map<u8, u32> constantGqr;
|
BitSet8 constantGqrValid;
|
||||||
|
std::array<u32, 8> constantGqr;
|
||||||
bool firstFPInstructionFound;
|
bool firstFPInstructionFound;
|
||||||
bool isLastInstruction;
|
bool isLastInstruction;
|
||||||
int skipInstructions;
|
int skipInstructions;
|
||||||
|
|
Loading…
Reference in New Issue