diff options
author | Richard Henderson <rth@twiddle.net> | 2012-10-09 14:50:00 -0700 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-10-13 10:17:28 +0000 |
commit | 20132b96055e1da1d114067c15bf53e78a25d1c4 (patch) | |
tree | ef09008f6b3f63ef3067350a2cd27898c2643c05 /linux-user | |
parent | 6234ac09a947d1402f92b6d25ccea6faa4433b5b (diff) |
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 <rth@twiddle.net>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/main.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/linux-user/main.c b/linux-user/main.c index 9f3476ba57..f4bbe697f7 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: |