Assuming FEAT_BTI hasn't needed a page-table lookup to
determine the BTYPE for the destination, we can compute
the tbflags for the target.  Pass all that to goto_jc3.

Signed-off-by: Richard Henderson <[email protected]>
---
 target/arm/tcg/translate-a64.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c
index edbf67b03c..4a56fa70b7 100644
--- a/target/arm/tcg/translate-a64.c
+++ b/target/arm/tcg/translate-a64.c
@@ -566,8 +566,11 @@ static bool gen_indirect_branch(DisasContext *s)
 {
     if (s->ss_active) {
         gen_step_complete_exception(s);
-    } else {
+    } else if (s->tbflags_invalid) {
         tcg_gen_lookup_and_goto_ptr();
+    } else {
+        tcg_gen_goto_jc3_i64(cpu_pc, tcg_constant_i64(s->tbflags.flags2),
+                             s->tbflags.flags);
     }
     s->base.is_jmp = DISAS_NORETURN;
     return true;
-- 
2.53.0


Reply via email to