qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 16/20] target/arm: Make CCR register banked for


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH 16/20] target/arm: Make CCR register banked for v8M
Date: Tue, 29 Aug 2017 09:08:46 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

On 08/22/2017 08:08 AM, Peter Maydell wrote:
> +        if (attrs.secure) {
> +            /* the BFHFNMIGN bit is not banked; keep that in the NS copy */
> +            int new_bfhnmign = !!(value & R_V7M_CCR_BFHFNMIGN_MASK);
> +
> +            cpu->env.v7m.ccr[M_REG_NS] = 
> deposit32(cpu->env.v7m.ccr[M_REG_NS],
> +                                                    
> R_V7M_CCR_BFHFNMIGN_SHIFT,
> +                                                    
> R_V7M_CCR_BFHFNMIGN_LENGTH,
> +                                                    new_bfhnmign);
> +            value &= ~R_V7M_CCR_BFHFNMIGN_MASK;
> +        }

No need to extract and then redeposit, just use the mask.

    cpu->env.v7m.ccr[M_REG_NS] =
      (cpu->env.v7m.ccr[M_REG_NS] & ~R_V7M_CCR_BFHFNMIGN_MASK)
      | (value & R_V7M_CCR_BFHFNMIGN_MASK);


r~



reply via email to

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