qemu-devel
[Top][All Lists]
Advanced

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

Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative tran


From: liweiwei
Subject: Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation
Date: Mon, 3 Apr 2023 09:28:37 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0


On 2023/4/3 02:00, Richard Henderson wrote:
On 4/2/23 06:17, LIU Zhiwei wrote:
Why set pc_save here?  IMHO, pc_save is a constant.

pc_save is a value which is strictly related to the value of env->pc.
real_pc = (old)env->pc + target_pc(from tb) - ctx->pc_save

In this formula, the meaning of target_pc(from tb) doesn't match with gen_get_target_pc in the code. Its meaning in the code matches the real_pc in the formula. I think we should rename the gen_get_target_pc to gen_get_real_pc.

Neither name is ideal, because it is also used for things that are not "pc".
See e.g. target/arm/, where this is called gen_pc_plus_diff.

OK. Acceptable to me.

Regards,

Weiwei Li

This makes slightly more sense for uses like auipc and jalr.


r~




reply via email to

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