fix(codegen): decode xadd byte and popcnt instruction lengths fix

This commit is contained in:
boykopovar
2026-09-27 12:49:46 +03:00
parent e3dc9a6acc
commit 43d2e8b4dc
2 changed files with 6 additions and 2 deletions
@@ -153,6 +153,8 @@ inline constexpr std::uint8_t TwoByteShldCl = 0xA5;
inline constexpr std::uint8_t TwoByteShrdImm8 = 0xAC;
inline constexpr std::uint8_t TwoByteShrdCl = 0xAD;
inline constexpr std::uint8_t TwoByteGrp15 = 0xAE;
inline constexpr std::uint8_t TwoBytePopcnt = 0xB8;
inline constexpr std::uint8_t TwoByteXaddRm8 = 0xC0;
inline constexpr std::uint8_t TwoByteXadd = 0xC1;
inline constexpr std::uint8_t TwoBytePextrw = 0xC5;
inline constexpr std::uint8_t TwoByteShufpsImm8 = 0xC2;
@@ -246,7 +246,8 @@ std::size_t X64InstructionDecoder::Decode(const std::uint8_t* data, std::size_t
opcode == TwoByteImulRmModRm ||
opcode == TwoByteGrp7 ||
opcode == TwoByteGrp15 ||
opcode == TwoByteXadd ||
opcode == TwoBytePopcnt ||
opcode == TwoByteXaddRm8 || opcode == TwoByteXadd ||
opcode == TwoByteGrp9 ||
opcode == TwoByteNopModRm || opcode == TwoByteEndbr) {
hasModRm = true;
@@ -497,7 +498,8 @@ DecodedInstructionInfo X64InstructionDecoder::DecodeInstruction(
(op >= TwoBytePrefetchGrpMin && op <= TwoBytePrefetchGrpMax) ||
(op >= TwoByteSetccMin && op <= TwoByteSetccMax) ||
op == TwoByteImulRmModRm || op == TwoByteGrp7 ||
op == TwoByteGrp15 || op == TwoByteXadd ||
op == TwoBytePopcnt ||
op == TwoByteGrp15 || op == TwoByteXaddRm8 || op == TwoByteXadd ||
op == TwoByteGrp9 || op == TwoByteNopModRm ||
op == TwoByteEndbr || op == TwoByteMovImm8ModRm ||
(op >= TwoByteShiftImm8Min && op <= TwoByteShiftImm8Max) ||