small optimization in icache

This commit is contained in:
Stanislav Shwartsman 2012-09-23 19:35:46 +00:00
parent 5d562a7830
commit da150bc163

View File

@ -38,7 +38,7 @@ public:
} }
~bxPageWriteStampTable() { delete [] fineGranularityMapping; } ~bxPageWriteStampTable() { delete [] fineGranularityMapping; }
BX_CPP_INLINE Bit32u hash(bx_phy_address pAddr) const { BX_CPP_INLINE static Bit32u hash(bx_phy_address pAddr) {
// can share writeStamps between multiple pages if >32 bit phy address // can share writeStamps between multiple pages if >32 bit phy address
return ((Bit32u) pAddr) >> 12; return ((Bit32u) pAddr) >> 12;
} }
@ -150,7 +150,7 @@ public:
public: public:
bxICache_c() { flushICacheEntries(); } bxICache_c() { flushICacheEntries(); }
BX_CPP_INLINE unsigned hash(bx_phy_address pAddr, unsigned fetchModeMask) const BX_CPP_INLINE static unsigned hash(bx_phy_address pAddr, unsigned fetchModeMask)
{ {
// return ((pAddr + (pAddr << 2) + (pAddr>>6)) & (BxICacheEntries-1)) ^ fetchModeMask; // return ((pAddr + (pAddr << 2) + (pAddr>>6)) & (BxICacheEntries-1)) ^ fetchModeMask;
return ((pAddr) & (BxICacheEntries-1)) ^ fetchModeMask; return ((pAddr) & (BxICacheEntries-1)) ^ fetchModeMask;