Skip to content

Commit fd596fb

Browse files
committed
WIP [mips] merging dev into PR #6311: MIPS r5900 (PS2 EE) support
1 parent 7ee84cb commit fd596fb

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

arch/mips/arch_mips.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class MipsArchitecture: public Architecture
188188
virtual bool Disassemble(const uint8_t* data, uint64_t addr, size_t maxLen, Instruction& result)
189189
{
190190
memset(&result, 0, sizeof(result));
191-
if (mips_decompose((uint32_t*)data, maxLen, &result, m_bits == 64 ? MIPS_64 : MIPS_32, addr, m_endian, m_decomposeFlags) != 0)
191+
if (mips_decompose((uint32_t*)data, maxLen, &result, m_version, addr, m_endian, m_decomposeFlags) != 0)
192192
return false;
193193
return true;
194194
}
@@ -3022,14 +3022,7 @@ class MipsElfRelocationHandler: public RelocationHandler
30223022
uint32_t inst2 = *(uint32_t*)(cur->relocationDataCache);
30233023
Instruction instruction;
30243024
memset(&instruction, 0, sizeof(instruction));
3025-
3026-
MipsVersion version;
3027-
if (arch->GetName().substr(0, 5) == "r5900")
3028-
version = MIPS_R5900;
3029-
else
3030-
version = arch->GetAddressSize() == 8 ? MIPS_64 : MIPS_32;
3031-
3032-
if (mips_decompose(&inst2, sizeof(uint32_t), &instruction, version, cur->address, arch->GetEndianness(), DECOMPOSE_FLAGS_PSEUDO_OP))
3025+
if (mips_decompose(&inst2, sizeof(uint32_t), &instruction, m_version, cur->address, arch->GetEndianness(), DECOMPOSE_FLAGS_PSEUDO_OP))
30333026
break;
30343027

30353028
int32_t immediate = swap(inst2) & 0xffff;

0 commit comments

Comments
 (0)