Skip to content

Commit 121bf93

Browse files
Wunkologibbed
authored andcommitted
[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 ```
1 parent 93b77fb commit 121bf93

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/xenia/cpu/ppc/ppc_emit_altivec.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,11 @@ int InstrEmit_vsrw128(PPCHIRBuilder& f, const InstrData& i) {
16621662
}
16631663

16641664
int InstrEmit_vsubcuw(PPCHIRBuilder& f, const InstrData& i) {
1665-
XEINSTRNOTIMPLEMENTED();
1665+
Value* underflow =
1666+
f.VectorCompareUGE(f.LoadVR(i.VX.VA), f.LoadVR(i.VX.VB), INT32_TYPE);
1667+
Value* borrow =
1668+
f.VectorShr(underflow, f.LoadConstantVec128(vec128i(31)), INT32_TYPE);
1669+
f.StoreVR(i.VX.VD, borrow);
16661670
return 1;
16671671
}
16681672

0 commit comments

Comments
 (0)