From 03e6725fcfe7abc23ab4d2e29db4fa0c334d25d2 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Mon, 9 Jul 2018 19:54:01 +0300 Subject: [PATCH] PPU LLVM: simplify VMSUMUHS --- rpcs3/Emu/Cell/PPUTranslator.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rpcs3/Emu/Cell/PPUTranslator.cpp b/rpcs3/Emu/Cell/PPUTranslator.cpp index 8f2a6d8b56..4ffb80175e 100644 --- a/rpcs3/Emu/Cell/PPUTranslator.cpp +++ b/rpcs3/Emu/Cell/PPUTranslator.cpp @@ -1114,13 +1114,13 @@ void PPUTranslator::VMSUMUHS(ppu_opcode_t op) { const auto a = get_vr(op.va); const auto b = get_vr(op.vb); - const auto c = get_vr(op.vc); - const auto ml = bitcast((a << 16 >> 16) * (b << 16 >> 16)); - const auto mh = bitcast((a >> 16) * (b >> 16)); + const auto c = get_vr(op.vc); + const auto ml = bitcast((a << 16 >> 16) * (b << 16 >> 16)); + const auto mh = bitcast((a >> 16) * (b >> 16)); const auto s = eval(ml + mh); const auto s2 = eval(s + c); - const auto x = eval((ucarry(ml, mh, s) | ucarry(s, c, s2)) >> 31); - set_vr(op.vd, eval(s2 | x)); + const auto x = eval(s < ml | s2 < s); + set_vr(op.vd, select(x, splat(-1), s2)); SetSat(IsNotZero(x.value)); }