From: Matt Turner <[email protected]>

Allow direct use of the jump cache for direct and
indirect branches.

Signed-off-by: Matt Turner <[email protected]>
[rth: Drop the change to DISAS_STOP for now.
 I suspect both uses should simply use DISAS_TOO_MANY.]
Signed-off-by: Richard Henderson <[email protected]>
---
 target/loongarch/tcg/translate.c                   | 2 +-
 target/loongarch/tcg/insn_trans/trans_branch.c.inc | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/loongarch/tcg/translate.c b/target/loongarch/tcg/translate.c
index 124dce62695..b0ff1f7dff7 100644
--- a/target/loongarch/tcg/translate.c
+++ b/target/loongarch/tcg/translate.c
@@ -111,7 +111,7 @@ static void gen_goto_tb(DisasContext *ctx, unsigned 
tb_slot_idx, vaddr dest)
         tcg_gen_exit_tb(ctx->base.tb, tb_slot_idx);
     } else {
         tcg_gen_movi_tl(cpu_pc, dest);
-        tcg_gen_lookup_and_goto_ptr();
+        tcg_gen_goto_jc_tl(cpu_pc);
     }
 }
 
diff --git a/target/loongarch/tcg/insn_trans/trans_branch.c.inc 
b/target/loongarch/tcg/insn_trans/trans_branch.c.inc
index da077786585..d4318dfa437 100644
--- a/target/loongarch/tcg/insn_trans/trans_branch.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_branch.c.inc
@@ -27,7 +27,7 @@ static bool trans_jirl(DisasContext *ctx, arg_jirl *a)
     tcg_gen_mov_tl(cpu_pc, addr);
     tcg_gen_movi_tl(dest, make_address_pc(ctx, ctx->base.pc_next + 4));
     gen_set_gpr(a->rd, dest, EXT_NONE);
-    tcg_gen_lookup_and_goto_ptr();
+    tcg_gen_goto_jc_tl(cpu_pc);
     ctx->base.is_jmp = DISAS_NORETURN;
     return true;
 }
-- 
2.53.0


Reply via email to