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 --- linux-user/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-user/main.c') diff --git a/linux-user/main.c b/linux-user/main.c index 9f3476b..f4bbe69 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -1114,6 +1114,11 @@ void cpu_loop (CPUSPARCState *env) while (1) { trapnr = cpu_sparc_exec (env); + /* Compute PSR before exposing state. */ + if (env->cc_op != CC_OP_FLAGS) { + cpu_get_psr(env); + } + switch (trapnr) { #ifndef TARGET_SPARC64 case 0x88: -- cgit v1.1