qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 10/11] Hexagon (target/hexagon) Use direct block chaining


From: Richard Henderson
Subject: Re: [PATCH v3 10/11] Hexagon (target/hexagon) Use direct block chaining for direct jump/branch
Date: Sat, 5 Nov 2022 12:33:03 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2

On 11/5/22 06:26, Taylor Simpson wrote:
Direct block chaining is documented here
https://qemu.readthedocs.io/en/latest/devel/tcg.html#direct-block-chaining

Recall that Hexagon allows packets with multiple jumps where only the first
one with a true predicate will actually jump.  So, we can only use direct
block chaining when the packet contains a single PC-relative jump.

Not quite accurate.

Only the first two direct branches can use direct block chaining. Other exits from the translation block could use indirect block chaining (tcg_gen_lookup_and_goto_ptr). You just have to remember which is taken.

That said, this is certainly an improvement.

+    if (ctx->pkt->pkt_has_multi_cof) {
+        gen_write_new_pc_addr(ctx, tcg_constant_tl(dest), pred);
+    } else {
+        /* Defer this jump to the end of the TB */
+        g_assert(ctx->branch_cond == NULL);
+        ctx->has_single_direct_branch = true;
+        if (pred != NULL) {
+            ctx->branch_cond = tcg_temp_local_new();
+            tcg_gen_mov_tl(ctx->branch_cond, pred);
+        }
+        ctx->branch_dest = dest;

Perhaps re-use hex_branch_taken as branch_cond?

Anyway,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]