qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target/sh4: optimize cross-page and indirect jumps
@ 2017-06-07 21:20 Aurelien Jarno
  2017-06-09  5:39 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Aurelien Jarno @ 2017-06-07 21:20 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurelien Jarno

Instead of unconditionally exiting to the exec loop for indirect jumps
or cross-page direct jumps, use the lookup_and_goto_ptr helper to jump
to the target if it is valid.

Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/sh4/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 8bc132b27b..4f20537ef8 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -249,7 +249,7 @@ static void gen_goto_tb(DisasContext *ctx, int n, target_ulong dest)
         tcg_gen_movi_i32(cpu_pc, dest);
         if (ctx->singlestep_enabled)
             gen_helper_debug(cpu_env);
-        tcg_gen_exit_tb(0);
+        tcg_gen_lookup_and_goto_ptr(cpu_pc);
     }
 }
 
@@ -262,7 +262,7 @@ static void gen_jump(DisasContext * ctx)
         tcg_gen_discard_i32(cpu_delayed_pc);
 	if (ctx->singlestep_enabled)
             gen_helper_debug(cpu_env);
-	tcg_gen_exit_tb(0);
+        tcg_gen_lookup_and_goto_ptr(cpu_pc);
     } else {
 	gen_goto_tb(ctx, 0, ctx->delayed_pc);
     }
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] target/sh4: optimize cross-page and indirect jumps
  2017-06-07 21:20 [Qemu-devel] [PATCH] target/sh4: optimize cross-page and indirect jumps Aurelien Jarno
@ 2017-06-09  5:39 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2017-06-09  5:39 UTC (permalink / raw)
  To: Aurelien Jarno, qemu-devel

On 06/07/2017 02:20 PM, Aurelien Jarno wrote:
>           if (ctx->singlestep_enabled)
>               gen_helper_debug(cpu_env);
> -        tcg_gen_exit_tb(0);
> +        tcg_gen_lookup_and_goto_ptr(cpu_pc);

That really should be an else for that if, since helper_debug doesn't return.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-09  5:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-07 21:20 [Qemu-devel] [PATCH] target/sh4: optimize cross-page and indirect jumps Aurelien Jarno
2017-06-09  5:39 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).