|
From: | Richard Henderson |
Subject: | Re: [RESEND PATCH v5 4/6] target/riscv: Add support for PC-relative translation |
Date: | Sun, 2 Apr 2023 11:00:56 -0700 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 |
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_saveIn 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. This makes slightly more sense for uses like auipc and jalr. r~
[Prev in Thread] | Current Thread | [Next in Thread] |