Fix thumb MUL not setting the flags
Former-commit-id: b43e35a7fa2894fcc5cef7eeae9d74123e40219b
This commit is contained in:
parent
44426b5f0e
commit
477b4f45fd
|
@ -448,6 +448,8 @@ impl Core {
|
|||
if insn.set_cond_flag() {
|
||||
self.cpsr.set_N((result as i32) < 0);
|
||||
self.cpsr.set_Z(result == 0);
|
||||
self.cpsr.set_C(false);
|
||||
self.cpsr.set_V(false);
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -85,7 +85,10 @@ impl Core {
|
|||
for _ in 0..m {
|
||||
self.add_cycle();
|
||||
}
|
||||
self.gpr[insn.rd()] = op1.wrapping_mul(op2) as u32;
|
||||
let result = op1.wrapping_mul(op2) as u32;
|
||||
self.cpsr.set_N((result as i32) < 0);
|
||||
self.cpsr.set_Z(result == 0);
|
||||
self.gpr[insn.rd()] = result;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue