diff --git a/crates/cpu/src/unit/alu_branch.rs b/crates/cpu/src/unit/alu_branch.rs index dc96bf4..e7d7601 100644 --- a/crates/cpu/src/unit/alu_branch.rs +++ b/crates/cpu/src/unit/alu_branch.rs @@ -114,7 +114,7 @@ fn add_sub( let x86_cf = wire(); #[hdl] let x86_af = wire(); - connect(x86_af, carries[&4]); + connect(x86_af, carries[&4] ^ invert_src0); #[hdl] let x86_of = wire(); #[hdl] @@ -125,7 +125,7 @@ fn add_sub( #[hdl] let x86_zf = wire(); let set_x86_flags = |width| { - connect(x86_cf, carries[&width]); + connect(x86_cf, carries[&width] ^ invert_src0); connect(x86_of, carries[&width].cmp_ne(carries[&(width - 1)])); connect(x86_sf, sum[width - 1]); connect(x86_zf, sum[..width].cmp_eq(0u8)); diff --git a/crates/cpu/tests/expected/rename_execute_retire_save_restore_gprs_real.vcd b/crates/cpu/tests/expected/rename_execute_retire_save_restore_gprs_real.vcd index 769cf99..831f6f3 100644 --- a/crates/cpu/tests/expected/rename_execute_retire_save_restore_gprs_real.vcd +++ b/crates/cpu/tests/expected/rename_execute_retire_save_restore_gprs_real.vcd @@ -87513,6 +87513,8 @@ b1111111111111111111111111111111111111111111111111111111111110001 Z<_QG b1111111111111111111111111111111111111111111111111111111111111111 `cG{N" b1111111111111111111111111111111111111111111111111111100000000001 6-Q>d" b1111111111111111111110000000000111111111111111111111100000000001 Z<_QG" +0t/pUF" +0NCFTu" 1q=,:m" 1c)52)" 0fa7hn" @@ -87924,7 +87926,7 @@ b1100000000000 6-Q>d" 0rruTn" 0<#SlY" b1100000000000 Z<_QG" -0t/pUF" +1NCFTu" 0q=,:m" 1`(dU(" 0YQaZZ" @@ -170291,8 +170293,6 @@ b1111111111111111111111111111111111111111111111111111100000110000 LirfL" 1FIp"#" 1KUwM{" b1111111111111111111110000011000011111111111111111111100000110000 $ru{a" -1R+kd[" -1AvcH=" 1oOiyJ" 0e"l`;" 1cq($'" @@ -170466,8 +170466,6 @@ b11111100000000 LirfL" 0FIp"#" 0KUwM{" b11111100000000 $ru{a" -0R+kd[" -0AvcH=" 0oOiyJ" 0cq($'" 0cBAjc"