Fix not flushing the pipeline for "mov pc, reg" instructions

Former-commit-id: 66136ef70b8f48d5e9f4c10b65f1e2fbd3dd3ea1
This commit is contained in:
Michel Heily 2019-07-08 00:58:09 +03:00
parent 863838a4a4
commit 163d8bda59

View file

@ -137,6 +137,9 @@ impl Core {
let result = self.alu(arm_alu_op, op1, op2, true); let result = self.alu(arm_alu_op, op1, op2, true);
if let Some(result) = result { if let Some(result) = result {
self.set_reg(dst_reg, result as u32); self.set_reg(dst_reg, result as u32);
if dst_reg == REG_PC {
return Ok(CpuPipelineAction::Flush);
}
} }
Ok(CpuPipelineAction::IncPC) Ok(CpuPipelineAction::IncPC)
} }