Skip to content

Commit 52495c1

Browse files
authored
PPU Analyzer: Fixup
1 parent 93ac75c commit 52495c1

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

rpcs3/Emu/Cell/PPUAnalyser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,7 +1888,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b
18881888
}
18891889
}
18901890
else if (u32 target0 = (test_op.aa ? 0 : target) + (type0 == ppu_itype::B ? +test_op.bt24 : +test_op.bt14);
1891-
(type0 == ppu_itype::B || ppu_itype::BC) && target0 < segs[0].addr || target0 >= segs[0].addr + segs[0].size)
1891+
(type0 == ppu_itype::B || type0 == ppu_itype::BC) && target0 < segs[0].addr || target0 >= segs[0].addr + segs[0].size)
18921892
{
18931893
// Sanity check
18941894
is_good = false;

rpcs3/Emu/Cell/PPUAnalyser.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ struct ppu_itype
265265
static constexpr struct branch_tag{} branch{}; // Branch Instructions
266266
static constexpr struct trap_tag{} trap{}; // Branch Instructions
267267

268-
enum type
268+
enum class type
269269
{
270270
UNK = 0,
271271

@@ -788,6 +788,8 @@ struct ppu_itype
788788
TWI, // trap_tag last
789789
};
790790

791+
using enum type;
792+
791793
// Enable address-of operator for ppu_decoder<>
792794
friend constexpr type operator &(type value)
793795
{

rpcs3/Emu/Cell/PPUThread.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4721,7 +4721,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size)
47214721
const auto addr = ensure(reinterpret_cast<ppu_intrp_func_t>(jit->get(name)));
47224722
jit_mod.funcs.emplace_back(addr);
47234723

4724-
if (func.size == 4 & !BLR_func && *info.get_ptr<u32>(func.addr) == ppu_instructions::BLR())
4724+
if (func.size == 4 && !BLR_func && *info.get_ptr<u32>(func.addr) == ppu_instructions::BLR())
47254725
{
47264726
BLR_func = addr;
47274727
}
@@ -4745,7 +4745,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size)
47454745

47464746
const u64 addr = reinterpret_cast<uptr>(ensure(jit_mod.funcs[index++]));
47474747

4748-
if (func.size == 4 & !BLR_func && *info.get_ptr<u32>(func.addr) == ppu_instructions::BLR())
4748+
if (func.size == 4 && !BLR_func && *info.get_ptr<u32>(func.addr) == ppu_instructions::BLR())
47494749
{
47504750
BLR_func = reinterpret_cast<ppu_intrp_func_t>(addr);
47514751
}

rpcs3/Emu/Cell/SPUAnalyser.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct spu_itype
1616
static constexpr struct xfloat_tag{} xfloat{}; // Instructions producing xfloat values
1717
static constexpr struct zregmod_tag{} zregmod{}; // Instructions not modifying any GPR
1818

19-
enum type : unsigned char
19+
enum class type : unsigned char
2020
{
2121
UNK = 0,
2222

@@ -236,6 +236,8 @@ struct spu_itype
236236
CLGTI, // compare_tag last
237237
};
238238

239+
using enum type;
240+
239241
// Enable address-of operator for spu_decoder<>
240242
friend constexpr type operator &(type value)
241243
{

rpcs3/Emu/Cell/SPURecompiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6455,7 +6455,7 @@ class spu_llvm_recompiler : public spu_recompiler_base, public cpu_translator
64556455
{
64566456
if (last_itype != itype)
64576457
{
6458-
ifuncs[itype] = f;
6458+
ifuncs[static_cast<usz>(itype)] = f;
64596459
}
64606460

64616461
f->setCallingConv(CallingConv::GHC);
@@ -12023,7 +12023,7 @@ struct spu_fast : public spu_recompiler_base
1202312023
raw += 4;
1202412024

1202512025
// call spu_* (specially built interpreter function)
12026-
const s64 rel = spu_runtime::g_interpreter_table[type] - reinterpret_cast<u64>(raw) - 5;
12026+
const s64 rel = spu_runtime::g_interpreter_table[static_cast<usz>(type)] - reinterpret_cast<u64>(raw) - 5;
1202712027
*raw++ = 0xe8;
1202812028
std::memcpy(raw, &rel, 4);
1202912029
raw += 4;

0 commit comments

Comments
 (0)