LibX86: Apply REX.W to B9-BF MOVs

All the MOVs in the B8-BF range can use the REX.W prefix, not just B8.
Previously instructions like `48 B9... mov rcx, imm64` were interpreted
as `mov rcx, imm32` because the REX.W prefix was only applied to
`48 B8... mov rax, imm64`.
This commit is contained in:
Simon Wanner 2023-10-23 18:26:27 +02:00 committed by Andreas Kling
parent 4fc1daa69f
commit 1d68c64b98
Notes: sideshowbarker 2024-07-16 22:54:10 +09:00

View file

@ -1236,7 +1236,8 @@ static void build_sse_66_slash(u8 op, u8 slash, char const* mnemonic, Instructio
table64[0x9A] = {}; // far CALL
table64[0x9C].long_mode_default_64 = true; // PUSHF/D/Q
table64[0x9D].long_mode_default_64 = true; // POPF/D/Q
build_in_table(table64, 0xB8, "MOV", OP_regW_immW, &Interpreter::MOV_reg32_imm32, LockPrefixNotAllowed);
for (u8 mov = 0xB8; mov <= 0xBF; ++mov)
build_in_table(table64, mov, "MOV", OP_regW_immW, &Interpreter::MOV_reg32_imm32, LockPrefixNotAllowed);
table64[0xC2].long_mode_force_64 = true; // near RET
table64[0xC3].long_mode_force_64 = true; // near RET
table64[0xC4] = {}; // LES