Commit 1d42a9db authored by Dusan Milosavljevic's avatar Dusan Milosavljevic

MIPS64: Fix MULT in simulator to conform the spec.

TEST=mjsunit/numops-fuzz-part4
BUG=
R=balazs.kilvady@imgtec.com

Review URL: https://codereview.chromium.org/756073003

Cr-Commit-Position: refs/heads/master@{#25568}
parent 6f60c0d3
...@@ -2080,13 +2080,12 @@ void Simulator::ConfigureTypeRegister(Instruction* instr, ...@@ -2080,13 +2080,12 @@ void Simulator::ConfigureTypeRegister(Instruction* instr,
case MFLO: case MFLO:
*alu_out = get_register(LO); *alu_out = get_register(LO);
break; break;
case MULT: // MULT == D_MUL_MUH. case MULT: { // MULT == D_MUL_MUH.
// TODO(plind) - Unify MULT/DMULT with single set of 64-bit HI/Lo int32_t rs_lo = static_cast<int32_t>(rs);
// regs. int32_t rt_lo = static_cast<int32_t>(rt);
// TODO(plind) - make the 32-bit MULT ops conform to spec regarding *i64hilo = static_cast<int64_t>(rs_lo) * static_cast<int64_t>(rt_lo);
// checking of 32-bit input values, and un-define operations of HW.
*i64hilo = rs * rt;
break; break;
}
case MULTU: case MULTU:
*u64hilo = static_cast<uint64_t>(rs_u & 0xffffffff) * *u64hilo = static_cast<uint64_t>(rs_u & 0xffffffff) *
static_cast<uint64_t>(rt_u & 0xffffffff); static_cast<uint64_t>(rt_u & 0xffffffff);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment