qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [v2 PATCH] target-mips: implement UserLocal Register


From: Richard Henderson
Subject: Re: [Qemu-devel] [v2 PATCH] target-mips: implement UserLocal Register
Date: Mon, 26 May 2014 15:53:06 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

On 05/26/2014 10:28 AM, Petar Jovanovic wrote:
>  void helper_mtc0_hwrena(CPUMIPSState *env, target_ulong arg1)
>  {
> -    env->CP0_HWREna = arg1 & 0x0000000F;
> +    uint32_t mask = 0x0000000F;
> +
> +    if (env->CP0_Config3 & (1 << CP0C3_ULRI)) {
> +        mask |= 0x20000000;
> +    }
> +
> +    env->CP0_HWREna = arg1 & mask;
>  }

If you're going to force the bit on here...

> +target_ulong helper_rdhwr_ul(CPUMIPSState *env)
> +{
> +    if ((env->hflags & MIPS_HFLAG_CP0) ||
> +        (env->CP0_HWREna & (1 << 29))) {
> +        return env->active_tc.CP0_UserLocal;
> +    } else {
> +        helper_raise_exception(env, EXCP_RI);
> +    }

... why do you need to check it here?

I still think you only need to check the one ULRI bit, which gets properly set
into hflags, and thus checked within the translator.


r~



reply via email to

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