mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
LLVM: Use small code model
Global variables modified: __mptr: pointer to memory base addr __cptr: pointer to function map addr Use 32 bit pointers in function map
This commit is contained in:
parent
c100328a6f
commit
44bee7d0ba
4 changed files with 14 additions and 13 deletions
|
@ -57,14 +57,14 @@ cfg::map_entry<ppu_decoder_type> g_cfg_ppu_decoder(cfg::root.core, "PPU Decoder"
|
|||
const ppu_decoder<ppu_interpreter_precise> s_ppu_interpreter_precise;
|
||||
const ppu_decoder<ppu_interpreter_fast> s_ppu_interpreter_fast;
|
||||
|
||||
const auto s_ppu_compiled = static_cast<ppu_function_t*>(memory_helper::reserve_memory(0x200000000));
|
||||
const auto s_ppu_compiled = static_cast<u32*>(memory_helper::reserve_memory(0x100000000));
|
||||
|
||||
extern void ppu_register_function_at(u32 addr, ppu_function_t ptr)
|
||||
{
|
||||
if (g_cfg_ppu_decoder.get() == ppu_decoder_type::llvm)
|
||||
{
|
||||
memory_helper::commit_page_memory(s_ppu_compiled + addr / 4, sizeof(ppu_function_t));
|
||||
s_ppu_compiled[addr / 4] = ptr;
|
||||
memory_helper::commit_page_memory(s_ppu_compiled + addr / 4, sizeof(s_ppu_compiled[0]));
|
||||
s_ppu_compiled[addr / 4] = (u32)(std::uintptr_t)ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -134,7 +134,7 @@ void PPUThread::cpu_task_main()
|
|||
{
|
||||
if (g_cfg_ppu_decoder.get() == ppu_decoder_type::llvm)
|
||||
{
|
||||
return s_ppu_compiled[pc / 4](*this);
|
||||
return reinterpret_cast<ppu_function_t>((std::uintptr_t)s_ppu_compiled[pc / 4])(*this);
|
||||
}
|
||||
|
||||
g_tls_log_prefix = []
|
||||
|
@ -451,15 +451,14 @@ extern void ppu_initialize(const std::string& name, const std::vector<ppu_functi
|
|||
|
||||
std::unordered_map<std::string, std::uintptr_t> link_table
|
||||
{
|
||||
{ "__memory", (u64)vm::g_base_addr },
|
||||
{ "__memptr", (u64)&vm::g_base_addr },
|
||||
{ "__mptr", (u64)&vm::g_base_addr },
|
||||
{ "__cptr", (u64)&s_ppu_compiled },
|
||||
{ "__trap", (u64)&ppu_trap },
|
||||
{ "__end", (u64)&ppu_unreachable },
|
||||
{ "__trace", (u64)&ppu_trace },
|
||||
{ "__hlecall", (u64)&ppu_execute_function },
|
||||
{ "__syscall", (u64)&ppu_execute_syscall },
|
||||
{ "__get_tbl", (u64)&get_timebased_time },
|
||||
{ "__call", (u64)s_ppu_compiled },
|
||||
{ "__lwarx", (u64)&ppu_lwarx },
|
||||
{ "__ldarx", (u64)&ppu_ldarx },
|
||||
{ "__stwcx", (u64)&ppu_stwcx },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue