about summary refs log tree commit diff stats
path: root/src/dynarec/la64
diff options
context:
space:
mode:
authorYang Liu <liuyang22@iscas.ac.cn>2025-10-14 15:11:15 +0800
committerGitHub <noreply@github.com>2025-10-14 09:11:15 +0200
commit3d0423acf703be7e0e7b004ee85630f6684bf72e (patch)
treeffd0958823f0cd8a4a2ac2cccfea53ed6ff2350d /src/dynarec/la64
parent3ad0ddfe880ee2edbc6cd05ce9cb8acb82b34331 (diff)
downloadbox64-3d0423acf703be7e0e7b004ee85630f6684bf72e.tar.gz
box64-3d0423acf703be7e0e7b004ee85630f6684bf72e.zip
Added preliminary unit test runner (#3045)
* Added preliminary unit test runner

* Set .text section address

* Added support for added custom memory regions

* Move json.h to include

* Display banner

* Added support for custom memory data

* Added the ability to include path in nasm

* Print env variables
Diffstat (limited to 'src/dynarec/la64')
-rw-r--r--src/dynarec/la64/dynarec_la64_00.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/dynarec/la64/dynarec_la64_00.c b/src/dynarec/la64/dynarec_la64_00.c
index e2bc02d6..eb012077 100644
--- a/src/dynarec/la64/dynarec_la64_00.c
+++ b/src/dynarec/la64/dynarec_la64_00.c
@@ -2538,15 +2538,22 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni
             break;
         case 0xF4:
             INST_NAME("HLT");
-            if (BOX64DRENV(dynarec_safeflags) > 1) {
-                READFLAGS(X_PEND);
+            if (box64_unittest_mode) { // HLT in unittest mode is an exit
+                READFLAGS(X_ALL);
+                BARRIER(BARRIER_FLOAT);
+                MOV32w(x1, 1);
+                ST_W(x1, xEmu, offsetof(x64emu_t, quit));
             } else {
-                SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state
+                if (BOX64DRENV(dynarec_safeflags) > 1) {
+                    READFLAGS(X_PEND);
+                } else {
+                    SETFLAGS(X_ALL, SF_SET_NODF, NAT_FLAGS_NOFUSION); // Hack to set flags in "don't care" state
+                }
+                GETIP(ip, x7);
+                STORE_XEMU_CALL();
+                CALL(const_native_priv, -1, 0, 0);
+                LOAD_XEMU_CALL();
             }
-            GETIP(ip, x7);
-            STORE_XEMU_CALL();
-            CALL(const_native_priv, -1, 0, 0);
-            LOAD_XEMU_CALL();
             jump_to_epilog(dyn, 0, xRIP, ninst);
             *need_epilog = 0;
             *ok = 0;