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<>