about summary refs log tree commit diff stats
path: root/src/dynarec/arm64
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/arm64
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/arm64')
-rw-r--r--src/dynarec/arm64/dynarec_arm64_00.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_00.c b/src/dynarec/arm64/dynarec_arm64_00.c
index 737b52d2..bcf25b21 100644
--- a/src/dynarec/arm64/dynarec_arm64_00.c
+++ b/src/dynarec/arm64/dynarec_arm64_00.c
@@ -3766,15 +3766,22 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin
 
         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);
+                STRw_U12(x1, xEmu, offsetof(x64emu_t, quit));
             } else {
-                SETFLAGS(X_ALL, SF_SET_NODF);    // Hack to set flags in "don't care" state
+                if (BOX64DRENV(dynarec_safeflags) > 1) {
+                    READFLAGS(X_PEND);
+                } else {
+                    SETFLAGS(X_ALL, SF_SET_NODF); // Hack to set flags in "don't care" state
+                }
+                GETIP(ip);
+                STORE_XEMU_CALL(xRIP);
+                CALL_S(const_native_priv, -1);
+                LOAD_XEMU_CALL(xRIP);
             }
-            GETIP(ip);
-            STORE_XEMU_CALL(xRIP);
-            CALL_S(const_native_priv, -1);
-            LOAD_XEMU_CALL(xRIP);
             jump_to_epilog(dyn, 0, xRIP, ninst);
             *need_epilog = 0;
             *ok = 0;