From: Richard Henderson <richard.henderson@linaro.org>
To: liweiwei <liweiwei@iscas.ac.cn>,
qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Cc: palmer@dabbelt.com, alistair.francis@wdc.com,
bin.meng@windriver.com, dbarboza@ventanamicro.com,
zhiwei_liu@linux.alibaba.com, wangjunqiang@iscas.ac.cn,
lazyparser@gmail.com
Subject: Re: [PATCH v6 4/6] target/riscv: Add support for PC-relative translation
Date: Tue, 4 Apr 2023 08:27:34 -0700 [thread overview]
Message-ID: <473b9eb0-59e9-d117-e50c-5138b0fbe50d@linaro.org> (raw)
In-Reply-To: <f96d42c8-aa14-9315-832c-d7d2dcd05646@iscas.ac.cn>
On 4/4/23 08:14, liweiwei wrote:
>
> On 2023/4/4 22:57, Richard Henderson wrote:
>> On 4/4/23 07:33, liweiwei wrote:
>>> If we want to hide all of them in gen_pc_plus_diff, then we need calculate the diff
>>> for pc_succ_insn or introduce a new API for it, since we need get the successor pc in
>>> many instructions.
>>>
>>> And the logic for gen_goto_tb or gen_set_pc_imm also need update.
>>
>> Yes, exactly.
>>
>>
> Sorry, I didn't find benefits from this. If we do this, we'll firstly calculate the diff =
> pc_succ_insn - pc_next, then we add it with pc_next - pc_save to get the relative address
> to env->pc.
It will me simpler because you'll move all of the calculations into a helper function.
The trans_* functions will be supplying a immediate directly:
* for auipc, this is a->imm,
* for jalr, this is 0.
r~
next prev parent reply other threads:[~2023-04-04 15:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 2:06 [PATCH v6 0/6] target/riscv: Fix pointer mask related support Weiwei Li
2023-04-04 2:06 ` [PATCH v6 1/6] target/riscv: Fix pointer mask transformation for vector address Weiwei Li
2023-04-05 4:38 ` Alistair Francis
2023-04-04 2:06 ` [PATCH v6 2/6] target/riscv: Update cur_pmmask/base when xl changes Weiwei Li
2023-04-05 4:38 ` Alistair Francis
2023-04-04 2:06 ` [PATCH v6 3/6] target/riscv: Fix target address to update badaddr Weiwei Li
2023-04-04 3:06 ` LIU Zhiwei
2023-04-04 3:37 ` liweiwei
2023-04-05 4:41 ` Alistair Francis
2023-04-04 2:06 ` [PATCH v6 4/6] target/riscv: Add support for PC-relative translation Weiwei Li
2023-04-04 3:12 ` LIU Zhiwei
2023-04-04 3:25 ` LIU Zhiwei
2023-04-04 3:46 ` liweiwei
2023-04-04 7:07 ` LIU Zhiwei
2023-04-04 8:48 ` liweiwei
2023-04-04 9:23 ` LIU Zhiwei
2023-04-04 14:05 ` Richard Henderson
2023-04-04 13:56 ` Richard Henderson
2023-04-04 14:33 ` liweiwei
2023-04-04 14:57 ` Richard Henderson
2023-04-04 15:14 ` liweiwei
2023-04-04 15:27 ` Richard Henderson [this message]
2023-04-04 15:39 ` liweiwei
2023-04-04 2:06 ` [PATCH v6 5/6] target/riscv: Enable PC-relative translation in system mode Weiwei Li
2023-04-04 2:06 ` [PATCH v6 6/6] target/riscv: Add pointer mask support for instruction fetch Weiwei Li
2023-04-04 2:52 ` LIU Zhiwei
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=473b9eb0-59e9-d117-e50c-5138b0fbe50d@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=bin.meng@windriver.com \
--cc=dbarboza@ventanamicro.com \
--cc=lazyparser@gmail.com \
--cc=liweiwei@iscas.ac.cn \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=wangjunqiang@iscas.ac.cn \
--cc=zhiwei_liu@linux.alibaba.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).