On Thu, 6 Oct 2022 at 04:55, Richard Henderson <richard.hender...@linaro.org> wrote: > > In preparation for TARGET_TB_PCREL, reduce reliance on absolute values. > > Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> > Signed-off-by: Richard Henderson <richard.hender...@linaro.org> > @@ -296,7 +301,8 @@ TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int > ofs) > TCGv_i32 tmp = tcg_temp_new_i32(); > > if (reg == 15) { > - tcg_gen_movi_i32(tmp, (read_pc(s) & ~3) + ofs); > + /* This difference computes a page offset so ok for TARGET_TB_PCREL. > */ > + gen_pc_plus_diff(s, tmp, (read_pc(s) & ~3) - s->pc_curr + ofs); > } else { > tcg_gen_addi_i32(tmp, cpu_R[reg], ofs); > }
This is still doing the pc - pc thing -- I guess my comment on v5 crossed in the mail with your v6 repost. Otherwise Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> thanks -- PMM