From 6b45d1855419a6976c049f3dc1f710a631bac786 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 12 Feb 2023 07:51:10 -0800 Subject: more read_E cleanup --- src/long_mode/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index bb3eb7c..f593f16 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -5250,7 +5250,7 @@ enum OperandCode { ModRM_0x0f00 = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f00).bits(), ModRM_0x0f01 = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f01).bits(), - ModRM_0x0f0d = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f0d).bits(), + ModRM_0x0f0d = OperandCodeBuilder::new().read_E().operand_case(OperandCase::ModRM_0x0f0d).bits(), ModRM_0x0f0f = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0f0f).bits(), // 3dnow ModRM_0x0fae = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0fae).bits(), ModRM_0x0fba = OperandCodeBuilder::new().read_modrm().operand_case(OperandCase::ModRM_0x0fba).bits(), @@ -8180,12 +8180,11 @@ fn read_operands< instruction.regs[0].bank = RegisterBank::X; if mem_oper == OperandSpec::RegMMM { instruction.regs[1].bank = RegisterBank::X; + } else { + instruction.mem_size = 16; } instruction.imm = read_num(words, 1)? as u8 as u64; - if instruction.operands[1] != OperandSpec::RegMMM { - instruction.mem_size = 16; - } instruction.operands[2] = OperandSpec::ImmU8; instruction.operand_count = 3; } @@ -8508,8 +8507,7 @@ fn read_operands< } } OperandCase::ModRM_0x0f0d => { - let modrm = read_modrm(words)?; - let r = (modrm >> 3) & 0b111; + let r = instruction.regs[0].num & 0b111; let bank = bank_from_prefixes_64(SizeCode::vq, instruction.prefixes); @@ -8521,9 +8519,11 @@ fn read_operands< instruction.opcode = Opcode::NOP; } } - instruction.operands[0] = read_E(words, instruction, modrm, bank, sink)?; + instruction.operands[0] = mem_oper; if instruction.operands[0] != OperandSpec::RegMMM { instruction.mem_size = 64; + } else { + instruction.regs[1].bank = bank; } instruction.operand_count = 1; } -- cgit v1.1