diff --git a/zasm/include/zasm/x86/emitter.hpp b/zasm/include/zasm/x86/emitter.hpp index 6f1399a..1e12d51 100644 --- a/zasm/include/zasm/x86/emitter.hpp +++ b/zasm/include/zasm/x86/emitter.hpp @@ -2086,14 +2086,6 @@ namespace zasm::x86 { return emit(x86::Mnemonic::Jecxz, a); } - inline Error jknzd(const Mask& a, const Imm& b) - { - return emit(x86::Mnemonic::Jknzd, a, b); - } - inline Error jkzd(const Mask& a, const Imm& b) - { - return emit(x86::Mnemonic::Jkzd, a, b); - } inline Error jl(const Imm& a) { return emit(x86::Mnemonic::Jl, a); diff --git a/zasm/src/zasm/src/encoder/encoder.cpp b/zasm/src/zasm/src/encoder/encoder.cpp index 9e2c0b0..4f123ee 100644 --- a/zasm/src/zasm/src/encoder/encoder.cpp +++ b/zasm/src/zasm/src/encoder/encoder.cpp @@ -33,6 +33,13 @@ namespace zasm static constexpr std::int32_t kHintRequiresSize = -1; + static constexpr auto kAllowedEncodingX86 = static_cast( + ZYDIS_ENCODABLE_ENCODING_LEGACY | ZYDIS_ENCODABLE_ENCODING_3DNOW); + + static constexpr auto kAllowedEncodingX64 = static_cast( + ZYDIS_ENCODABLE_ENCODING_LEGACY | ZYDIS_ENCODABLE_ENCODING_3DNOW | ZYDIS_ENCODABLE_ENCODING_XOP + | ZYDIS_ENCODABLE_ENCODING_VEX | ZYDIS_ENCODABLE_ENCODING_EVEX); + struct EncodeVariantsInfo { bool isControlFlow{}; @@ -532,10 +539,12 @@ namespace zasm if (mode == MachineMode::AMD64) { req.machine_mode = ZYDIS_MACHINE_MODE_LONG_64; + req.allowed_encodings = kAllowedEncodingX64; } else if (mode == MachineMode::I386) { req.machine_mode = ZYDIS_MACHINE_MODE_LONG_COMPAT_32; + req.allowed_encodings = kAllowedEncodingX86; } req.mnemonic = static_cast(mnemonic.value()); req.prefixes = getAttribs(attribs);