diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2025-04-16 14:53:54 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2025-04-16 14:53:54 +0200 |
| commit | d7eb87129eb6aa7eeac61ddeeb1357a654380e4b (patch) | |
| tree | bcef36a1252ff8b00b33a2ce096e4dbbe4bd5cfd /src/dynarec/dynarec_native.c | |
| parent | 7f569247d511e397e72b369de2315385c879e5d1 (diff) | |
| download | box64-d7eb87129eb6aa7eeac61ddeeb1357a654380e4b.tar.gz box64-d7eb87129eb6aa7eeac61ddeeb1357a654380e4b.zip | |
[DYNAREC] Introduce BOX64_DYNAREC_X87DOUBLE=2 to handle Low Precision x87 ([ARM64_DYNAREC] only for now)
Diffstat (limited to 'src/dynarec/dynarec_native.c')
| -rw-r--r-- | src/dynarec/dynarec_native.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/dynarec/dynarec_native.c b/src/dynarec/dynarec_native.c index 7574b124..2c4aa72b 100644 --- a/src/dynarec/dynarec_native.c +++ b/src/dynarec/dynarec_native.c @@ -636,6 +636,11 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit CancelBlock64(0); return NULL; } + #ifdef ARCH_PRECISION + if(BOX64ENV(dynarec_x87double)==2) { + helper.need_x87check = 1; + } + #endif // basic checks if(!helper.size) { dynarec_log(LOG_INFO, "Warning, null-sized dynarec block (%p)\n", (void*)addr); @@ -768,6 +773,12 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit CancelBlock64(0); return NULL; } + #ifdef ARCH_PRECISION + if(BOX64ENV(dynarec_x87double)==2) { + if(helper.need_x87check==1) + helper.need_x87check = 0; + } + #endif // pass 2, instruction size helper.callrets = static_callrets; @@ -796,7 +807,7 @@ void* FillBlock64(dynablock_t* block, uintptr_t addr, int alternate, int is32bit size_t insts_rsize = (helper.insts_size+2)*sizeof(instsize_t); insts_rsize = (insts_rsize+7)&~7; // round the size... size_t arch_size = ARCH_SIZE(&helper); - size_t callret_size = helper.callret_size*4; + size_t callret_size = helper.callret_size*sizeof(callret_t); // ok, now allocate mapped memory, with executable flag on size_t sz = sizeof(void*) + native_size + helper.table64size*sizeof(uint64_t) + 4*sizeof(void*) + insts_rsize + arch_size + callret_size; // dynablock_t* block (arm insts) table64 jmpnext code instsize arch callrets |