소스 검색

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`.
Simon Wanner 1 년 전
부모
커밋
1d68c64b98
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      Userland/Libraries/LibX86/Instruction.cpp

+ 2 - 1
Userland/Libraries/LibX86/Instruction.cpp

@@ -1236,7 +1236,8 @@ static void build_sse_66_slash(u8 op, u8 slash, char const* mnemonic, Instructio
     table64[0x9A] = {};                         // far CALL
     table64[0x9A] = {};                         // far CALL
     table64[0x9C].long_mode_default_64 = true;  // PUSHF/D/Q
     table64[0x9C].long_mode_default_64 = true;  // PUSHF/D/Q
     table64[0x9D].long_mode_default_64 = true;  // POPF/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[0xC2].long_mode_force_64 = true;   // near RET
     table64[0xC3].long_mode_force_64 = true;   // near RET
     table64[0xC3].long_mode_force_64 = true;   // near RET
     table64[0xC4] = {};                        // LES
     table64[0xC4] = {};                        // LES