aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/long_mode/mod.rs106
1 files changed, 54 insertions, 52 deletions
diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs
index a84dbd9..3b2f23f 100644
--- a/src/long_mode/mod.rs
+++ b/src/long_mode/mod.rs
@@ -6172,51 +6172,6 @@ fn read_M<
.with_id(modrm_start + 2)
);
return read_sib(words, instr, modrm, sink);
- } else if mmm == 5 && modbits == 0b00 {
- sink.record(
- modrm_start + 6,
- modrm_start + 7,
- InnerDescription::Misc("rip-relative reference")
- .with_id(modrm_start + 0)
- );
- sink.record(
- modrm_start + 0,
- modrm_start + 2,
- InnerDescription::Misc("rip-relative reference")
- .with_id(modrm_start + 0)
- );
- if instr.prefixes.address_size() {
- sink.record(
- modrm_start + 6,
- modrm_start + 7,
- InnerDescription::Misc("address-size override selects `eip` instead")
- .with_id(modrm_start + 1)
- );
- sink.record(
- modrm_start + 0,
- modrm_start + 2,
- InnerDescription::Misc("address-size override selects `eip` instead")
- .with_id(modrm_start + 1)
- );
- }
-
- let disp = read_num(words, 4)? as i32;
-
- sink.record(
- modrm_start + 8,
- modrm_start + 8 + 32,
- InnerDescription::Number("displacement", disp as i64)
- .with_id(modrm_start + 3)
- );
-
- instr.regs[1] =
- if !instr.prefixes.address_size() { RegSpec::rip() } else { RegSpec::eip() };
- if disp == 0 {
- OperandSpec::Deref
- } else {
- instr.disp = disp as i64 as u64;
- OperandSpec::RegDisp
- }
} else {
let mut r = 0;
if instr.prefixes.rex_unchecked().b() {
@@ -6231,13 +6186,60 @@ fn read_M<
);
if modbits == 0b00 {
- sink.record(
- modrm_start + 6,
- modrm_start + 7,
- InnerDescription::Misc("memory operand is [reg] with no displacement, register selected by `mmm` (mod bits: 00)")
- .with_id(modrm_start + 0)
- );
- OperandSpec::Deref
+ if mmm == 5 {
+ sink.record(
+ modrm_start + 6,
+ modrm_start + 7,
+ InnerDescription::Misc("rip-relative reference")
+ .with_id(modrm_start + 0)
+ );
+ sink.record(
+ modrm_start + 0,
+ modrm_start + 2,
+ InnerDescription::Misc("rip-relative reference")
+ .with_id(modrm_start + 0)
+ );
+ if instr.prefixes.address_size() {
+ sink.record(
+ modrm_start + 6,
+ modrm_start + 7,
+ InnerDescription::Misc("address-size override selects `eip` instead")
+ .with_id(modrm_start + 1)
+ );
+ sink.record(
+ modrm_start + 0,
+ modrm_start + 2,
+ InnerDescription::Misc("address-size override selects `eip` instead")
+ .with_id(modrm_start + 1)
+ );
+ }
+
+ let disp = read_num(words, 4)? as i32;
+
+ sink.record(
+ modrm_start + 8,
+ modrm_start + 8 + 32,
+ InnerDescription::Number("displacement", disp as i64)
+ .with_id(modrm_start + 3)
+ );
+
+ instr.regs[1] =
+ if !instr.prefixes.address_size() { RegSpec::rip() } else { RegSpec::eip() };
+ if disp == 0 {
+ OperandSpec::Deref
+ } else {
+ instr.disp = disp as i64 as u64;
+ OperandSpec::RegDisp
+ }
+ } else {
+ sink.record(
+ modrm_start + 6,
+ modrm_start + 7,
+ InnerDescription::Misc("memory operand is [reg] with no displacement, register selected by `mmm` (mod bits: 00)")
+ .with_id(modrm_start + 0)
+ );
+ OperandSpec::Deref
+ }
} else {
let disp_start = words.offset();
let disp = if modbits == 0b01 {