about summary refs log tree commit diff stats
path: root/src/core.c
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2024-11-25 18:28:19 +0800
committerGitHub <noreply@github.com>2024-11-25 11:28:19 +0100
commit84608fc581546076d6a34ae18c864eb8cde6ddae (patch)
treec746c42a1af7b04b3ac0d0988297661aef9d0b77 /src/core.c
parentc30a392fe863aca59a6be34c03c0fa226b576de8 (diff)
downloadbox64-84608fc581546076d6a34ae18c864eb8cde6ddae.tar.gz
box64-84608fc581546076d6a34ae18c864eb8cde6ddae.zip
[ARM64_DYNAREC] Added DYNAREC_PAUSE option for hint instructions (#2070)
* [ARM64_DYNAREC] Added DYNAREC_PAUSE option for hint instructions

* Use sevl for wfe

* Add docs

* Fix typo

* use switch case
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 5060823f..e5aab281 100644
--- a/src/core.c
+++ b/src/core.c
@@ -80,6 +80,7 @@ int box64_dynarec_bigblock = 1;
 int box64_dynarec_forward = 128;
 int box64_dynarec_strongmem = 0;
 int box64_dynarec_weakbarrier = 0;
+int box64_dynarec_pause = 0;
 int box64_dynarec_x87double = 0;
 int box64_dynarec_div0 = 0;
 int box64_dynarec_fastnan = 1;
@@ -787,6 +788,18 @@ void LoadLogEnv()
         if (box64_dynarec_weakbarrier)
             printf_log(LOG_INFO, "Dynarec will try to use weaker memory barriers to reduce the performance loss introduce by strong memory emulation\n");
     }
+#ifdef ARM64
+    p = getenv("BOX64_DYNAREC_PAUSE");
+    if (p) {
+        if (strlen(p) == 1) {
+            if (p[0] >= '0' && p[0] <= '3')
+                box64_dynarec_pause = p[0] - '0';
+        }
+        if (box64_dynarec_pause)
+            printf_log(LOG_INFO, "Dynarec will use %s to emulate pause instruction\n",
+                box64_dynarec_pause == 1 ? "yield" : (box64_dynarec_pause == 2 ? "wfi" : "wfe"));
+    }
+#endif
     p = getenv("BOX64_DYNAREC_X87DOUBLE");
     if(p) {
         if(strlen(p)==1) {