qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Zenghui Yu <yuzenghui@huawei.com>
Cc: qemu-devel@nongnu.org, peter.maydell@linaro.org, hev <r@hev.cc>,
	"Alex Bennée" <alex.bennee@linaro.org>
Subject: Re: [PULL 16/22] tcg/aarch64: Reorg goto_tb implementation
Date: Tue, 31 Jan 2023 21:07:46 -1000	[thread overview]
Message-ID: <a1b44a66-f95c-b42f-865e-882495285fe9@linaro.org> (raw)
In-Reply-To: <ffac2cd4-b1e1-53a9-8c88-367f80f1e977@huawei.com>

On 1/31/23 15:45, Zenghui Yu wrote:
> On 2023/1/18 7:10, Richard Henderson wrote:
>> +void tb_target_set_jmp_target(const TranslationBlock *tb, int n,
>> +                              uintptr_t jmp_rx, uintptr_t jmp_rw)
>> +{
>> +    uintptr_t d_addr = tb->jmp_target_addr[n];
>> +    ptrdiff_t d_offset = d_addr - jmp_rx;
>> +    tcg_insn_unit insn;
>> +
>> +    /* Either directly branch, or indirect branch load. */
>> +    if (d_offset == sextract64(d_offset, 0, 28)) {
>> +        insn = deposit32(I3206_B, 0, 26, d_offset >> 2);
>> +    } else {
>> +        uintptr_t i_addr = (uintptr_t)&tb->jmp_target_addr[n];
>> +        ptrdiff_t i_offset = i_addr - jmp_rx;
>> +
>> +        /* Note that we asserted this in range in tcg_out_goto_tb. */
>> +        insn = deposit32(I3305_LDR | TCG_REG_TMP, 0, 5, i_offset >> 2);
> 
> 'offset' should be bits [23:5] of LDR instruction, rather than [4:0].

Quite right.  Oops.


r~


  reply	other threads:[~2023-02-01  7:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-17 23:10 [PULL 00/22] tcg patch queue Richard Henderson
2023-01-17 23:10 ` [PULL 01/22] tcg: Split out tcg_out_exit_tb Richard Henderson
2023-01-17 23:10 ` [PULL 02/22] tcg/i386: Remove unused goto_tb code for indirect jump Richard Henderson
2023-01-17 23:10 ` [PULL 03/22] tcg/ppc: " Richard Henderson
2023-01-17 23:10 ` [PULL 04/22] tcg/sparc64: " Richard Henderson
2023-01-17 23:10 ` [PULL 05/22] tcg: Replace asserts on tcg_jmp_insn_offset Richard Henderson
2023-01-17 23:10 ` [PULL 06/22] tcg: Introduce set_jmp_insn_offset Richard Henderson
2023-01-17 23:10 ` [PULL 07/22] tcg: Introduce get_jmp_target_addr Richard Henderson
2023-01-17 23:10 ` [PULL 08/22] tcg: Split out tcg_out_goto_tb Richard Henderson
2023-01-17 23:10 ` [PULL 09/22] tcg: Rename TB_JMP_RESET_OFFSET_INVALID to TB_JMP_OFFSET_INVALID Richard Henderson
2023-01-17 23:10 ` [PULL 10/22] tcg: Add gen_tb to TCGContext Richard Henderson
2023-01-17 23:10 ` [PULL 11/22] tcg: Add TranslationBlock.jmp_insn_offset Richard Henderson
2023-01-17 23:10 ` [PULL 12/22] tcg: Change tb_target_set_jmp_target arguments Richard Henderson
2023-01-17 23:10 ` [PULL 13/22] tcg: Move tb_target_set_jmp_target declaration to tcg.h Richard Henderson
2023-01-17 23:10 ` [PULL 14/22] tcg: Always define tb_target_set_jmp_target Richard Henderson
2023-01-17 23:10 ` [PULL 15/22] tcg: Remove TCG_TARGET_HAS_direct_jump Richard Henderson
2023-01-17 23:10 ` [PULL 16/22] tcg/aarch64: Reorg goto_tb implementation Richard Henderson
2023-02-01  1:45   ` Zenghui Yu via
2023-02-01  7:07     ` Richard Henderson [this message]
2023-01-17 23:10 ` [PULL 17/22] tcg/ppc: " Richard Henderson
2023-01-17 23:10 ` [PULL 18/22] tcg/sparc64: Remove USE_REG_TB Richard Henderson
2023-01-17 23:10 ` [PULL 19/22] tcg/sparc64: Reorg goto_tb implementation Richard Henderson
2023-01-17 23:10 ` [PULL 20/22] tcg/arm: Implement direct branch for goto_tb Richard Henderson
2023-01-17 23:10 ` [PULL 21/22] tcg/riscv: Introduce OPC_NOP Richard Henderson
2023-01-17 23:10 ` [PULL 22/22] tcg/riscv: Implement direct branch for goto_tb Richard Henderson
2023-01-19 15:05 ` [PULL 00/22] tcg patch queue Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1b44a66-f95c-b42f-865e-882495285fe9@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r@hev.cc \
    --cc=yuzenghui@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).