mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
tcg-arm: Rearrange slow-path qemu_ld/st
Use the new helper_ret_*_mmu routines. Use a conditional call to arrange for a tail-call from the store path, and to load the return address for the helper for the load path. Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
23bbc25085
commit
d9f4dde4a6
2 changed files with 87 additions and 104 deletions
|
@ -324,21 +324,7 @@ extern uintptr_t tci_tb_ptr;
|
|||
In some implementations, we pass the "logical" return address manually;
|
||||
in others, we must infer the logical return from the true return. */
|
||||
#if defined(CONFIG_QEMU_LDST_OPTIMIZATION) && defined(CONFIG_SOFTMMU)
|
||||
# if defined(__arm__)
|
||||
/* We define two insns between the return address and the branch back to
|
||||
straight-line. Find and decode that branch insn. */
|
||||
# define GETRA_LDST(RA) tcg_getra_ldst(RA)
|
||||
static inline uintptr_t tcg_getra_ldst(uintptr_t ra)
|
||||
{
|
||||
int32_t b;
|
||||
ra += 8; /* skip the two insns */
|
||||
b = *(int32_t *)ra; /* load the branch insn */
|
||||
b = (b << 8) >> (8 - 2); /* extract the displacement */
|
||||
ra += 8; /* branches are relative to pc+8 */
|
||||
ra += b; /* apply the displacement */
|
||||
return ra;
|
||||
}
|
||||
# elif defined(__aarch64__)
|
||||
# if defined(__aarch64__)
|
||||
# define GETRA_LDST(RA) tcg_getra_ldst(RA)
|
||||
static inline uintptr_t tcg_getra_ldst(uintptr_t ra)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue