mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2026-02-19 14:52:57 +00:00
A64/x64: Create a global_offset optimization for the page table.
Instead of looking up the page table like: table[addr >> 12][addr & 0xFFF] We can use a global offset on the table to query the memory like: table[addr >> 12][addr] This saves two instructions on *every* memory access within the recompiler. Thanks at skmp for the idea.
This commit is contained in:
@@ -737,6 +737,9 @@ static Xbyak::RegExp EmitVAddrLookup(BlockOfCode& code, A64EmitContext& ctx, Xby
|
||||
code.mov(page_table, qword[page_table + tmp * sizeof(void*)]);
|
||||
code.test(page_table, page_table);
|
||||
code.jz(abort, code.T_NEAR);
|
||||
if (ctx.conf.absolute_offset_page_table) {
|
||||
return page_table + vaddr;
|
||||
}
|
||||
code.mov(tmp, vaddr);
|
||||
code.and_(tmp, static_cast<u32>(page_size - 1));
|
||||
return page_table + tmp;
|
||||
|
||||
Reference in New Issue
Block a user