projects
/
power-instruction-analyzer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93abe3f
)
fix subfc* to calculate correct carries
author
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 3 Sep 2020 23:20:16 +0000
(16:20 -0700)
committer
Jacob Lifshay
<programmerjake@gmail.com>
Thu, 3 Sep 2020 23:20:16 +0000
(16:20 -0700)
src/instr_models.rs
patch
|
blob
|
history
diff --git
a/src/instr_models.rs
b/src/instr_models.rs
index e56e4fb1ffd117ce4c77405dee867c38af5dabd5..d140ea5d213587f13fec60af7cda7329fed7ceca 100644
(file)
--- a/
src/instr_models.rs
+++ b/
src/instr_models.rs
@@
-111,8
+111,8
@@
pub fn subfco(inputs: InstructionInput) -> InstructionResult {
let (result, ov) = rb.overflowing_sub(ra);
let result = result as u64;
let ov32 = (rb as i32).overflowing_sub(ra as i32).1;
- let ca = (rb as u64).overflowing_sub(ra as u64).1;
- let ca32 = (rb as u32).overflowing_sub(ra as u32).1;
+ let ca =
!
(rb as u64).overflowing_sub(ra as u64).1;
+ let ca32 =
!
(rb as u32).overflowing_sub(ra as u32).1;
Ok(InstructionOutput {
rt: Some(result),
overflow: Some(propagate_so(OverflowFlags { so: ov, ov, ov32 }, inputs)?),