qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops imple


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] target/xtensa: rework zero overhead loops implementation
Date: Sat, 12 Jan 2019 08:11:11 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1

On 1/11/19 10:49 PM, Max Filippov wrote:
> @@ -706,6 +716,17 @@ static inline void cpu_get_tb_cpu_state(CPUXtensaState 
> *env, target_ulong *pc,
>      *flags |= xtensa_get_ring(env);
>      if (env->sregs[PS] & PS_EXCM) {
>          *flags |= XTENSA_TBFLAG_EXCM;
> +    } else if (xtensa_option_enabled(env->config, XTENSA_OPTION_LOOP)) {
> +        target_ulong lend_dist = env->sregs[LEND] - (env->pc & 
> LINKABLE_MASK);
> +
> +        if (lend_dist < LINKABLE_SIZE + env->config->max_insn_size) {
> +            target_ulong lbeg_off = env->sregs[LEND] - env->sregs[LBEG];
> +
> +            *cs_base = lend_dist;
> +            if (lbeg_off < 256) {
> +                *cs_base |= lbeg_off << XTENSA_CSBASE_LBEG_OFF_SHIFT;
> +            }
> +        }
>      }
>      if (xtensa_option_enabled(env->config, XTENSA_OPTION_EXTENDED_L32R) &&
>              (env->sregs[LITBASE] & 1)) {

I think the only other thing that would be nice is some comment that describes
the loop scheme.  I can follow it now, but it took a while of re-reading.  In
particular, the fact that 0 means "disabled", and happens to work because we
(correctly) only check for LEND at the end of an instruction.  Thus the offset
from pc_first will always be non-zero when we check.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]