MMU: Remove implicit sign conversions and truncation in UpdateTLBEntry

These are trivial to resolve.

Converting the structure member into a u32 results in no increase in
structure size, as it's making use of the three extra padding bits in
the structure.
This commit is contained in:
Lioncash 2021-08-31 09:55:13 -04:00
parent c008b1c335
commit 3216040bfe
2 changed files with 3 additions and 3 deletions

View File

@ -1282,9 +1282,9 @@ static void UpdateTLBEntry(const XCheckTLBFlag flag, UPTE_Hi pte2, const u32 add
if (IsNoExceptionFlag(flag))
return;
const int tag = address >> HW_PAGE_INDEX_SHIFT;
const u32 tag = address >> HW_PAGE_INDEX_SHIFT;
TLBEntry& tlbe = ppcState.tlb[IsOpcodeFlag(flag)][tag & HW_PAGE_INDEX_MASK];
const int index = tlbe.recent == 0 && tlbe.tag[0] != TLBEntry::INVALID_TAG;
const u32 index = tlbe.recent == 0 && tlbe.tag[0] != TLBEntry::INVALID_TAG;
tlbe.recent = index;
tlbe.paddr[index] = pte2.RPN << HW_PAGE_INDEX_SHIFT;
tlbe.pte[index] = pte2.Hex;

View File

@ -54,7 +54,7 @@ struct TLBEntry
u32 tag[TLB_WAYS] = {INVALID_TAG, INVALID_TAG};
u32 paddr[TLB_WAYS] = {};
u32 pte[TLB_WAYS] = {};
u8 recent = 0;
u32 recent = 0;
};
struct PairedSingle