Moved integer registers, PC and flags_* variables into new cpu_state structure. Reduces recompiled code size slightly, small speedup (1-3%).
This commit is contained in:
parent
1fe6233d4c
commit
c81a91fd72
52 changed files with 1494 additions and 1408 deletions
|
|
@ -7,10 +7,10 @@
|
|||
return 0; \
|
||||
\
|
||||
dst_reg = LOAD_REG_B(fetchdat & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8); \
|
||||
src_reg = LOAD_REG_B((fetchdat >> 3) & 7); \
|
||||
op ## _HOST_REG_B(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_B_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -25,10 +25,10 @@
|
|||
return 0; \
|
||||
\
|
||||
dst_reg = LOAD_REG_W(fetchdat & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16); \
|
||||
src_reg = LOAD_REG_W((fetchdat >> 3) & 7); \
|
||||
op ## _HOST_REG_W(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_W_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -43,10 +43,10 @@
|
|||
return 0; \
|
||||
\
|
||||
dst_reg = LOAD_REG_L(fetchdat & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32); \
|
||||
src_reg = LOAD_REG_L((fetchdat >> 3) & 7); \
|
||||
op ## _HOST_REG_L(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_L_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -70,9 +70,9 @@
|
|||
} \
|
||||
\
|
||||
dst_reg = LOAD_REG_B((fetchdat >> 3) & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8); \
|
||||
op ## _HOST_REG_B(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_B_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -96,9 +96,9 @@
|
|||
} \
|
||||
\
|
||||
dst_reg = LOAD_REG_W((fetchdat >> 3) & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16); \
|
||||
op ## _HOST_REG_W(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_W_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -122,9 +122,9 @@
|
|||
} \
|
||||
\
|
||||
dst_reg = LOAD_REG_L((fetchdat >> 3) & 7); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32); \
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32); \
|
||||
op ## _HOST_REG_L(dst_reg, src_reg); \
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, dst_reg); \
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, dst_reg); \
|
||||
if (writeback) STORE_REG_L_RELEASE(dst_reg); \
|
||||
else RELEASE_REG(dst_reg); \
|
||||
RELEASE_REG(src_reg); \
|
||||
|
|
@ -153,9 +153,9 @@ static uint32_t ropTEST_b_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
}
|
||||
|
||||
dst_reg = LOAD_REG_B((fetchdat >> 3) & 7);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
dst_reg = TEST_HOST_REG_B(dst_reg, src_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, dst_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, dst_reg);
|
||||
RELEASE_REG(dst_reg);
|
||||
RELEASE_REG(src_reg);
|
||||
|
||||
|
|
@ -178,9 +178,9 @@ static uint32_t ropTEST_w_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
}
|
||||
|
||||
dst_reg = LOAD_REG_W((fetchdat >> 3) & 7);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
dst_reg = TEST_HOST_REG_W(dst_reg, src_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, dst_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, dst_reg);
|
||||
RELEASE_REG(dst_reg);
|
||||
RELEASE_REG(src_reg);
|
||||
|
||||
|
|
@ -203,9 +203,9 @@ static uint32_t ropTEST_l_rm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
}
|
||||
|
||||
dst_reg = LOAD_REG_L((fetchdat >> 3) & 7);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
dst_reg = TEST_HOST_REG_L(dst_reg, src_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, dst_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, dst_reg);
|
||||
RELEASE_REG(dst_reg);
|
||||
RELEASE_REG(src_reg);
|
||||
|
||||
|
|
@ -217,8 +217,8 @@ static uint32_t ropAND_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_B(REG_AL);
|
||||
|
||||
AND_HOST_REG_IMM(host_reg, (fetchdat & 0xff) | 0xffffff00);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_B_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 1;
|
||||
|
|
@ -228,8 +228,8 @@ static uint32_t ropAND_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_W(REG_AX);
|
||||
|
||||
AND_HOST_REG_IMM(host_reg, (fetchdat & 0xffff) | 0xffff0000);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_W_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 2;
|
||||
|
|
@ -240,8 +240,8 @@ static uint32_t ropAND_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32
|
|||
|
||||
fetchdat = fastreadl(cs + op_pc);
|
||||
AND_HOST_REG_IMM(host_reg, fetchdat);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_L_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 4;
|
||||
|
|
@ -252,8 +252,8 @@ static uint32_t ropOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_B(REG_AL);
|
||||
|
||||
OR_HOST_REG_IMM(host_reg, fetchdat & 0xff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_B_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 1;
|
||||
|
|
@ -263,8 +263,8 @@ static uint32_t ropOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_W(REG_AX);
|
||||
|
||||
OR_HOST_REG_IMM(host_reg, fetchdat & 0xffff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_W_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 2;
|
||||
|
|
@ -275,8 +275,8 @@ static uint32_t ropOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
|
||||
fetchdat = fastreadl(cs + op_pc);
|
||||
OR_HOST_REG_IMM(host_reg, fetchdat);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_L_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 4;
|
||||
|
|
@ -287,8 +287,8 @@ static uint32_t ropTEST_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32
|
|||
int host_reg = LOAD_REG_B(REG_AL);
|
||||
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, fetchdat & 0xff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
|
||||
return op_pc + 1;
|
||||
|
|
@ -298,8 +298,8 @@ static uint32_t ropTEST_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32
|
|||
int host_reg = LOAD_REG_W(REG_AX);
|
||||
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, fetchdat & 0xffff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
|
||||
return op_pc + 2;
|
||||
|
|
@ -310,8 +310,8 @@ static uint32_t ropTEST_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_3
|
|||
|
||||
fetchdat = fastreadl(cs + op_pc);
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, fetchdat);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
|
||||
return op_pc + 4;
|
||||
|
|
@ -322,8 +322,8 @@ static uint32_t ropXOR_AL_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_B(REG_AL);
|
||||
|
||||
XOR_HOST_REG_IMM(host_reg, fetchdat & 0xff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_B_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 1;
|
||||
|
|
@ -333,8 +333,8 @@ static uint32_t ropXOR_AX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32,
|
|||
int host_reg = LOAD_REG_W(REG_AX);
|
||||
|
||||
XOR_HOST_REG_IMM(host_reg, fetchdat & 0xffff);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_W_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 2;
|
||||
|
|
@ -345,8 +345,8 @@ static uint32_t ropXOR_EAX_imm(uint8_t opcode, uint32_t fetchdat, uint32_t op_32
|
|||
|
||||
fetchdat = fastreadl(cs + op_pc);
|
||||
XOR_HOST_REG_IMM(host_reg, fetchdat);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
STORE_REG_L_RELEASE(host_reg);
|
||||
|
||||
return op_pc + 4;
|
||||
|
|
@ -374,9 +374,9 @@ static uint32_t ropF6(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_
|
|||
MEM_LOAD_ADDR_EA_B(target_seg);
|
||||
host_reg = 0;
|
||||
}
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN8);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN8);
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, imm);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
return op_pc + 2;
|
||||
|
||||
|
|
@ -391,13 +391,13 @@ static uint32_t ropF6(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_
|
|||
case 0x18: /*NEG b*/
|
||||
if ((fetchdat & 0xc0) != 0xc0)
|
||||
return 0;
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_SUB8);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_SUB8);
|
||||
host_reg = LOAD_REG_B(fetchdat & 7);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_op2, host_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_op2, host_reg);
|
||||
NEG_HOST_REG_B(host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op1, 0);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op1, 0);
|
||||
STORE_REG_B_RELEASE(host_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR_BL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
return op_pc + 1;
|
||||
}
|
||||
|
||||
|
|
@ -425,9 +425,9 @@ static uint32_t ropF7_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
|
|||
MEM_LOAD_ADDR_EA_W(target_seg);
|
||||
host_reg = 0;
|
||||
}
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN16);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN16);
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, imm);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
return op_pc + 3;
|
||||
|
||||
|
|
@ -442,13 +442,13 @@ static uint32_t ropF7_w(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
|
|||
case 0x18: /*NEG w*/
|
||||
if ((fetchdat & 0xc0) != 0xc0)
|
||||
return 0;
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_SUB16);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_SUB16);
|
||||
host_reg = LOAD_REG_W(fetchdat & 7);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_op2, host_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_op2, host_reg);
|
||||
NEG_HOST_REG_W(host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op1, 0);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op1, 0);
|
||||
STORE_REG_W_RELEASE(host_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR_WL((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
return op_pc + 1;
|
||||
}
|
||||
|
||||
|
|
@ -476,9 +476,9 @@ static uint32_t ropF7_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
|
|||
MEM_LOAD_ADDR_EA_L(target_seg);
|
||||
host_reg = 0;
|
||||
}
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_ZN32);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_ZN32);
|
||||
host_reg = TEST_HOST_REG_IMM(host_reg, imm);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
RELEASE_REG(host_reg);
|
||||
return op_pc + 5;
|
||||
|
||||
|
|
@ -493,13 +493,13 @@ static uint32_t ropF7_l(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint3
|
|||
case 0x18: /*NEG l*/
|
||||
if ((fetchdat & 0xc0) != 0xc0)
|
||||
return 0;
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op, FLAGS_SUB32);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op, FLAGS_SUB32);
|
||||
host_reg = LOAD_REG_L(fetchdat & 7);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_op2, host_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_op2, host_reg);
|
||||
NEG_HOST_REG_L(host_reg);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&flags_op1, 0);
|
||||
STORE_IMM_ADDR_L((uintptr_t)&cpu_state.flags_op1, 0);
|
||||
STORE_REG_L_RELEASE(host_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&flags_res, host_reg);
|
||||
STORE_HOST_REG_ADDR((uintptr_t)&cpu_state.flags_res, host_reg);
|
||||
return op_pc + 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue