From 0bd76018446a3e4420f9df3c1813241f1a8aef21 Mon Sep 17 00:00:00 2001 From: Merry Date: Tue, 26 Jul 2022 16:35:31 +0100 Subject: [PATCH] emit_arm64_packed: Implement PackedSubU16 --- .../backend/arm64/emit_arm64_packed.cpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/dynarmic/backend/arm64/emit_arm64_packed.cpp b/src/dynarmic/backend/arm64/emit_arm64_packed.cpp index 6582b4c7..1482fc0c 100644 --- a/src/dynarmic/backend/arm64/emit_arm64_packed.cpp +++ b/src/dynarmic/backend/arm64/emit_arm64_packed.cpp @@ -178,10 +178,23 @@ void EmitIR(oaknut::CodeGenerator& code, EmitContext& template<> void EmitIR(oaknut::CodeGenerator& code, EmitContext& ctx, IR::Inst* inst) { - (void)code; - (void)ctx; - (void)inst; - ASSERT_FALSE("Unimplemented"); + const auto ge_inst = inst->GetAssociatedPseudoOperation(IR::Opcode::GetGEFromOp); + + auto args = ctx.reg_alloc.GetArgumentInfo(inst); + auto Vresult = ctx.reg_alloc.WriteD(inst); + auto Va = ctx.reg_alloc.ReadD(args[0]); + auto Vb = ctx.reg_alloc.ReadD(args[1]); + RegAlloc::Realize(Vresult, Va, Vb); + + code.SUB(Vresult->H4(), Va->H4(), Vb->H4()); + + if (ge_inst) { + auto Vge = ctx.reg_alloc.WriteD(ge_inst); + RegAlloc::Realize(Vge); + + code.SHSUB(Vge->H4(), Va->H4(), Vb->H4()); + code.CMGE(Vge->H4(), Vge->H4(), 0); + } } template<>