diff options
author | Jani Kokkonen <Jani.Kokkonen@huawei.com> | 2013-07-10 17:02:00 +0200 |
---|---|---|
committer | Claudio Fontana <claudio.fontana@huawei.com> | 2013-07-15 13:13:46 +0200 |
commit | c6d8ed24b446b1f1e07af87cde54317f54a1d42e (patch) | |
tree | 7d7d63b884a996bbac6dc76992345b827a781554 /include/exec | |
parent | b1f6dc0d2a03f0e114cc5ff08b0a133e24fd55ad (diff) |
tcg/aarch64: Implement tlb lookup fast path
Supports CONFIG_QEMU_LDST_OPTIMIZATION
Signed-off-by: Jani Kokkonen <jani.kokkonen@huawei.com>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
Diffstat (limited to 'include/exec')
-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 b2162a4ec4..5920f73c90 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 |