diff options
author | Richard Henderson <rth@twiddle.net> | 2013-07-15 13:21:10 -0700 |
---|---|---|
committer | Richard Henderson <rth@twiddle.net> | 2013-07-15 13:21:10 -0700 |
commit | f290e4988dd8eb012de0517a1ff93df130e87da1 (patch) | |
tree | 0c3a2a6ec091dd6f0898708790460c501541b554 /include/exec/exec-all.h | |
parent | a28177820a868eafda8fab007561cc19f41941f4 (diff) | |
parent | c6d8ed24b446b1f1e07af87cde54317f54a1d42e (diff) | |
download | hqemu-f290e4988dd8eb012de0517a1ff93df130e87da1.zip hqemu-f290e4988dd8eb012de0517a1ff93df130e87da1.tar.gz |
Merge git://github.com/hw-claudio/qemu-aarch64-queue into tcg-next
Diffstat (limited to 'include/exec/exec-all.h')
-rw-r--r-- | include/exec/exec-all.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index b2162a4..5920f73 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -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 |