Skip to content

Commit fcff16b

Browse files
authored
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.
1 parent a3f7c0d commit fcff16b

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

Utilities/StrFmt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ namespace fmt
394394
}
395395

396396
#if !defined(_MSC_VER) || defined(__clang__)
397-
[[noreturn]] ~throw_exception();
397+
[[noreturn]] ~throw_exception() = default;
398398
#endif
399399
};
400400

rpcs3/Crypto/utils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ std::array<u8, PASSPHRASE_KEY_LEN> sc_combine_laid_paid(s64 laid, s64 paid)
157157
{
158158
const std::string paid_laid = fmt::format("%016llx%016llx", laid, paid);
159159
std::array<u8, PASSPHRASE_KEY_LEN> out{};
160-
hex_to_bytes(out.data(), paid_laid.c_str(), PASSPHRASE_KEY_LEN * 2);
160+
hex_to_bytes(out.data(), paid_laid, PASSPHRASE_KEY_LEN * 2);
161161
return out;
162162
}
163163

rpcs3/Emu/Cell/Modules/sceNpTrophy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "util/types.hpp"
44
#include "Emu/Memory/vm_ptr.h"
55
#include "Emu/Cell/ErrorCodes.h"
6-
#include <mutex>
76
#include <vector>
87
#include <mutex>
98

rpcs3/Emu/Cell/PPUTranslator.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
416416
assert(ptr_inst->getResultElementType() == m_ir->getPtrTy());
417417

418418
const auto faddr = m_ir->CreateLoad(ptr_inst->getResultElementType(), ptr_inst);
419-
const auto faddr_int = m_ir->CreatePtrToInt(faddr, get_type<uptr>());
420419
const auto pos_32 = m_reloc ? m_ir->CreateAdd(func_pc, m_seg0) : func_pc;
421420
const auto pos = m_ir->CreateShl(pos_32, 1);
422421
const auto ptr = m_ir->CreatePtrAdd(m_exec, pos);
@@ -427,7 +426,7 @@ Function* PPUTranslator::GetSymbolResolver(const ppu_module<lv2_obj>& info)
427426
const auto seg_val = m_ir->CreateTrunc(m_ir->CreateLShr(m_seg0, 13), get_type<u16>());
428427

429428
// Store to jumptable
430-
m_ir->CreateStore(faddr_int, ptr);
429+
m_ir->CreateStore(faddr, ptr);
431430
m_ir->CreateStore(seg_val, seg_ptr);
432431

433432
// Increment index and branch back to loop

rpcs3/util/asm.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ namespace utils
6060
#if defined(ARCH_X64)
6161
return _m_prefetchw(const_cast<void*>(ptr));
6262
#else
63-
return __builtin_prefetch(ptr, 1, 0);
63+
return __builtin_prefetch(ptr, 1, 3);
6464
#endif
6565
}
6666

0 commit comments

Comments
 (0)