From 0617e9e14b2066dca610f4a75857f8da1eabc74f Mon Sep 17 00:00:00 2001 From: Malcolm Jestadt Date: Sun, 5 Dec 2021 17:23:05 -0500 Subject: [PATCH] SPU LLVM: Fix vgf2p8affineqb usage - Reverse the order of the bytes in the selection masks. Previously it was assumed that byte 0 would determine the output of bit 0, but byte 7 determines the output of bit 0. --- rpcs3/Emu/Cell/SPURecompiler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index eaf7f7e055..d71299bff8 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -7660,7 +7660,7 @@ public: return; } - const auto m = gf2p8affineqb(c, build(0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20), 0x7f); + const auto m = gf2p8affineqb(c, build(0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40), 0x7f); const auto mm = select(noncast(m) >= 0, splat(0), m); const auto ab = vperm2b256to128(as, bs, c); set_vr(op.rt4, select(noncast(c) >= 0, ab, mm)); @@ -7722,7 +7722,7 @@ public: return; } - const auto m = gf2p8affineqb(c, build(0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20), 0x7f); + const auto m = gf2p8affineqb(c, build(0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40), 0x7f); const auto mm = select(noncast(m) >= 0, splat(0), m); const auto cr = eval(~c); const auto ab = vperm2b256to128(b, a, cr);