On 7 January 2011 16:01, Aurelien Jarno <aurel...@aurel32.net> wrote: > On Fri, Jan 07, 2011 at 03:06:28PM +0000, Peter Maydell wrote: >> When translating the SRS instruction, handle the "store registers >> to stack of current mode" case in the helper function rather than >> inline. This means the generated code does not make assumptions >> about the current CPU mode which might not be valid when the TB >> is executed later. > > Have you considered using tb flags instead? On the other hand I am not > sure it will make a real difference.
I thought about that, but: (a) if we put the current mode into the tb->flags then TBs which could previously have been shared between several modes now have to be translated as separate TBs for each mode (b) it would eat 5 bits of tb->flags and we only have 16 left (c) SRS isn't a very commonly used instruction anyway (and the overhead of taking the exception will dwarf the call out to the helper for SRS) -- PMM