aboutsummaryrefslogtreecommitdiff
path: root/target-mips/op.c
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-08-26 17:37:23 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-08-26 17:37:23 +0000
commit3ddf0b5cde7c741258487710c40f7318fdcd0f18 (patch)
treee106e525e0477c3559ae68c90d28406e7c9890dc /target-mips/op.c
parentc92843b5dfc1e8f7baace9b7a4eac3e3231ac73e (diff)
Disable 64-bit instructions on 32-bit CPU, by Aurelien Jarno.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3146 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-mips/op.c')
-rw-r--r--target-mips/op.c15
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)