SPU Analyzer: Fix jumptable append
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux-aarch64.sh, gcc, rpcs3/rpcs3-ci-jammy-aarch64:1.7, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (/rpcs3/.ci/build-linux.sh, gcc, rpcs3/rpcs3-ci-jammy:1.7, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (a1d35836e8d45bfc6f63c26f0a3e5d46ef622fe1, rpcs3/rpcs3-binaries-linux-arm64, /rpcs3/.ci/build-linux-aarch64.sh, clang, rpcs3/rpcs3-ci-jammy-aarch64:1.7, ubuntu-24.04-arm) (push) Waiting to run
Build RPCS3 / RPCS3 Linux ${{ matrix.os }} ${{ matrix.compiler }} (d812f1254a1157c80fd402f94446310560f54e5f, rpcs3/rpcs3-binaries-linux, /rpcs3/.ci/build-linux.sh, clang, rpcs3/rpcs3-ci-jammy:1.7, ubuntu-24.04) (push) Waiting to run
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (51ae32f468089a8169aaf1567de355ff4a3e0842, rpcs3/rpcs3-binaries-mac, .ci/build-mac.sh, Intel) (push) Waiting to run
Build RPCS3 / RPCS3 Mac ${{ matrix.name }} (8e21bdbc40711a3fccd18fbf17b742348b0f4281, rpcs3/rpcs3-binaries-mac-arm64, .ci/build-mac-arm64.sh, Apple Silicon) (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Build RPCS3 / RPCS3 Windows Clang (win64, clang, clang64) (push) Waiting to run
Build RPCS3 / RPCS3 FreeBSD (push) Waiting to run

This commit is contained in:
Elad 2025-11-23 18:14:39 +02:00
parent 7472d95b0c
commit 89a13b75f7

View file

@ -3122,7 +3122,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
u64 dabs = 0; u64 dabs = 0;
u64 drel = 0; u64 drel = 0;
for (u32 i = start; i < limit; i += 4) for (u32 i = start, abs_fail = 0, rel_fail = 0; i < limit; i += 4)
{ {
const u32 target = ls[i / 4]; const u32 target = ls[i / 4];
@ -3135,13 +3135,27 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
if (target >= lsa && target < SPU_LS_SIZE) if (target >= lsa && target < SPU_LS_SIZE)
{ {
// Possible jump table entry (absolute) // Possible jump table entry (absolute)
jt_abs.push_back(target); if (!abs_fail)
{
jt_abs.push_back(target);
}
}
else
{
abs_fail++;
} }
if (target + start >= lsa && target + start < SPU_LS_SIZE) if (target + start >= lsa && target + start < SPU_LS_SIZE)
{ {
// Possible jump table entry (relative) // Possible jump table entry (relative)
jt_rel.push_back(target + start); if (!rel_fail)
{
jt_rel.push_back(target + start);
}
}
else
{
rel_fail++;
} }
if (std::max(jt_abs.size(), jt_rel.size()) * 4 + start <= i) if (std::max(jt_abs.size(), jt_rel.size()) * 4 + start <= i)