From 121bf93cbe2c23fe0a47f1f43e3f050df46e976d Mon Sep 17 00:00:00 2001 From: Wunkolo Date: Mon, 17 Apr 2023 10:33:37 -0700 Subject: [PATCH] [PPC] Implement `vsubcuw` Other half of #2125. I don't know of any title that utilizes this instruction, but I went ahead and implemented it for completeness. Verified the implementation with `instr__gen_vsubcuw` from #1348. Can be grabbed with: ``` git checkout origin/gen_tests -- src\xenia\cpu\ppc\testing\*vsubcuw.s ``` --- src/xenia/cpu/ppc/ppc_emit_altivec.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/ppc/ppc_emit_altivec.cc b/src/xenia/cpu/ppc/ppc_emit_altivec.cc index b8257c1bc..437b3f09b 100644 --- a/src/xenia/cpu/ppc/ppc_emit_altivec.cc +++ b/src/xenia/cpu/ppc/ppc_emit_altivec.cc @@ -1662,7 +1662,11 @@ int InstrEmit_vsrw128(PPCHIRBuilder& f, const InstrData& i) { } int InstrEmit_vsubcuw(PPCHIRBuilder& f, const InstrData& i) { - XEINSTRNOTIMPLEMENTED(); + Value* underflow = + f.VectorCompareUGE(f.LoadVR(i.VX.VA), f.LoadVR(i.VX.VB), INT32_TYPE); + Value* borrow = + f.VectorShr(underflow, f.LoadConstantVec128(vec128i(31)), INT32_TYPE); + f.StoreVR(i.VX.VD, borrow); return 1; }