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~