From 485851c914695e0884609c68e318d22fee1db9b8 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 3 May 2026 17:56:19 +0000 Subject: more precision for vinsert/vextract/vblendv{ps,pd} --- src/real_mode/vex.rs | 46 +++++++++++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 15 deletions(-) (limited to 'src/real_mode/vex.rs') diff --git a/src/real_mode/vex.rs b/src/real_mode/vex.rs index 9651760..1c1470a 100644 --- a/src/real_mode/vex.rs +++ b/src/real_mode/vex.rs @@ -2642,16 +2642,24 @@ fn read_vex_instruction< VEXOperandCode::G_V_xmm_Ev_imm8 }) }, - 0x38 => (Opcode::VINSERTI128, if L { - VEXOperandCode::G_ymm_V_ymm_E_xmm_imm8 - } else { + 0x38 => if instruction.prefixes.vex_unchecked().w() { return Err(DecodeError::InvalidOpcode); - }), - 0x39 => (Opcode::VEXTRACTI128, if L { - VEXOperandCode::E_xmm_G_ymm_imm8 } else { + (Opcode::VINSERTI128, if L { + VEXOperandCode::G_ymm_V_ymm_E_xmm_imm8 + } else { + return Err(DecodeError::InvalidOpcode); + }) + }, + 0x39 => if instruction.prefixes.vex_unchecked().w() { return Err(DecodeError::InvalidOpcode); - }), + } else { + (Opcode::VEXTRACTI128, if L { + VEXOperandCode::E_xmm_G_ymm_imm8 + } else { + return Err(DecodeError::InvalidOpcode); + }) + }, 0x40 => (Opcode::VDPPS, VEXOperandCode::G_V_E_xyLmm_imm8), 0x41 => (Opcode::VDPPD, if L { return Err(DecodeError::InvalidOpcode); @@ -2672,16 +2680,24 @@ fn read_vex_instruction< } else { return Err(DecodeError::InvalidOpcode); }), - 0x4A => (Opcode::VBLENDVPS, if L { - VEXOperandCode::G_V_E_ymm_ymm4 + 0x4A => if instruction.prefixes.vex_unchecked().w() { + return Err(DecodeError::InvalidOpcode); } else { - VEXOperandCode::G_V_E_xmm_xmm4 - }), - 0x4B => (Opcode::VBLENDVPD, if L { - VEXOperandCode::G_V_E_ymm_ymm4 + (Opcode::VBLENDVPS, if L { + VEXOperandCode::G_V_E_ymm_ymm4 + } else { + VEXOperandCode::G_V_E_xmm_xmm4 + }) + }, + 0x4B => if instruction.prefixes.vex_unchecked().w() { + return Err(DecodeError::InvalidOpcode); } else { - VEXOperandCode::G_V_E_xmm_xmm4 - }), + (Opcode::VBLENDVPD, if L { + VEXOperandCode::G_V_E_ymm_ymm4 + } else { + VEXOperandCode::G_V_E_xmm_xmm4 + }) + }, 0x4C => if instruction.prefixes.vex_unchecked().w() { return Err(DecodeError::InvalidOpcode); } else { -- cgit v1.1