From 7791d3d8548c6e5885990e3e66438f3cb5272c13 Mon Sep 17 00:00:00 2001 From: Liam Date: Tue, 15 Nov 2022 20:59:23 -0500 Subject: [PATCH] Fix GetCFlag --- src/dynarmic/backend/arm64/emit_arm64_a64.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/dynarmic/backend/arm64/emit_arm64_a64.cpp b/src/dynarmic/backend/arm64/emit_arm64_a64.cpp index 17bc8cc9..469fc5ea 100644 --- a/src/dynarmic/backend/arm64/emit_arm64_a64.cpp +++ b/src/dynarmic/backend/arm64/emit_arm64_a64.cpp @@ -142,10 +142,10 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { - auto Wresult = ctx.reg_alloc.WriteW(inst); - RegAlloc::Realize(Wresult); - code.LDR(Wresult, Xstate, offsetof(A64JitState, cpsr_nzcv)); - code.UBFX(Wresult, Wresult, nzcv_c_flag_shift, 1); + auto Wflag = ctx.reg_alloc.WriteW(inst); + RegAlloc::Realize(Wflag); + code.LDR(Wflag, Xstate, offsetof(A64JitState, cpsr_nzcv)); + code.AND(Wflag, Wflag, 1 << nzcv_c_flag_shift); } template<>