Skip to content

Commit 2ae0bfc

Browse files
committed
[mips] Fix r5900 mult not assigning to destination register
1 parent 20be3d5 commit 2ae0bfc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/mips/il.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,9 @@ bool GetLowLevelILForInstruction(Architecture* arch, uint64_t addr, LowLevelILFu
11811181
case MIPS_MULT:
11821182
il.AddInstruction(il.SetRegisterSplit(4, REG_HI, REG_LO, il.MultDoublePrecSigned(4, ReadILOperand(il, instr, 1, registerSize), ReadILOperand(il, instr, 2, registerSize))));
11831183
SignExtendHiLo(il, registerSize);
1184+
if (rd != REG_ZERO)
1185+
// mflo
1186+
il.AddInstruction(SetRegisterOrNop(il, registerSize, registerSize, rd, il.Register(registerSize, REG_LO)));
11841187
break;
11851188
case MIPS_MULTU:
11861189
il.AddInstruction(il.SetRegisterSplit(4, REG_HI, REG_LO, il.MultDoublePrecUnsigned(4, ReadILOperand(il, instr, 1, registerSize), ReadILOperand(il, instr, 2, registerSize))));

0 commit comments

Comments
 (0)