diff options
| author | iximeow <me@iximeow.net> | 2026-02-21 14:19:55 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-02-23 00:03:13 +0000 |
| commit | 24cf1bb2d145ba237317c12b0ef89ced8cf8ede1 (patch) | |
| tree | 7e90cc1eb816c833f9af3a1c6573c7c3bf1ef681 /src/long_mode/behavior.rs | |
| parent | 6df9ef1b68db7e7bd5cb63b6970705fd65440e0a (diff) | |
visit flags changes, tests caught a bug!
Diffstat (limited to 'src/long_mode/behavior.rs')
| -rw-r--r-- | src/long_mode/behavior.rs | 11 |
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. |
