diff options
Diffstat (limited to 'target-mips/op.c')
-rw-r--r-- | target-mips/op.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/target-mips/op.c b/target-mips/op.c index 4aa63e3463..12498d0335 100644 --- a/target-mips/op.c +++ b/target-mips/op.c @@ -1358,9 +1358,10 @@ void op_mtc0_status (void) (val & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; #ifdef TARGET_MIPS64 - if ((env->hflags & MIPS_HFLAG_UM) && + if (!(env->CP0_Config0 & (0x3 << CP0C0_AT)) || + ((env->hflags & MIPS_HFLAG_UM) && !(val & (1 << CP0St_PX)) && - !(val & (1 << CP0St_UX))) + !(val & (1 << CP0St_UX)))) env->hflags &= ~MIPS_HFLAG_64; #endif if (val & (1 << CP0St_CU1)) @@ -2318,9 +2319,10 @@ void op_eret (void) (env->CP0_Status & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; #ifdef TARGET_MIPS64 - if ((env->hflags & MIPS_HFLAG_UM) && + if (!(env->CP0_Config0 & (0x3 << CP0C0_AT)) || + ((env->hflags & MIPS_HFLAG_UM) && !(env->CP0_Status & (1 << CP0St_PX)) && - !(env->CP0_Status & (1 << CP0St_UX))) + !(env->CP0_Status & (1 << CP0St_UX)))) env->hflags &= ~MIPS_HFLAG_64; #endif if (loglevel & CPU_LOG_EXEC) @@ -2341,9 +2343,10 @@ void op_deret (void) (env->CP0_Status & (1 << CP0St_UM))) env->hflags |= MIPS_HFLAG_UM; #ifdef TARGET_MIPS64 - if ((env->hflags & MIPS_HFLAG_UM) && + if (!(env->CP0_Config0 & (0x3 << CP0C0_AT)) || + ((env->hflags & MIPS_HFLAG_UM) && !(env->CP0_Status & (1 << CP0St_PX)) && - !(env->CP0_Status & (1 << CP0St_UX))) + !(env->CP0_Status & (1 << CP0St_UX)))) env->hflags &= ~MIPS_HFLAG_64; #endif if (loglevel & CPU_LOG_EXEC) |