From 2b13f206b94e885dd3f58eac96357cb892ea1d1a Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 3 Jul 2021 13:47:03 -0700 Subject: instructions with evex-coded registers may have registers other than 0 --- src/shared/evex.in | 7 ------- test/long_mode/mod.rs | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/shared/evex.in b/src/shared/evex.in index 989d463..98006ca 100644 --- a/src/shared/evex.in +++ b/src/shared/evex.in @@ -210,7 +210,6 @@ fn set_reg_sizes_from_ll(inst: &mut Instruction) -> Result<(), DecodeError> { pub(crate) fn read_evex_operands::Address, ::Word>>(words: &mut T, instruction: &mut Instruction, operand_code: generated::EVEXOperandCode) -> Result<(), DecodeError> { match operand_code { generated::EVEXOperandCode::Gm_V_E_LL_imm8_sae_bcast => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; let modrm = read_modrm(words)?; @@ -256,7 +255,6 @@ pub(crate) fn read_evex_operands::Address } } generated::EVEXOperandCode::Gm_V_Ed_xmm => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; if instruction.prefixes.evex_unchecked().broadcast() { return Err(DecodeError::InvalidOpcode); @@ -289,7 +287,6 @@ pub(crate) fn read_evex_operands::Address set_reg_sizes(instruction, RegisterBank::X); } generated::EVEXOperandCode::Gm_V_Eq_xmm_sae_W1 => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; ensure_W(instruction, 1)?; @@ -316,7 +313,6 @@ pub(crate) fn read_evex_operands::Address set_reg_sizes(instruction, RegisterBank::X); } generated::EVEXOperandCode::Gm_V_Ed_xmm_sae_bcast => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; let modrm = read_modrm(words)?; @@ -406,7 +402,6 @@ pub(crate) fn read_evex_operands::Address } } generated::EVEXOperandCode::Gm_V_E_LL_sae_bcast => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; let modrm = read_modrm(words)?; @@ -4287,7 +4282,6 @@ pub(crate) fn read_evex_operands::Address instruction.operand_count = 2; } generated::EVEXOperandCode::Gm_V_E_xmm_sae_W1 => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; ensure_W(instruction, 1)?; @@ -4314,7 +4308,6 @@ pub(crate) fn read_evex_operands::Address } } generated::EVEXOperandCode::Gm_V_E_xmm_sae => { - deny_vex_reg(instruction)?; check_mask_reg(instruction)?; if instruction.prefixes.evex_unchecked().vex().w() { diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index 974e141..6a45b38 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -3147,6 +3147,7 @@ fn test_x87() { #[test] fn test_mishegos_finds() { + test_display(&[0x62, 0x42, 0xd5, 0x9d, 0x97, 0xf6], "vfmsubadd132pd zmm30{k5}{z}{rne-sae}, zmm5, zmm14"); test_invalid(&[0x67, 0x66, 0x42, 0x0f, 0x01, 0xfe]); test_display(&[0x62, 0x52, 0x05, 0xff, 0xad, 0xfd], "vfnmadd213ss xmm15{k7}{z}{rz-sae}, xmm15, xmm13"); test_display(&[0x26, 0xf3, 0x0f, 0x3a, 0xf0, 0xc0, 0x24], "hreset 0x24"); -- cgit v1.1