Reorganized some CPU structures a bit and fixed inappropriate behavior of some mem.c functions on 64-bit binaries (and made mem.c aware of ARM64 as well), fixes both 64-bit recompilers, closes #1215.

This commit is contained in:
OBattler
2021-08-27 13:31:47 +02:00
parent eb827a6629
commit ddc7c5b78a
20 changed files with 181 additions and 176 deletions

View File

@@ -13,7 +13,7 @@
uint32_t ropJMP_r8(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc)
{
int32_t offset = (int32_t)(int8_t)fastreadb(cs + op_pc);
uint32_t offset = (int32_t)(int8_t)fastreadb(cs + op_pc);
uint32_t dest_addr = op_pc+1+offset;
if (!(op_32 & 0x100))
@@ -26,7 +26,7 @@ uint32_t ropJMP_r8(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t f
}
uint32_t ropJMP_r16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc)
{
int32_t offset = (int32_t)(int16_t)fastreadw(cs + op_pc);
uint32_t offset = (int32_t)(int16_t)fastreadw(cs + op_pc);
uint32_t dest_addr = op_pc+2+offset;
dest_addr &= 0xffff;
@@ -38,7 +38,7 @@ uint32_t ropJMP_r16(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t
}
uint32_t ropJMP_r32(codeblock_t *block, ir_data_t *ir, uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc)
{
int32_t offset = fastreadl(cs + op_pc);
uint32_t offset = fastreadl(cs + op_pc);
uint32_t dest_addr = op_pc+4+offset;
if (offset < 0)