Similar to the ARM64, LoongArch has PC-relative instructions such as
PCADDU18I. These instructions can be used to support direct jump for
LoongArch. Additionally, if instruction "B offset" can cover the target
address(target is within ±128MB range), a single "B offset" plus a nop
will be used by "tb_target_set_jump_target".
Cc: Richard Henderson<richard.henderson@linaro.org>
Signed-off-by: Qi Hu<huqi@loongson.cn>
---
Changes since v3:
- Fix the offset check error which is pointed by WANG Xuerui.
- Use TMP0 instead of T0.
- Remove useless block due to direct jump support.
- Add some assertions.
---
tcg/loongarch64/tcg-target.c.inc | 48 +++++++++++++++++++++++++++++---
tcg/loongarch64/tcg-target.h | 9 ++++--
2 files changed, 50 insertions(+), 7 deletions(-)