aboutsummaryrefslogtreecommitdiff
path: root/target-ppc/op.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 /target-ppc/op.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 'target-ppc/op.c')
-rw-r--r--target-ppc/op.c41
1 files changed, 23 insertions, 18 deletions
diff --git a/target-ppc/op.c b/target-ppc/op.c
index 4889ad476f..0030c14661 100644
--- a/target-ppc/op.c
+++ b/target-ppc/op.c
@@ -22,6 +22,7 @@
#include "config.h"
#include "exec.h"
+#include "helper_regs.h"
#include "op_helper.h"
#define REG 0
@@ -284,13 +285,13 @@ void OPPROTO op_store_xer_bc (void)
void OPPROTO op_load_xer (void)
{
- do_load_xer();
+ T0 = hreg_load_xer(env);
RETURN();
}
void OPPROTO op_store_xer (void)
{
- do_store_xer();
+ hreg_store_xer(env, T0);
RETURN();
}
@@ -358,37 +359,36 @@ void OPPROTO op_store_asr (void)
void OPPROTO op_load_msr (void)
{
- T0 = do_load_msr(env);
+ T0 = env->msr;
RETURN();
}
void OPPROTO op_store_msr (void)
{
- if (do_store_msr(env, T0)) {
- env->halted = 1;
- do_raise_exception(EXCP_HLT);
- }
+ do_store_msr();
RETURN();
}
-void OPPROTO op_update_riee (void)
+#if defined (TARGET_PPC64)
+void OPPROTO op_store_msr_32 (void)
{
- msr_ri = (T0 >> MSR_RI) & 1;
- msr_ee = (T0 >> MSR_EE) & 1;
+ T0 = (env->msr & ~0xFFFFFFFFULL) | (T0 & 0xFFFFFFFF);
+ do_store_msr();
RETURN();
}
+#endif
-#if defined (TARGET_PPC64)
-void OPPROTO op_store_msr_32 (void)
+void OPPROTO op_update_riee (void)
{
- if (ppc_store_msr_32(env, T0)) {
- env->halted = 1;
- do_raise_exception(EXCP_HLT);
- }
+ /* We don't call do_store_msr here as we won't trigger
+ * any special case nor change hflags
+ */
+ T0 &= (1 << MSR_RI) | (1 << MSR_EE);
+ env->msr &= ~(1 << MSR_RI) | (1 << MSR_EE);
+ env->msr |= T0;
RETURN();
}
#endif
-#endif
/* SPR */
void OPPROTO op_load_spr (void)
@@ -2517,7 +2517,12 @@ void OPPROTO op_rfmci (void)
void OPPROTO op_wrte (void)
{
- msr_ee = T0 >> 16;
+ /* We don't call do_store_msr here as we won't trigger
+ * any special case nor change hflags
+ */
+ T0 &= 1 << MSR_EE;
+ env->msr &= ~(1 << MSR_EE);
+ env->msr |= T0;
RETURN();
}