PPCCache: Get rid of FAST_ICACHE define.
There's no reason to keep around the ifdefs.
This commit is contained in:
parent
010ca048df
commit
44f481ec13
|
@ -211,7 +211,6 @@ namespace JitInterface
|
||||||
|
|
||||||
u32 Read_Opcode_JIT(u32 _Address)
|
u32 Read_Opcode_JIT(u32 _Address)
|
||||||
{
|
{
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
if (bMMU && !bFakeVMEM && (_Address & Memory::ADDR_MASK_MEM1))
|
if (bMMU && !bFakeVMEM && (_Address & Memory::ADDR_MASK_MEM1))
|
||||||
{
|
{
|
||||||
_Address = Memory::TranslateAddress(_Address, Memory::FLAG_OPCODE);
|
_Address = Memory::TranslateAddress(_Address, Memory::FLAG_OPCODE);
|
||||||
|
@ -228,9 +227,6 @@ namespace JitInterface
|
||||||
inst = Memory::ReadUnchecked_U32(_Address);
|
inst = Memory::ReadUnchecked_U32(_Address);
|
||||||
else
|
else
|
||||||
inst = PowerPC::ppcState.iCache.ReadInstruction(_Address);
|
inst = PowerPC::ppcState.iCache.ReadInstruction(_Address);
|
||||||
#else
|
|
||||||
u32 inst = Memory::ReadUnchecked_U32(_Address);
|
|
||||||
#endif
|
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,11 +59,9 @@ namespace PowerPC
|
||||||
{
|
{
|
||||||
memset(valid, 0, sizeof(valid));
|
memset(valid, 0, sizeof(valid));
|
||||||
memset(plru, 0, sizeof(plru));
|
memset(plru, 0, sizeof(plru));
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
memset(lookup_table, 0xff, sizeof(lookup_table));
|
memset(lookup_table, 0xff, sizeof(lookup_table));
|
||||||
memset(lookup_table_ex, 0xff, sizeof(lookup_table_ex));
|
memset(lookup_table_ex, 0xff, sizeof(lookup_table_ex));
|
||||||
memset(lookup_table_vmem, 0xff, sizeof(lookup_table_vmem));
|
memset(lookup_table_vmem, 0xff, sizeof(lookup_table_vmem));
|
||||||
#endif
|
|
||||||
JitInterface::ClearSafe();
|
JitInterface::ClearSafe();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +81,6 @@ namespace PowerPC
|
||||||
return;
|
return;
|
||||||
// invalidates the whole set
|
// invalidates the whole set
|
||||||
u32 set = (addr >> 5) & 0x7f;
|
u32 set = (addr >> 5) & 0x7f;
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
if (valid[set] & (1<<i))
|
if (valid[set] & (1<<i))
|
||||||
{
|
{
|
||||||
|
@ -94,7 +91,6 @@ namespace PowerPC
|
||||||
else
|
else
|
||||||
lookup_table[((tags[set][i] << 7) | set) & 0xfffff] = 0xff;
|
lookup_table[((tags[set][i] << 7) | set) & 0xfffff] = 0xff;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
valid[set] = 0;
|
valid[set] = 0;
|
||||||
JitInterface::InvalidateICache(addr & ~0x1f, 32);
|
JitInterface::InvalidateICache(addr & ~0x1f, 32);
|
||||||
}
|
}
|
||||||
|
@ -105,7 +101,7 @@ namespace PowerPC
|
||||||
return Memory::ReadUnchecked_U32(addr);
|
return Memory::ReadUnchecked_U32(addr);
|
||||||
u32 set = (addr >> 5) & 0x7f;
|
u32 set = (addr >> 5) & 0x7f;
|
||||||
u32 tag = addr >> 12;
|
u32 tag = addr >> 12;
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
u32 t;
|
u32 t;
|
||||||
if (addr & ICACHE_VMEM_BIT)
|
if (addr & ICACHE_VMEM_BIT)
|
||||||
{
|
{
|
||||||
|
@ -119,15 +115,7 @@ namespace PowerPC
|
||||||
{
|
{
|
||||||
t = lookup_table[(addr>>5) & 0xfffff];
|
t = lookup_table[(addr>>5) & 0xfffff];
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
u32 t = 0xff;
|
|
||||||
for (u32 i = 0; i < 8; i++)
|
|
||||||
if (tags[set][i] == tag && (valid[set] & (1<<i)))
|
|
||||||
{
|
|
||||||
t = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (t == 0xff) // load to the cache
|
if (t == 0xff) // load to the cache
|
||||||
{
|
{
|
||||||
if (HID0.ILOCK) // instruction cache is locked
|
if (HID0.ILOCK) // instruction cache is locked
|
||||||
|
@ -140,7 +128,6 @@ namespace PowerPC
|
||||||
// load
|
// load
|
||||||
u8 *p = Memory::GetPointer(addr & ~0x1f);
|
u8 *p = Memory::GetPointer(addr & ~0x1f);
|
||||||
memcpy(data[set][t], p, 32);
|
memcpy(data[set][t], p, 32);
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
if (valid[set] & (1<<t))
|
if (valid[set] & (1<<t))
|
||||||
{
|
{
|
||||||
if (tags[set][t] & (ICACHE_VMEM_BIT >> 12))
|
if (tags[set][t] & (ICACHE_VMEM_BIT >> 12))
|
||||||
|
@ -157,7 +144,6 @@ namespace PowerPC
|
||||||
lookup_table_ex[(addr>>5) & 0x1fffff] = t;
|
lookup_table_ex[(addr>>5) & 0x1fffff] = t;
|
||||||
else
|
else
|
||||||
lookup_table[(addr>>5) & 0xfffff] = t;
|
lookup_table[(addr>>5) & 0xfffff] = t;
|
||||||
#endif
|
|
||||||
tags[set][t] = tag;
|
tags[set][t] = tag;
|
||||||
valid[set] |= 1<<t;
|
valid[set] |= 1<<t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
#define FAST_ICACHE
|
|
||||||
|
|
||||||
namespace PowerPC
|
namespace PowerPC
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -29,11 +27,9 @@ namespace PowerPC
|
||||||
u32 way_from_valid[255];
|
u32 way_from_valid[255];
|
||||||
u32 way_from_plru[128];
|
u32 way_from_plru[128];
|
||||||
|
|
||||||
#ifdef FAST_ICACHE
|
|
||||||
u8 lookup_table[1<<20];
|
u8 lookup_table[1<<20];
|
||||||
u8 lookup_table_ex[1<<21];
|
u8 lookup_table_ex[1<<21];
|
||||||
u8 lookup_table_vmem[1<<20];
|
u8 lookup_table_vmem[1<<20];
|
||||||
#endif
|
|
||||||
|
|
||||||
InstructionCache();
|
InstructionCache();
|
||||||
u32 ReadInstruction(u32 addr);
|
u32 ReadInstruction(u32 addr);
|
||||||
|
|
Loading…
Reference in New Issue