On Tue, Feb 1, 2011 at 05:31, Peter Maydell wrote:
> So for instance here:
>
> +static void gen_hwloop_check(DisasContext *dc)
> +{
> +    bool loop1, loop0;
> +    int endl;
> +
> +    loop1 = (dc->pc == dc->env->lbreg[1]);
> +    loop0 = (dc->pc == dc->env->lbreg[0]);
>
> I suspect that this check of pc against the lbreg[]
> values should be being done in the generated code,
> not at translate time.

that is not feasible from a performance perspective.  what you're
proposing is that i put a check on *every* insn to see if the current
pc is equal to either of the loop registers.

the way i'm doing it atm i believe is safe.  if a lbreg changes, then
i invalidate any TBs associated with the old value and any TBs
associated with the new value.  thus i force the code to be
retranslated, and i can assume the lbreg values are constant when
doing so.
-mike

Reply via email to