On 2023/4/4 23:27, Richard Henderson wrote:
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.
helper? Do you mean gen_pc_plus_diff?
The trans_* functions will be supplying a immediate directly:
* for auipc, this is a->imm,
Yeah. this will be simpler in trans_, however the total calculation is
the same. we just move a->imm + pc_next to gen_pc_plus_diff.
* for jalr, this is 0.
Not 0, but pc_succ_insn - pc_next. This may be the case in many place.
Regards,
Weiwei Li
r~