Fix some warnings

This commit is contained in:
Megamouse 2024-07-19 22:40:19 +02:00 committed by Elad Ashkenazi
parent 7fba56f27b
commit e0fce6cc5b
4 changed files with 11 additions and 11 deletions

View file

@ -1557,7 +1557,7 @@ std::shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, bool virtual_lo
_seg.size = mem_size;
_seg.filesz = file_size;
prx->addr_to_seg_index.emplace(addr, prx->segs.size() - 1);
prx->addr_to_seg_index.emplace(addr, ::size32(prx->segs) - 1);
// Copy segment data
if (!ar) std::memcpy(ensure(prx->get_ptr<void>(addr)), prog.bin.data(), file_size);
@ -2129,7 +2129,7 @@ bool ppu_load_exec(const ppu_exec_object& elf, bool virtual_load, const std::str
// Store only LOAD segments (TODO)
_main.segs.emplace_back(_seg);
_main.addr_to_seg_index.emplace(addr, _main.segs.size() - 1);
_main.addr_to_seg_index.emplace(addr, ::size32(_main.segs) - 1);
// Copy segment data, hash it
if (!already_loaded)
@ -2825,7 +2825,7 @@ std::pair<std::shared_ptr<lv2_overlay>, CellError> ppu_load_overlay(const ppu_ex
// Store only LOAD segments (TODO)
ovlm->segs.emplace_back(_seg);
ovlm->addr_to_seg_index.emplace(addr, ovlm->segs.size() - 1);
ovlm->addr_to_seg_index.emplace(addr, ::size32(ovlm->segs) - 1);
// Copy segment data, hash it
if (!already_loaded) std::memcpy(ensure(ovlm->get_ptr<void>(addr)), prog.bin.data(), prog.bin.size());

View file

@ -4757,7 +4757,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
auto sort_breakig_reasons = [](const std::array<atomic_t<u64>, 128>& breaking_reason)
{
std::vector<std::pair<u32, u64>> map;
for (usz i = 0; i < breaking_reason.size(); i++)
for (u32 i = 0; i < static_cast<u32>(breaking_reason.size()); i++)
{
if (u64 v = breaking_reason[i])
{
@ -5199,7 +5199,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
}
else
{
std::vector<u32> to_pop;
std::vector<usz> to_pop;
usz stackframe_it = wi;
u32 stackframe_pc = SPU_LS_SIZE;
@ -5425,7 +5425,7 @@ spu_program spu_recompiler_base::analyse(const be_t<u32>* ls, u32 entry_point, s
// Clean from the back possible because it does not affect old indices
// Technically should always do a full cleanup at the moment
// TODO: Proper cleanup with keeping old indices valid
for (u32 it : to_pop)
for (usz it : to_pop)
{
if (it == reg_state_it.size() - 1)
{

View file

@ -3484,10 +3484,10 @@ public:
const auto val = m_ir->CreateLoad(get_type<u64>(), _ptr<u64>(m_thread, off));
val->setAtomic(llvm::AtomicOrdering::Acquire);
const auto shv = m_ir->CreateLShr(val, spu_channel::off_count);
return m_ir->CreateTrunc(m_ir->CreateXor(shv, u64{inv}), get_type<u32>());
return m_ir->CreateTrunc(m_ir->CreateXor(shv, inv), get_type<u32>());
}
llvm::Value* wait_rchcnt(u32 off, u64 inv = 0)
llvm::Value* wait_rchcnt(u32 off, u32 inv = 0)
{
auto wait_on_channel = [](spu_thread* _spu, spu_channel* ch, u32 is_read) -> u32
{
@ -3503,7 +3503,7 @@ public:
return ch->get_count();
};
return m_ir->CreateXor(call("wait_on_spu_channel", +wait_on_channel, m_thread, _ptr<u64>(m_thread, off), m_ir->getInt32(!inv)), m_ir->getInt32(inv));
return m_ir->CreateXor(call("wait_on_spu_channel", +wait_on_channel, m_thread, _ptr<u64>(m_thread, off), m_ir->getInt32(inv == 0u)), m_ir->getInt32(inv));
}
void RCHCNT(spu_opcode_t op) //

View file

@ -1992,8 +1992,8 @@ std::pair<ppu_thread_status, u32> lv2_obj::ppu_state(ppu_thread* ppu, bool lock_
opt_lock[1].emplace(lv2_obj::g_mutex);
}
usz pos = umax;
usz i = 0;
u32 pos = umax;
u32 i = 0;
for (auto target = +g_ppu; target; target = target->next_ppu, i++)
{