diff --git a/rpcs3/Emu/Cell/PPUAnalyser.cpp b/rpcs3/Emu/Cell/PPUAnalyser.cpp index 7d890e09d4..ad5894ea7b 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.cpp +++ b/rpcs3/Emu/Cell/PPUAnalyser.cpp @@ -1888,7 +1888,7 @@ bool ppu_module::analyse(u32 lib_toc, u32 entry, const u32 sec_end, const std::b } } else if (u32 target0 = (test_op.aa ? 0 : target) + (type0 == ppu_itype::B ? +test_op.bt24 : +test_op.bt14); - (type0 == ppu_itype::B || ppu_itype::BC) && target0 < segs[0].addr || target0 >= segs[0].addr + segs[0].size) + (type0 == ppu_itype::B || type0 == ppu_itype::BC) && target0 < segs[0].addr || target0 >= segs[0].addr + segs[0].size) { // Sanity check is_good = false; diff --git a/rpcs3/Emu/Cell/PPUAnalyser.h b/rpcs3/Emu/Cell/PPUAnalyser.h index ccbd743f92..0f2e94cd86 100644 --- a/rpcs3/Emu/Cell/PPUAnalyser.h +++ b/rpcs3/Emu/Cell/PPUAnalyser.h @@ -265,7 +265,7 @@ struct ppu_itype static constexpr struct branch_tag{} branch{}; // Branch Instructions static constexpr struct trap_tag{} trap{}; // Branch Instructions - enum type + enum class type { UNK = 0, @@ -788,6 +788,8 @@ struct ppu_itype TWI, // trap_tag last }; + using enum type; + // Enable address-of operator for ppu_decoder<> friend constexpr type operator &(type value) { diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 5f726cfc89..1254c39000 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -4721,7 +4721,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size) const auto addr = ensure(reinterpret_cast(jit->get(name))); jit_mod.funcs.emplace_back(addr); - if (func.size == 4 & !BLR_func && *info.get_ptr(func.addr) == ppu_instructions::BLR()) + if (func.size == 4 && !BLR_func && *info.get_ptr(func.addr) == ppu_instructions::BLR()) { BLR_func = addr; } @@ -4745,7 +4745,7 @@ bool ppu_initialize(const ppu_module& info, bool check_only, u64 file_size) const u64 addr = reinterpret_cast(ensure(jit_mod.funcs[index++])); - if (func.size == 4 & !BLR_func && *info.get_ptr(func.addr) == ppu_instructions::BLR()) + if (func.size == 4 && !BLR_func && *info.get_ptr(func.addr) == ppu_instructions::BLR()) { BLR_func = reinterpret_cast(addr); } diff --git a/rpcs3/Emu/Cell/SPUAnalyser.h b/rpcs3/Emu/Cell/SPUAnalyser.h index 1d33fc7156..faa85a5a41 100644 --- a/rpcs3/Emu/Cell/SPUAnalyser.h +++ b/rpcs3/Emu/Cell/SPUAnalyser.h @@ -16,7 +16,7 @@ struct spu_itype static constexpr struct xfloat_tag{} xfloat{}; // Instructions producing xfloat values static constexpr struct zregmod_tag{} zregmod{}; // Instructions not modifying any GPR - enum type : unsigned char + enum class type : unsigned char { UNK = 0, @@ -236,6 +236,8 @@ struct spu_itype CLGTI, // compare_tag last }; + using enum type; + // Enable address-of operator for spu_decoder<> friend constexpr type operator &(type value) { diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index b8d811d4e1..4e2c90a637 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -6455,7 +6455,7 @@ public: { if (last_itype != itype) { - ifuncs[itype] = f; + ifuncs[static_cast(itype)] = f; } f->setCallingConv(CallingConv::GHC); @@ -12023,7 +12023,7 @@ struct spu_fast : public spu_recompiler_base raw += 4; // call spu_* (specially built interpreter function) - const s64 rel = spu_runtime::g_interpreter_table[type] - reinterpret_cast(raw) - 5; + const s64 rel = spu_runtime::g_interpreter_table[static_cast(type)] - reinterpret_cast(raw) - 5; *raw++ = 0xe8; std::memcpy(raw, &rel, 4); raw += 4;