From 20132b96055e1da1d114067c15bf53e78a25d1c4 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 9 Oct 2012 14:50:00 -0700 Subject: target-sparc: Don't compute full flags value so often Avoid speculatively computing flags before every potentially trapping operation and instead do the flags computation when a trap actually occurs. This gives approximately 30% speedup in emulation. Signed-off-by: Richard Henderson Signed-off-by: Blue Swirl --- target-sparc/int64_helper.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'target-sparc/int64_helper.c') diff --git a/target-sparc/int64_helper.c b/target-sparc/int64_helper.c index 5d0bc6c..df37aa1 100644 --- a/target-sparc/int64_helper.c +++ b/target-sparc/int64_helper.c @@ -64,6 +64,11 @@ void do_interrupt(CPUSPARCState *env) int intno = env->exception_index; trap_state *tsptr; + /* Compute PSR before exposing state. */ + if (env->cc_op != CC_OP_FLAGS) { + cpu_get_psr(env); + } + #ifdef DEBUG_PCALL if (qemu_loglevel_mask(CPU_LOG_INT)) { static int count; -- cgit v1.1