From f8353aa1e2754ffca406a6d68b7e6aacb8d9d86f Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Thu, 12 Sep 2024 17:54:56 +0300 Subject: [PATCH] Implement more comparison instructions. --- PowerRecomp/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/PowerRecomp/main.cpp b/PowerRecomp/main.cpp index 06b9cab..d368e1c 100644 --- a/PowerRecomp/main.cpp +++ b/PowerRecomp/main.cpp @@ -225,11 +225,26 @@ int main() case PPC_INST_CCTPM: case PPC_INST_CLRLDI: case PPC_INST_CLRLWI: + break; + case PPC_INST_CMPD: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.s64, ctx.r{}.s64, ctx.xer);", insn.operands[0], insn.operands[1], insn.operands[2]); + break; + case PPC_INST_CMPDI: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.s64, {}, ctx.xer);", insn.operands[0], insn.operands[1], int32_t(insn.operands[2])); + break; + case PPC_INST_CMPLD: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.u64, ctx.r{}.u64, ctx.xer);", insn.operands[0], insn.operands[1], insn.operands[2]); + break; + case PPC_INST_CMPLDI: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.u64, {}, ctx.xer);", insn.operands[0], insn.operands[1], insn.operands[2]); + break; + case PPC_INST_CMPLW: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.u32, ctx.r{}.u32, ctx.xer);", insn.operands[0], insn.operands[1], insn.operands[2]); break; case PPC_INST_CMPLWI: @@ -237,6 +252,7 @@ int main() break; case PPC_INST_CMPW: + std::println(f, "\tctx.cr{}.compare(ctx.r{}.s32, ctx.r{}.s32, ctx.xer);", insn.operands[0], insn.operands[1], insn.operands[2]); break; case PPC_INST_CMPWI: