From 067dcbc0f75533761b430d58724df2489a678f5c Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Tue, 25 Oct 2022 18:34:38 +0200 Subject: [PATCH] [DYNAREC] Added BIGBLOCK=3 level --- docs/USAGE.md | 3 ++- src/dynarec/dynarec_native_pass.c | 5 ++++- src/main.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/docs/USAGE.md b/docs/USAGE.md index 78f83b12..6085c2a0 100755 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -130,7 +130,8 @@ Forbid dynablock creation in the interval specified (helpfull for debugging beha Enables/Disables Box64's Dynarec building BigBlock. * 0 : Don't try to build block as big as possible (can help program using lots of thread and a JIT, like C#/Unity) (Default when libmonobdwgc-2.0.so is loaded) * 1 : Build Dynarec block as big as possible (Default.) - * 2 : Build Dynarec block bigger (don't stop when block overlaps) + * 2 : Build Dynarec block bigger (don't stop when block overlaps, but only for blocks in elf memory) + * 3 : Build Dynarec block bigger (don't stop when block overlaps, for all type of memory) #### BOX64_DYNAREC_STRONGMEM Enable/Disable simulation of Strong Memory model diff --git a/src/dynarec/dynarec_native_pass.c b/src/dynarec/dynarec_native_pass.c index b095889a..86743179 100755 --- a/src/dynarec/dynarec_native_pass.c +++ b/src/dynarec/dynarec_native_pass.c @@ -18,6 +18,7 @@ #include "dynablock.h" #include "dynarec_native.h" #include "custommem.h" +#include "elfloader.h" #include "dynarec_arch.h" #include "dynarec_helper.h" @@ -43,6 +44,7 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr) fpu_reset(dyn); int reset_n = -1; dyn->last_ip = (dyn->insts && dyn->insts[0].pred_sz)?0:ip; // RIP is always set at start of block unless there is a predecessor! + int stopblock = 2+(FindElfAddress(my_context, addr)?0:1); // if block is in elf_memory, it can be extended with bligblocks==2, else it needs 3 // ok, go now INIT; while(ok) { @@ -217,7 +219,8 @@ uintptr_t native_pass(dynarec_native_t* dyn, uintptr_t addr) if(ok<0) {ok = 0; need_epilog=1;} ++ninst; #if STEP == 0 - if(ok && ((!isJumpTableDefault64((void*)addr) && (box64_dynarec_bigblock<2)) || (addr>=box64_nodynarec_start && addr=box64_nodynarec_start && addrsize)) #endif diff --git a/src/main.c b/src/main.c index b522f635..542cdea1 100755 --- a/src/main.c +++ b/src/main.c @@ -421,13 +421,13 @@ void LoadLogEnv() p = getenv("BOX64_DYNAREC_BIGBLOCK"); if(p) { if(strlen(p)==1) { - if(p[0]>='0' && p[0]<='2') + if(p[0]>='0' && p[0]<='3') box64_dynarec_bigblock = p[0]-'0'; } if(!box64_dynarec_bigblock) printf_log(LOG_INFO, "Dynarec will not try to make big block\n"); else if (box64_dynarec_bigblock>1) - printf_log(LOG_INFO, "Dynarec will try to make bigger blocks\n"); + printf_log(LOG_INFO, "Dynarec will try to make bigger blocks%s\n", (box64_dynarec_bigblock>2)?" even on non-elf memory":""); } p = getenv("BOX64_DYNAREC_STRONGMEM");