Fix the FXSAVE/FXRSTOR instructions.
This commit is contained in:
@@ -819,6 +819,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
int pc_off = 0;
|
||||
int test_modrm = 1;
|
||||
int c;
|
||||
uint16_t op87 = 0x0000;
|
||||
|
||||
op_ea_seg = &cpu_state.seg_ds;
|
||||
op_ssegs = 0;
|
||||
@@ -872,6 +873,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
break;
|
||||
|
||||
case 0xd8:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_d8_a32 : x86_dynarec_opcodes_d8_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_d8;
|
||||
opcode_shift = 3;
|
||||
@@ -882,6 +884,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xd9:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_d9_a32 : x86_dynarec_opcodes_d9_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_d9;
|
||||
opcode_mask = 0xff;
|
||||
@@ -891,6 +894,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xda:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_da_a32 : x86_dynarec_opcodes_da_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_da;
|
||||
opcode_mask = 0xff;
|
||||
@@ -900,6 +904,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdb:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_db_a32 : x86_dynarec_opcodes_db_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_db;
|
||||
opcode_mask = 0xff;
|
||||
@@ -909,6 +914,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdc:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_dc_a32 : x86_dynarec_opcodes_dc_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_dc;
|
||||
opcode_shift = 3;
|
||||
@@ -919,6 +925,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdd:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_dd_a32 : x86_dynarec_opcodes_dd_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_dd;
|
||||
opcode_mask = 0xff;
|
||||
@@ -928,6 +935,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xde:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_de_a32 : x86_dynarec_opcodes_de_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_de;
|
||||
opcode_mask = 0xff;
|
||||
@@ -937,6 +945,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdf:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_df_a32 : x86_dynarec_opcodes_df_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_df;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1000,6 +1009,10 @@ generate_call:
|
||||
recomp_op_table = recomp_opcodes;
|
||||
}
|
||||
|
||||
if (op87 != 0x0000) {
|
||||
STORE_IMM_ADDR_W((uintptr_t) &x87_op, op87);
|
||||
}
|
||||
|
||||
if (recomp_op_table && recomp_op_table[(opcode | op_32) & 0x1ff]) {
|
||||
uint32_t new_pc = recomp_op_table[(opcode | op_32) & 0x1ff](opcode, fetchdat, op_32, op_pc, block);
|
||||
if (new_pc) {
|
||||
|
||||
@@ -1858,6 +1858,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
int pc_off = 0;
|
||||
int test_modrm = 1;
|
||||
int c;
|
||||
uint16_t op87 = 0x0000;
|
||||
|
||||
op_ea_seg = &cpu_state.seg_ds;
|
||||
op_ssegs = 0;
|
||||
@@ -1912,6 +1913,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
break;
|
||||
|
||||
case 0xd8:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_d8_a32 : x86_dynarec_opcodes_d8_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_d8;
|
||||
opcode_shift = 3;
|
||||
@@ -1922,6 +1924,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xd9:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_d9_a32 : x86_dynarec_opcodes_d9_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_d9;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1931,6 +1934,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xda:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_da_a32 : x86_dynarec_opcodes_da_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_da;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1940,6 +1944,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdb:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_db_a32 : x86_dynarec_opcodes_db_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_db;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1949,6 +1954,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdc:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_dc_a32 : x86_dynarec_opcodes_dc_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_dc;
|
||||
opcode_shift = 3;
|
||||
@@ -1959,6 +1965,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdd:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_dd_a32 : x86_dynarec_opcodes_dd_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_dd;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1968,6 +1975,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xde:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_de_a32 : x86_dynarec_opcodes_de_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_de;
|
||||
opcode_mask = 0xff;
|
||||
@@ -1977,6 +1985,7 @@ codegen_generate_call(uint8_t opcode, OpFn op, uint32_t fetchdat, uint32_t new_p
|
||||
block->flags |= CODEBLOCK_HAS_FPU;
|
||||
break;
|
||||
case 0xdf:
|
||||
op87 = (op87 & 0xf800) | ((opcode & 0x07) << 8) | (fetchdat & 0xff);
|
||||
op_table = (op_32 & 0x200) ? x86_dynarec_opcodes_df_a32 : x86_dynarec_opcodes_df_a16;
|
||||
recomp_op_table = fpu_softfloat ? NULL : recomp_opcodes_df;
|
||||
opcode_mask = 0xff;
|
||||
@@ -2041,6 +2050,10 @@ generate_call:
|
||||
recomp_op_table = recomp_opcodes;
|
||||
}
|
||||
|
||||
if (op87 != 0x0000) {
|
||||
STORE_IMM_ADDR_W((uintptr_t) &x87_op, op87);
|
||||
}
|
||||
|
||||
if (recomp_op_table && recomp_op_table[(opcode | op_32) & 0x1ff]) {
|
||||
uint32_t new_pc = recomp_op_table[(opcode | op_32) & 0x1ff](opcode, fetchdat, op_32, op_pc, block);
|
||||
if (new_pc) {
|
||||
|
||||
Reference in New Issue
Block a user