mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 08:18:54 +00:00
11cfddad05
Softmmu unaligned load/stores currently goes through through the slow path for two reasons: - to support unaligned access on host with strict alignement - to correctly handle accesses crossing pages x86 is only concerned by the second reason. Unaligned accesses are avoided by compilers, but are not uncommon. We therefore would like to see them going through the fast path, if they don't cross pages. For that we can use the fact that two adjacent TLB entries can't contain the same page. Therefore accessing the TLB entry corresponding to the first byte, but comparing its content to page address of the last byte ensures that we don't cross pages. We can do this check without adding more instructions in the TLB code (but increasing its length by one byte) by using the LEA instruction to combine the existing move with the size addition. On an x86-64 host, this gives a 3% boot time improvement for a powerpc guest and 4% for an x86-64 guest. Backports commit 8cc580f6a0d8c0e2f590c1472cf5cd8e51761760 from qemu |
||
---|---|---|
.. | ||
tcg-target.c | ||
tcg-target.h |