From 80c89401b91f4432ea3a6c6e800cce2ce177ae83 Mon Sep 17 00:00:00 2001 From: Merry Date: Fri, 22 Jul 2022 14:53:49 +0100 Subject: [PATCH] a32_address_space: Add StackLayout to stack --- src/dynarmic/backend/arm64/a32_address_space.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dynarmic/backend/arm64/a32_address_space.cpp b/src/dynarmic/backend/arm64/a32_address_space.cpp index afaf25b8..75a9bfb3 100644 --- a/src/dynarmic/backend/arm64/a32_address_space.cpp +++ b/src/dynarmic/backend/arm64/a32_address_space.cpp @@ -7,6 +7,7 @@ #include "dynarmic/backend/arm64/abi.h" #include "dynarmic/backend/arm64/emit_arm64.h" +#include "dynarmic/backend/arm64/stack_layout.h" #include "dynarmic/frontend/A32/a32_location_descriptor.h" #include "dynarmic/frontend/A32/translate/a32_translate.h" #include "dynarmic/ir/opt/passes.h" @@ -79,11 +80,13 @@ void A32AddressSpace::EmitPrelude() { for (int i = 0; i < 32; i += 2) { code.STP(QReg{i}, QReg{i + 1}, SP, PRE_INDEXED, -32); } + code.SUB(SP, SP, sizeof(StackLayout)); code.MOV(Xstate, X1); code.MOV(Xhalt, X2); code.BR(X0); prelude_info.return_from_run_code = code.ptr(); + code.ADD(SP, SP, sizeof(StackLayout)); for (int i = 30; i >= 0; i -= 2) { code.LDP(QReg{i}, QReg{i + 1}, SP, POST_INDEXED, 32); }