All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/5] ppc: Don't generate dead code on unconditional branches
@ 2016-07-31  5:13 Benjamin Herrenschmidt
  2016-07-31  5:13 ` [Qemu-devel] [PATCH 2/5] ppc: Improve flags for helpers loading/writing the time facilities Benjamin Herrenschmidt
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Benjamin Herrenschmidt @ 2016-07-31  5:13 UTC (permalink / raw)
  To: qemu-ppc; +Cc: qemu-devel, david, Richard Henderson, Benjamin Herrenschmidt

We are always generating the "else" case of the condition even when
generating an unconditional branch that will never hit it.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 target-ppc/translate.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index d1837f8..47eb9ed 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -3479,8 +3479,10 @@ static inline void gen_bcond(DisasContext *ctx, int type)
         } else {
             gen_goto_tb(ctx, 0, li);
         }
-        gen_set_label(l1);
-        gen_goto_tb(ctx, 1, ctx->nip);
+        if ((bo & 0x14) != 0x14) {
+            gen_set_label(l1);
+            gen_goto_tb(ctx, 1, ctx->nip);
+        }
     } else {
         if (NARROW_MODE(ctx)) {
             tcg_gen_andi_tl(cpu_nip, target, (uint32_t)~3);
@@ -3488,9 +3490,11 @@ static inline void gen_bcond(DisasContext *ctx, int type)
             tcg_gen_andi_tl(cpu_nip, target, ~3);
         }
         tcg_gen_exit_tb(0);
-        gen_set_label(l1);
-        gen_update_nip(ctx, ctx->nip);
-        tcg_gen_exit_tb(0);
+        if ((bo & 0x14) != 0x14) {
+            gen_set_label(l1);
+            gen_update_nip(ctx, ctx->nip);
+            tcg_gen_exit_tb(0);
+        }
     }
     if (type == BCOND_LR || type == BCOND_CTR || type == BCOND_TAR) {
         tcg_temp_free(target);
-- 
2.7.4

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

end of thread, other threads:[~2016-08-09  4:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-31  5:13 [Qemu-devel] [PATCH 1/5] ppc: Don't generate dead code on unconditional branches Benjamin Herrenschmidt
2016-07-31  5:13 ` [Qemu-devel] [PATCH 2/5] ppc: Improve flags for helpers loading/writing the time facilities Benjamin Herrenschmidt
2016-08-06  8:46   ` Richard Henderson
2016-07-31  5:13 ` [Qemu-devel] [PATCH 3/5] ppc: Improve the exception helpers flags Benjamin Herrenschmidt
2016-08-06  8:46   ` Richard Henderson
2016-07-31  5:13 ` [Qemu-devel] [PATCH 4/5] ppc: Improve a few more helper flags Benjamin Herrenschmidt
2016-08-06  8:47   ` Richard Henderson
2016-07-31  5:13 ` [Qemu-devel] [PATCH 5/5] ppc: Improve generation of conditional traps Benjamin Herrenschmidt
2016-08-01  6:24   ` David Gibson
2016-08-06  9:03   ` Richard Henderson
2016-08-07  0:47     ` Benjamin Herrenschmidt
2016-08-09  2:07   ` David Gibson
2016-08-09  4:03     ` Benjamin Herrenschmidt
2016-08-06  9:05 ` [Qemu-devel] [PATCH 1/5] ppc: Don't generate dead code on unconditional branches Richard Henderson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.