Thumb 4 - Set flags if needed (For CMP)

Former-commit-id: 4f5bc97375c8aa45036b025a3420331a8137da17
This commit is contained in:
Michel Heily 2019-07-09 01:28:14 +03:00
parent 0bdf4993ee
commit 19e4196384

View file

@ -147,9 +147,10 @@ impl Core {
insn.rs() insn.rs()
}; };
let arm_alu_op: AluOpCode = insn.format5_op().into(); let arm_alu_op: AluOpCode = insn.format5_op().into();
let set_flags = arm_alu_op.is_setting_flags();
let op1 = self.get_reg(dst_reg) as i32; let op1 = self.get_reg(dst_reg) as i32;
let op2 = self.get_reg(src_reg) as i32; let op2 = self.get_reg(src_reg) as i32;
let result = self.alu(arm_alu_op, op1, op2, false); let result = self.alu(arm_alu_op, op1, op2, set_flags);
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 { if dst_reg == REG_PC {