From 87bf751b115267d7c388c849c43fca6d3f0d0881 Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Wed, 25 Oct 2023 20:14:11 +0800 Subject: [INTERP] Fix fpu_round (#1030) * [INTERP] Fix fpu_round * Should be working this time * Handling wrappedlibm * Format * Fix loongarch * Make it optional * Fix android build --- src/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index bc4a12e4..eb185c66 100644 --- a/src/main.c +++ b/src/main.c @@ -123,6 +123,7 @@ int box64_prefer_emulated = 0; int box64_prefer_wrapped = 0; int box64_sse_flushto0 = 0; int box64_x87_no80bits = 0; +int box64_sync_rounding = 0; int fix_64bit_inodes = 0; int box64_dummy_crashhandler = 1; int box64_mapclean = 0; @@ -1155,6 +1156,12 @@ void LoadEnvVars(box64context_t *context) printf_log(LOG_INFO, "BOX64: all 80bits x87 long double will be handle as double\n"); } } + if(getenv("BOX64_SYNC_ROUNDING")) { + if (strcmp(getenv("BOX64_SYNC_ROUNDING"), "1")==0) { + box64_sync_rounding = 1; + printf_log(LOG_INFO, "BOX64: rouding mode with be synced with fesetround/fegetround\n"); + } + } if(getenv("BOX64_PREFER_WRAPPED")) { if (strcmp(getenv("BOX64_PREFER_WRAPPED"), "1")==0) { box64_prefer_wrapped = 1; -- cgit 1.4.1