mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
tcg-i386: Use new return-argument ld/st helpers
Discontinue the jump-around-jump-to-jump scheme, trading it for a single immediate move instruction. The two extra jumps always consume 7 bytes, whereas the immediate move is either 5 or 7 bytes depending on where the code_gen_buffer gets located. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
aac1fb0576
commit
401c227b0a
2 changed files with 49 additions and 67 deletions
|
@ -326,18 +326,9 @@ extern uintptr_t tci_tb_ptr;
|
|||
(6) jump to corresponding code of the next of fast path
|
||||
*/
|
||||
# if defined(__i386__) || defined(__x86_64__)
|
||||
/* To avoid broken disassembling, long jmp is used for embedding fast path pc,
|
||||
so that the destination is the next code of fast path, though this jmp is
|
||||
never executed.
|
||||
|
||||
call MMU helper
|
||||
jmp POST_PROC (2byte) <- GETRA()
|
||||
jmp NEXT_CODE (5byte)
|
||||
POST_PROCESS ... <- GETRA() + 7
|
||||
*/
|
||||
# define GETRA() ((uintptr_t)__builtin_return_address(0))
|
||||
# define GETPC_LDST() ((uintptr_t)(GETRA() + 7 + \
|
||||
*(int32_t *)((void *)GETRA() + 3) - 1))
|
||||
/* The return address argument for ldst is passed directly. */
|
||||
# define GETPC_LDST() (abort(), 0)
|
||||
# elif defined (_ARCH_PPC) && !defined (_ARCH_PPC64)
|
||||
# define GETRA() ((uintptr_t)__builtin_return_address(0))
|
||||
# define GETPC_LDST() ((uintptr_t) ((*(int32_t *)(GETRA() - 4)) - 1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue