Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPU LLVM: Optimize FSM following comparison #9616

Merged
merged 1 commit into from Jan 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 17 additions & 0 deletions rpcs3/Emu/Cell/SPURecompiler.cpp
Expand Up @@ -6463,6 +6463,23 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator

void FSM(spu_opcode_t op)
{
// FSM following a comparison instruction
if (match_vr<s8[16], s16[8], s32[4], s64[2]>(op.ra, [&](auto c, auto MP)
{
using VT = typename decltype(MP)::type;

if (auto [ok, x] = match_expr(c, sext<VT>(match<bool[std::extent_v<VT>]>())); ok)
{
set_vr(op.rt, (splat_scalar(c)));
Nekotekina marked this conversation as resolved.
Show resolved Hide resolved
return true;
}

return false;
}))
{
return;
}

const auto v = extract(get_vr(op.ra), 3);
const auto m = bitcast<bool[4]>(trunc<i4>(v));
set_vr(op.rt, sext<s32[4]>(m));
Expand Down