MMU: Remove a bunch of useless swaps
The swaps are confusing and don't accomplish much. It was originally written like this: u32 pte = bswap(*(u32*)&base_mem[pteg_addr]); then bswap was changed to Common::swap32, and then the array access was replaced with Memory::Read_U32, leading to the useless swaps.
This commit is contained in:
parent
960d957f4f
commit
49edd5f482
|
@ -1113,7 +1113,7 @@ static TranslateAddressResult TranslatePageAddress(const u32 address, const XChe
|
||||||
|
|
||||||
// hash function no 1 "xor" .360
|
// hash function no 1 "xor" .360
|
||||||
u32 hash = (VSID ^ page_index);
|
u32 hash = (VSID ^ page_index);
|
||||||
u32 pte1 = Common::swap32((VSID << 7) | api | PTE1_V);
|
u32 pte1 = (VSID << 7) | api | PTE1_V;
|
||||||
|
|
||||||
for (int hash_func = 0; hash_func < 2; hash_func++)
|
for (int hash_func = 0; hash_func < 2; hash_func++)
|
||||||
{
|
{
|
||||||
|
@ -1121,7 +1121,7 @@ static TranslateAddressResult TranslatePageAddress(const u32 address, const XChe
|
||||||
if (hash_func == 1)
|
if (hash_func == 1)
|
||||||
{
|
{
|
||||||
hash = ~hash;
|
hash = ~hash;
|
||||||
pte1 |= PTE1_H << 24;
|
pte1 |= PTE1_H;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 pteg_addr =
|
u32 pteg_addr =
|
||||||
|
@ -1129,7 +1129,7 @@ static TranslateAddressResult TranslatePageAddress(const u32 address, const XChe
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++, pteg_addr += 8)
|
for (int i = 0; i < 8; i++, pteg_addr += 8)
|
||||||
{
|
{
|
||||||
u32 pteg = Common::swap32(Memory::Read_U32(pteg_addr));
|
const u32 pteg = Memory::Read_U32(pteg_addr);
|
||||||
|
|
||||||
if (pte1 == pteg)
|
if (pte1 == pteg)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue