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

@@ -32,7 +32,7 @@ static inline void call(codeblock_t *block, uintptr_t func)
codegen_alloc_bytes(block, 5);
diff = func - (uintptr_t)&block_write_data[block_pos + 5];
if (diff >= -0x80000000ULL && diff < 0x7fffffffULL)
if (diff >= -0x80000000 && diff < 0x7fffffff)
{
codegen_addbyte(block, 0xE8); /*CALL*/
codegen_addlong(block, (uint32_t)diff);
@@ -53,7 +53,7 @@ static inline void jmp(codeblock_t *block, uintptr_t func)
codegen_alloc_bytes(block, 5);
diff = func - (uintptr_t)&block_write_data[block_pos + 5];
if (diff >= -0x80000000ULL && diff < 0x7fffffffULL)
if (diff >= -0x80000000 && diff < 0x7fffffff)
{
codegen_addbyte(block, 0xe9); /*JMP*/
codegen_addlong(block, (uint32_t)diff);