Fix Clang build and other small fixes (#17736)

1. I fixed the Clang build.
1. I removed what I think is an unnecessary `ptrtoint` in
`rpcs3/Emu/Cell/PPUTranslator.cpp`. I am not 100% sure that it's
correct, but I tested a small LLVM IR snippet and it didn't make a
difference. The ASM code was the same.
1. I also changed the definition of `prefetch_write` from `return
__builtin_prefetch(ptr, 1, 0);` to `return __builtin_prefetch(ptr, 1,
3);` because that's how `_m_prefetchw` is defined in GCC.
This commit is contained in:
oltolm 2025-11-23 06:11:36 +01:00 committed by GitHub
parent a3f7c0d67f
commit fcff16b6f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 4 additions and 6 deletions

View File

@ -394,7 +394,7 @@ namespace fmt
}
#if !defined(_MSC_VER) || defined(__clang__)
[[noreturn]] ~throw_exception();
[[noreturn]] ~throw_exception() = default;
#endif
};

View File

@ -157,7 +157,7 @@ std::array<u8, PASSPHRASE_KEY_LEN> sc_combine_laid_paid(s64 laid, s64 paid)
{
const std::string paid_laid = fmt::format("%016llx%016llx", laid, paid);
std::array<u8, PASSPHRASE_KEY_LEN> out{};
hex_to_bytes(out.data(), paid_laid.c_str(), PASSPHRASE_KEY_LEN * 2);
hex_to_bytes(out.data(), paid_laid, PASSPHRASE_KEY_LEN * 2);
return out;
}

View File

@ -3,7 +3,6 @@
#include "util/types.hpp"
#include "Emu/Memory/vm_ptr.h"
#include "Emu/Cell/ErrorCodes.h"
#include <mutex>
#include <vector>
#include <mutex>

View File

@ -416,7 +416,6 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
assert(ptr_inst->getResultElementType() == m_ir->getPtrTy());
const auto faddr = m_ir->CreateLoad(ptr_inst->getResultElementType(), ptr_inst);
const auto faddr_int = m_ir->CreatePtrToInt(faddr, get_type<uptr>());
const auto pos_32 = m_reloc ? m_ir->CreateAdd(func_pc, m_seg0) : func_pc;
const auto pos = m_ir->CreateShl(pos_32, 1);
const auto ptr = m_ir->CreatePtrAdd(m_exec, pos);
@ -427,7 +426,7 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
const auto seg_val = m_ir->CreateTrunc(m_ir->CreateLShr(m_seg0, 13), get_type<u16>());
// Store to jumptable
m_ir->CreateStore(faddr_int, ptr);
m_ir->CreateStore(faddr, ptr);
m_ir->CreateStore(seg_val, seg_ptr);
// Increment index and branch back to loop

View File

@ -60,7 +60,7 @@ namespace utils
#if defined(ARCH_X64)
return _m_prefetchw(const_cast<void*>(ptr));
#else
return __builtin_prefetch(ptr, 1, 0);
return __builtin_prefetch(ptr, 1, 3);
#endif
}