Peter Maydell <peter.mayd...@linaro.org> writes: > On 10 July 2017 at 13:15, Alex Bennée <alex.ben...@linaro.org> wrote: >> Looking at translate.c (32 bit arm), we have: >> >> gen_srs >> gen_mrs_banked >> gen_msr_banked >> >> These all manually set: >> >> gen_set_pc_im(s, s->pc - 4); >> >> before their respective helpers. I think setting the PC after the helper >> is superfluous given we are will at that point be exiting the block. > > No, you need both. We do > gen_set_pc_im(s, s->pc - 4); > before calling the helper because the helper might throw an > exception, in which case the PC needs to point to that insn. > We then call > gen_set_pc_im(dc, dc->pc); > before exiting the block because if we leave execution by > falling off the end of the block then the PC should point to > the insn that comes next (ie just after the last one in the block)
OK I see now. I think I have a plan going forward. > > thanks > -- PMM -- Alex Bennée