Fix ROR with amount > 32
Former-commit-id: 8f88de3c55c0e452266c40944ff920175b83627e
This commit is contained in:
parent
9421281381
commit
1bacb927af
|
@ -176,9 +176,9 @@ impl Core {
|
|||
val
|
||||
}
|
||||
_ => {
|
||||
let result = val.rotate_right(amount);
|
||||
self.cpsr.set_C((result >> 1) & 1 == 1);
|
||||
result
|
||||
let amount = amount % 32;
|
||||
self.cpsr.set_C(((val as u32) >> (amount - 1)) & 1 == 1);
|
||||
val.rotate_right(amount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue