Commit c7f5419f authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS64: Add a check to addiu simulation according to the specification.

BUG=

Review-Url: https://codereview.chromium.org/1984313002
Cr-Commit-Position: refs/heads/master@{#36316}
parent 253050cb
...@@ -4413,6 +4413,7 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) { ...@@ -4413,6 +4413,7 @@ void Simulator::DecodeTypeImmediate(Instruction* instr) {
break; break;
// ------------- Arithmetic instructions. // ------------- Arithmetic instructions.
case ADDIU: { case ADDIU: {
DCHECK(is_int32(rs));
int32_t alu32_out = static_cast<int32_t>(rs + se_imm16); int32_t alu32_out = static_cast<int32_t>(rs + se_imm16);
// Sign-extend result of 32bit operation into 64bit register. // Sign-extend result of 32bit operation into 64bit register.
SetResult(rt_reg, static_cast<int64_t>(alu32_out)); SetResult(rt_reg, static_cast<int64_t>(alu32_out));
......
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