Added a way to hide SSE 4.2, as it might slow down things using the string opcodes. Also, looks like some java program have issue with current implementation of pcmp[ei]str[im] somehow, so diabling automaticaly when detecting libjvm.so (for SlayTheSpire in particular)

This commit is contained in:
ptitSeb 2024-04-29 10:57:19 +02:00
parent a9a338ff42
commit 71c5447b8a
7 changed files with 30 additions and 6 deletions

View File

@ -306,6 +306,11 @@ Disables the load of vulkan libraries.
* 0 : Load vulkan libraries if found.
* 1 : Disables the load of vulkan libraries, both the native and the i386 version (can be useful on Pi4, where the vulkan driver is not quite there yet.)
#### BOX64_SSE42 *
Expose or not SSE 4.2 capabilites
* 0 : Do not expose SSE 4.2 capabilites (default when libjvm is detected)
* 1 : Expose SSE 4.2 capabilites (Default.)
#### BOX64_FUTEX_WAITV *
Use of the new fuext_waitc syscall
* 0 : Do not try to use it, return unsupported (Default for BAD_SIGNAL build)

View File

@ -147,6 +147,7 @@ int box64_prefer_wrapped = 0;
int box64_sse_flushto0 = 0;
int box64_x87_no80bits = 0;
int box64_sync_rounding = 0;
int box64_sse42 = 1;
int fix_64bit_inodes = 0;
int box64_dummy_crashhandler = 1;
int box64_mapclean = 0;
@ -970,6 +971,15 @@ void LoadLogEnv()
printf_log(LOG_INFO, "Disable the use of futex waitv syscall\n");
#endif
}
p = getenv("BOX64_SSE42");
if(p) {
if(strlen(p)==1) {
if(p[0]>='0' && p[0]<='0'+1)
box64_sse42 = p[0]-'0';
}
if(!box64_sse42)
printf_log(LOG_INFO, "Do not expose SSE 4.2 capabilities\n");
}
p = getenv("BOX64_FIX_64BIT_INODES");
if(p) {
if(strlen(p)==1) {

View File

@ -92,6 +92,7 @@ extern int box64_dummy_crashhandler;
extern int box64_sse_flushto0;
extern int box64_x87_no80bits;
extern int box64_sync_rounding;
extern int box64_sse42;
extern int allow_missing_libs;
extern int box64_mapclean;
extern int box64_prefer_wrapped;

View File

@ -334,16 +334,21 @@ static int loadEmulatedLib(const char* libname, library_t *lib, box64context_t*
box64_dynarec_bigblock = 0;
box64_dynarec_strongmem = 1;
}
if(libname && box64_dynarec_jvm && strstr(libname, "libjvm.so")) {
printf_dump(LOG_INFO, "libjvm detected, disable Dynarec BigBlock and enable Dynarec StrongMem\n");
box64_dynarec_bigblock = 0;
box64_dynarec_strongmem = 1;
}
if(libname && box64_dynarec_tbb && strstr(libname, "libtbb.so")) {
printf_dump(LOG_INFO, "libtbb detected, enable Dynarec StrongMem\n");
box64_dynarec_strongmem = 3;
}
#endif
if(libname && box64_dynarec_jvm && strstr(libname, "libjvm.so")) {
#ifdef DYNAREC
printf_dump(LOG_INFO, "libjvm detected, disable Dynarec BigBlock and enable Dynarec StrongMem, hide SSE 4.2\n");
box64_dynarec_bigblock = 0;
box64_dynarec_strongmem = 1;
#else
printf_dump(LOG_INFO, "libjvm detected, hide SSE 4.2\n");
#endif
box64_sse42 = 0;
}
if(libname && box64_libcef && strstr(libname, "libcef.so")) {
printf_dump(LOG_INFO, "libcef detected, using malloc_hack_2\n");
box64_malloc_hack = 2;

View File

@ -257,7 +257,7 @@ void my_cpuid(x64emu_t* emu, uint32_t tmp32u)
//| 1<<12 // fma // some games treat FMA as AVX
| 1<<13 // cx16 (cmpxchg16)
| 1<<19 // SSE4_1
| 1<<20 // SSE4_2
| (box64_sse42?(1<<20):0) // SSE4_2 can be hiden
| 1<<22 // MOVBE
| 1<<23 // POPCOUNT
| 1<<25 // aesni

View File

@ -96,6 +96,7 @@ ENTRYBOOL(BOX64_CRASHHANDLER, box64_dummy_crashhandler) \
ENTRYBOOL(BOX64_NOPULSE, box64_nopulse) \
ENTRYBOOL(BOX64_NOGTK, box64_nogtk) \
ENTRYBOOL(BOX64_NOVULKAN, box64_novulkan) \
ENTRYBOOL(BOX64_SSE42, box64_sse42) \
ENTRYBOOL(BOX64_FUTEX_WAITV, box64_futex_waitv) \
ENTRYSTRING_(BOX64_BASH, bash) \
ENTRYINT(BOX64_JITGDB, jit_gdb, 0, 3, 2) \

View File

@ -135,6 +135,8 @@ BOX64_DYNAREC_STRONGMEM=3
BOX64_DYNAREC_SAFEFLAGS=2
BOX64_DYNAREC_JVM=0
BOX64_DYNAREC_ALIGNED_ATOMICS=1
BOX64_SSE42=0
BOX64_MAXCPU=4
[Soma.bin.x86_64]
# This is needed or the physics engine will not behave correctly