[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 9/9] target/arm: Enable TARGET_TB_PCREL
From: |
Peter Maydell |
Subject: |
Re: [PATCH v7 9/9] target/arm: Enable TARGET_TB_PCREL |
Date: |
Mon, 17 Oct 2022 14:48:43 +0100 |
On Sun, 16 Oct 2022 at 23:23, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> static void gen_goto_tb(DisasContext *s, int n, int64_t diff)
> {
> - uint64_t dest = s->pc_curr + diff;
> -
> - if (use_goto_tb(s, dest)) {
> - tcg_gen_goto_tb(n);
> - gen_a64_update_pc(s, diff);
> + if (use_goto_tb(s, s->pc_curr + diff)) {
> + if (TARGET_TB_PCREL) {
> + gen_a64_update_pc(s, diff);
> + tcg_gen_goto_tb(n);
> + } else {
> + tcg_gen_goto_tb(n);
> + gen_a64_update_pc(s, diff);
> + }
Why do we need to do these things in the opposite order
depending on TARGET_TB_PCREL ? If there's an obscure dependency
then it would be worth commenting it, but it would be nicer
if the semantics of the functions were such that they didn't
need to be called the opposite way round for the two cases...
> tcg_gen_exit_tb(s->base.tb, n);
> s->base.is_jmp = DISAS_NORETURN;
> } else {
thanks
-- PMM
- [PATCH v7 0/9] target/arm: pc-relative translation blocks, Richard Henderson, 2022/10/16
- [PATCH v7 1/9] target/arm: Introduce curr_insn_len, Richard Henderson, 2022/10/16
- [PATCH v7 2/9] target/arm: Change gen_goto_tb to work on displacements, Richard Henderson, 2022/10/16
- [PATCH v7 3/9] target/arm: Change gen_*set_pc_im to gen_*update_pc, Richard Henderson, 2022/10/16
- [PATCH v7 4/9] target/arm: Change gen_exception_insn* to work on displacements, Richard Henderson, 2022/10/16
- [PATCH v7 5/9] target/arm: Remove gen_exception_internal_insn pc argument, Richard Henderson, 2022/10/16
- [PATCH v7 6/9] target/arm: Change gen_jmp* to work on displacements, Richard Henderson, 2022/10/16
- [PATCH v7 7/9] target/arm: Introduce gen_pc_plus_diff for aarch64, Richard Henderson, 2022/10/16
- [PATCH v7 8/9] target/arm: Introduce gen_pc_plus_diff for aarch32, Richard Henderson, 2022/10/16
- [PATCH v7 9/9] target/arm: Enable TARGET_TB_PCREL, Richard Henderson, 2022/10/16
- Re: [PATCH v7 9/9] target/arm: Enable TARGET_TB_PCREL,
Peter Maydell <=