PPU LLVM: simplify VMSUMUHS

This commit is contained in:
Nekotekina 2018-07-09 19:54:01 +03:00
parent d2d07abcc5
commit 03e6725fcf

View file

@ -1114,13 +1114,13 @@ void PPUTranslator::VMSUMUHS(ppu_opcode_t op)
{ {
const auto a = get_vr<u32[4]>(op.va); const auto a = get_vr<u32[4]>(op.va);
const auto b = get_vr<u32[4]>(op.vb); const auto b = get_vr<u32[4]>(op.vb);
const auto c = get_vr<s32[4]>(op.vc); const auto c = get_vr<u32[4]>(op.vc);
const auto ml = bitcast<s32[4]>((a << 16 >> 16) * (b << 16 >> 16)); const auto ml = bitcast<u32[4]>((a << 16 >> 16) * (b << 16 >> 16));
const auto mh = bitcast<s32[4]>((a >> 16) * (b >> 16)); const auto mh = bitcast<u32[4]>((a >> 16) * (b >> 16));
const auto s = eval(ml + mh); const auto s = eval(ml + mh);
const auto s2 = eval(s + c); const auto s2 = eval(s + c);
const auto x = eval((ucarry(ml, mh, s) | ucarry(s, c, s2)) >> 31); const auto x = eval(s < ml | s2 < s);
set_vr(op.vd, eval(s2 | x)); set_vr(op.vd, select(x, splat<u32[4]>(-1), s2));
SetSat(IsNotZero(x.value)); SetSat(IsNotZero(x.value));
} }