From 53f13a9721cbf13c4886ef09c46c302c8ffb9b66 Mon Sep 17 00:00:00 2001 From: Malcolm Jestadt Date: Tue, 20 Apr 2021 01:32:16 -0400 Subject: [PATCH] SPU LLVM: Final fixup for icelake shufb paths - The cause of the problems was due to the constant mask for gf2p9affineqb being used as the first argument, instead of the second argument. --- rpcs3/Emu/Cell/SPURecompiler.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index d4f1620ee9..44630fb5c1 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -7424,6 +7424,15 @@ public: const auto as = byteswap(a); const auto bs = byteswap(b); + if (m_use_avx512_icl && (op.ra != op.rb)) + { + const auto m = gf2p8affineqb(c, build(0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04), 0x7f); + const auto mm = select(noncast(m) >= 0, splat(0), m); + const auto ab = vperm2b(as, bs, c); + set_vr(op.rt4, select(noncast(c) >= 0, ab, mm)); + return; + } + const auto x = avg(noncast(sext((c & 0xc0) == 0xc0)), noncast(sext((c & 0xe0) == 0xc0))); const auto ax = pshufb(as, c); const auto bx = pshufb(bs, c); @@ -7465,8 +7474,8 @@ public: if (m_use_avx512_icl && (op.ra != op.rb || m_interp_magn)) { - const auto m = gf2p8affineqb(build(0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04), c, 0x7f); - const auto mm = select(noncast(c << 1) >= 0, splat(0), m); + const auto m = gf2p8affineqb(c, build(0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04), 0x7f); + const auto mm = select(noncast(m) >= 0, splat(0), m); const auto cr = eval(~c); const auto ab = vperm2b(b, a, cr); set_vr(op.rt4, select(noncast(cr) >= 0, mm, ab));