From aa6b31f2b8b99767e1bf9495d06816da6c2007c4 Mon Sep 17 00:00:00 2001 From: Merry Date: Sun, 31 Jul 2022 09:06:33 +0100 Subject: [PATCH] emit_arm64: Handle 64-bit values in GetNZFromOp --- src/dynarmic/backend/arm64/emit_arm64.cpp | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/dynarmic/backend/arm64/emit_arm64.cpp b/src/dynarmic/backend/arm64/emit_arm64.cpp index d12e4d19..c40eca80 100644 --- a/src/dynarmic/backend/arm64/emit_arm64.cpp +++ b/src/dynarmic/backend/arm64/emit_arm64.cpp @@ -80,11 +80,27 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& c return; } - auto Wvalue = ctx.reg_alloc.ReadW(args[0]); - auto flags = ctx.reg_alloc.WriteFlags(inst); - RegAlloc::Realize(Wvalue, flags); + switch (args[0].GetType()) { + case IR::Type::U32: { + auto Wvalue = ctx.reg_alloc.ReadW(args[0]); + auto flags = ctx.reg_alloc.WriteFlags(inst); + RegAlloc::Realize(Wvalue, flags); - code.TST(*Wvalue, *Wvalue); + code.TST(*Wvalue, *Wvalue); + break; + } + case IR::Type::U64: { + auto Xvalue = ctx.reg_alloc.ReadX(args[0]); + auto flags = ctx.reg_alloc.WriteFlags(inst); + RegAlloc::Realize(Xvalue, flags); + + code.TST(*Xvalue, *Xvalue); + break; + } + default: + ASSERT_FALSE("Invalid type for GetNZFromOp"); + break; + } } template<>