Refactor gather-pipe address checking.

The implementation of IsOptimizableGatherPipeWrite is extremely simple
now, but it will get a bit more complicated with dynamic-bat.
This commit is contained in:
magumagu 2015-02-21 08:50:50 -08:00
parent 18ada7a0f5
commit 917a900ccb
6 changed files with 13 additions and 4 deletions

View File

@ -120,7 +120,7 @@ void JitArm::SafeStoreFromReg(s32 dest, u32 value, s32 regOffset, int accessSize
if (is_immediate) if (is_immediate)
{ {
if ((imm_addr & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe) if (jit->jo.optimizeGatherPipe && PowerPC::IsOptimizableGatherPipeWrite(imm_addr))
{ {
MOVI2R(R14, (u32)&GPFifo::m_gatherPipeCount); MOVI2R(R14, (u32)&GPFifo::m_gatherPipeCount);
MOVI2R(R10, (u32)GPFifo::m_gatherPipe); MOVI2R(R10, (u32)GPFifo::m_gatherPipe);

View File

@ -350,7 +350,7 @@ void JitArm::stfXX(UGeckoInstruction inst)
if (is_immediate) if (is_immediate)
{ {
if ((imm_addr & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe) if (jit->jo.optimizeGatherPipe && PowerPC::IsOptimizableGatherPipeWrite(imm_addr))
{ {
int accessSize; int accessSize;
if (flags & BackPatchInfo::FLAG_SIZE_F64) if (flags & BackPatchInfo::FLAG_SIZE_F64)

View File

@ -371,7 +371,7 @@ void JitArm64::stfXX(UGeckoInstruction inst)
if (is_immediate) if (is_immediate)
{ {
if ((imm_addr & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe) if (jit->jo.optimizeGatherPipe && PowerPC::IsOptimizableGatherPipeWrite(imm_addr))
{ {
int accessSize; int accessSize;
if (flags & BackPatchInfo::FLAG_SIZE_F64) if (flags & BackPatchInfo::FLAG_SIZE_F64)

View File

@ -477,7 +477,7 @@ bool EmuCodeBlock::WriteToConstAddress(int accessSize, OpArg arg, u32 address, B
// If we already know the address through constant folding, we can do some // If we already know the address through constant folding, we can do some
// fun tricks... // fun tricks...
if ((address & 0xFFFFF000) == 0xCC008000 && jit->jo.optimizeGatherPipe) if (jit->jo.optimizeGatherPipe && PowerPC::IsOptimizableGatherPipeWrite(address))
{ {
if (!arg.IsSimpleReg() || arg.GetSimpleReg() != RSCRATCH) if (!arg.IsSimpleReg() || arg.GetSimpleReg() != RSCRATCH)
MOV(accessSize, R(RSCRATCH), arg); MOV(accessSize, R(RSCRATCH), arg);

View File

@ -763,6 +763,14 @@ u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize)
return translated; return translated;
} }
bool IsOptimizableGatherPipeWrite(u32 address)
{
if (!UReg_MSR(MSR).DR)
return false;
return address == 0xCC008000;
}
// ********************************************************************************* // *********************************************************************************
// Warning: Test Area // Warning: Test Area
// //

View File

@ -270,6 +270,7 @@ void InvalidateTLBEntry(u32 address);
// memory access. Does not consider page tables. // memory access. Does not consider page tables.
bool IsOptimizableRAMAddress(const u32 address); bool IsOptimizableRAMAddress(const u32 address);
u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize); u32 IsOptimizableMMIOAccess(u32 address, u32 accessSize);
bool IsOptimizableGatherPipeWrite(u32 address);
} // namespace } // namespace