summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2012-03-04 23:42:33 +1100
committerskidau <skidau@gmail.com>2012-03-04 23:42:33 +1100
commita53916ff5d7d2840ef8612bc16511554d259e848 (patch)
tree3cbb82c62cbd008b3a969bd68d99658de516ed5e /Source/Core
parent5de8366db2ec084e95420b0853abb4d11a431ac0 (diff)
Changed the detection of FIFO write addresses to writes at the gather pipe boundary. This speeds up games which frequently write to the gather pipe like the pre-rendered movies in The Last Story.
Added some code to unlink invalidated blocks so that the recompiled block can be linked (speed-up).
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/HW/GPFifo.cpp2
-rw-r--r--Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp22
-rw-r--r--Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h1
3 files changed, 23 insertions, 2 deletions
diff --git a/Source/Core/Core/Src/HW/GPFifo.cpp b/Source/Core/Core/Src/HW/GPFifo.cpp
index 725db3011c..fd81f099e9 100644
--- a/Source/Core/Core/Src/HW/GPFifo.cpp
+++ b/Source/Core/Core/Src/HW/GPFifo.cpp
@@ -98,7 +98,7 @@ void STACKALIGN CheckGatherPipe()
memmove(m_gatherPipe, m_gatherPipe + cnt, m_gatherPipeCount);
// Profile where the FIFO writes are occurring.
- if (jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end()))
+ if (m_gatherPipeCount == 0 && jit && (jit->js.fifoWriteAddresses.find(PC)) == (jit->js.fifoWriteAddresses.end()))
{
jit->js.fifoWriteAddresses.insert(PC);
diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp
index 8f5ff5d820..bccb218fd9 100644
--- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp
+++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp
@@ -353,6 +353,24 @@ bool JitBlock::ContainsAddress(u32 em_address)
}
}
+ void JitBlockCache::UnlinkBlock(int i)
+ {
+ JitBlock &b = blocks[i];
+ std::map<u32, int>::iterator iter;
+ pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp;
+ ppp = links_to.equal_range(b.originalAddress);
+ if (ppp.first == ppp.second)
+ return;
+ for (multimap<u32, int>::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) {
+ JitBlock &sourceBlock = blocks[iter2->second];
+ for (int e = 0; e < 2; e++)
+ {
+ if (sourceBlock.exitAddress[e] == b.originalAddress)
+ sourceBlock.linkStatus[e] = false;
+ }
+ }
+ }
+
void JitBlockCache::DestroyBlock(int block_num, bool invalidate)
{
if (block_num < 0 || block_num >= num_blocks)
@@ -375,7 +393,9 @@ bool JitBlock::ContainsAddress(u32 em_address)
Memory::WriteUnchecked_U32(b.originalFirstOpcode, b.originalAddress);
#endif
- // We don't unlink blocks, we just send anyone who tries to run them back to the dispatcher.
+ UnlinkBlock(block_num);
+
+ // Send anyone who tries to run this block back to the dispatcher.
// Not entirely ideal, but .. pretty good.
// Spurious entrances from previously linked blocks can only come through checkedEntry
XEmitter emit((u8 *)b.checkedEntry);
diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h
index 7c19310e02..16f16d6d14 100644
--- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h
+++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.h
@@ -87,6 +87,7 @@ class JitBlockCache
bool RangeIntersect(int s1, int e1, int s2, int e2) const;
void LinkBlockExits(int i);
void LinkBlock(int i);
+ void UnlinkBlock(int i);
public:
JitBlockCache() :