aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2026-02-21 14:19:55 +0000
committeriximeow <me@iximeow.net>2026-02-21 14:19:55 +0000
commit4c5092e2a23825f3cdccaf264a6bd3adf1c3f8ac (patch)
tree2fa8e25f56289efd856f8c5d308d5298ecd79680
parent378903217bd5edcd8f43abbda0f2de279ed5c2d8 (diff)
visit flags changes, tests caught a bug!
-rw-r--r--src/long_mode/behavior.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/long_mode/behavior.rs b/src/long_mode/behavior.rs
index 7e48936..1626948 100644
--- a/src/long_mode/behavior.rs
+++ b/src/long_mode/behavior.rs
@@ -349,6 +349,15 @@ impl<'inst> InstBehavior<'inst> {
}
}
+ if let Some(acc) = self.flags_access() {
+ if acc.is_read() {
+ v.register_read(RegSpec::rflags());
+ }
+ if acc.is_write() {
+ v.register_write(RegSpec::rflags());
+ }
+ }
+
let operand_access = self.behavior.operand_access;
for i in 0..self.inst.operand_count {
@@ -770,7 +779,7 @@ const GENERAL_RW_R_FLAGWRITE: BehaviorDigest = GENERAL_RW_R
/// test, cmp, with no write but to flags.
const GENERAL_R_R_FLAGWRITE: BehaviorDigest = GENERAL_RW_R
- .set_operand(0, Access::ReadWrite)
+ .set_operand(0, Access::Read)
.set_flags_access(Access::Write);
/// `sbb`, `adc`, etc both read flags and write them.