From f5c383ffe691a9078d1304c9ebd8581663b016ec Mon Sep 17 00:00:00 2001 From: Sinan Karakaya Date: Wed, 6 Aug 2025 16:39:09 +0200 Subject: [PATCH] feat(jit): added support for arm translate_and_run --- core/JIT/jit.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/JIT/jit.cpp b/core/JIT/jit.cpp index 2f00162..fc3aceb 100644 --- a/core/JIT/jit.cpp +++ b/core/JIT/jit.cpp @@ -48,11 +48,19 @@ void JIT::translate_and_run(CPU& cpu) { JitFunc fn = reinterpret_cast(code); u64 result; +#if defined(__x86_64__) asm volatile("call *%1\n" "mov %%rax, %0\n" : "=r"(result) : "r"(fn) : "%rax"); +#elif defined(__aarch64__) + asm volatile("blr %1\n" + "mov %0, x0\n" + : "=r"(result) + : "r"(fn) + : "x0"); +#endif cpu.regs[0] = result; }