aboutsummaryrefslogtreecommitdiff
path: root/linux-user/main.c
diff options
context:
space:
mode:
authorj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-25 21:35:50 +0000
committerj_mayer <j_mayer@c046a42c-6fe2-441c-8c8c-71466251a162>2007-10-25 21:35:50 +0000
commit0411a9725829d626bb0b2f11a461463c96061682 (patch)
tree105135188a4e2af4e3cf44518f5e2b14a7e83e01 /linux-user/main.c
parent7ac256b8725304aabae78bf012c25b6416509c46 (diff)
Gprof prooved the PowerPC emulation spent too much time in MSR load and store
routines. Coming back to a raw MSR storage model then speed-up the emulation. Improve fast MSR updates (wrtee wrteei and mtriee cases). Share rfi family instructions helpers code to avoid bug in duplicated code. Allow entering halt mode as the result of a rfi instruction. Add a new helper_regs.h file to avoid duplication of special registers manipulation routines (currently XER and MSR). git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3436 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'linux-user/main.c')
-rw-r--r--linux-user/main.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/linux-user/main.c b/linux-user/main.c
index 7c39121515..7590db80a6 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2168,14 +2168,13 @@ int main(int argc, char **argv)
}
cpu_ppc_register(env, def);
cpu_ppc_reset(env);
- for (i = 0; i < 32; i++) {
- if (i != 12 && i != 6 && i != 13)
- env->msr[i] = (regs->msr >> i) & 1;
- }
-#if defined(TARGET_PPC64) && !defined(TARGET_ABI32)
- msr_sf = 1;
+ env->msr = regs->msr & ~((1 << 6) | (1 << 12) | (1 << 13));
+#if defined(TARGET_PPC64)
+#if defined(TARGET_ABI32)
+ env->msr &= ~((target_ulong)1 << MSR_SF);
#else
- msr_sf = 0;
+ env->msr |= (target_ulong)1 << MSR_SF;
+#endif
#endif
env->nip = regs->nip;
for(i = 0; i < 32; i++) {