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~