mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
Merge git://github.com/hw-claudio/qemu-aarch64-queue into tcg-next
This commit is contained in:
commit
f290e4988d
3 changed files with 218 additions and 54 deletions
|
@ -358,6 +358,20 @@ static inline uintptr_t tcg_getpc_ldst(uintptr_t ra)
|
|||
not the start of the next opcode */
|
||||
return ra;
|
||||
}
|
||||
#elif defined(__aarch64__)
|
||||
# define GETRA() ((uintptr_t)__builtin_return_address(0))
|
||||
# define GETPC_LDST() tcg_getpc_ldst(GETRA())
|
||||
static inline uintptr_t tcg_getpc_ldst(uintptr_t ra)
|
||||
{
|
||||
int32_t b;
|
||||
ra += 4; /* skip one instruction */
|
||||
b = *(int32_t *)ra; /* load the branch insn */
|
||||
b = (b << 6) >> (6 - 2); /* extract the displacement */
|
||||
ra += b; /* apply the displacement */
|
||||
ra -= 4; /* return a pointer into the current opcode,
|
||||
not the start of the next opcode */
|
||||
return ra;
|
||||
}
|
||||
# else
|
||||
# error "CONFIG_QEMU_LDST_OPTIMIZATION needs GETPC_LDST() implementation!"
|
||||
# endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue