diff mbox series

[v2,10/45] target/hppa: Skip nullified insns in unconditional dbranch path

Message ID 20240513074717.130949-11-richard.henderson@linaro.org
State Superseded
Headers show
Series target/hppa: Misc improvements | expand

Commit Message

Richard Henderson May 13, 2024, 7:46 a.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 target/hppa/translate.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Comments

Helge Deller May 14, 2024, 2:40 p.m. UTC | #1
* Richard Henderson <richard.henderson@linaro.org>:
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Helge Deller <deller@gmx.de>

> ---
>  target/hppa/translate.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/target/hppa/translate.c b/target/hppa/translate.c
> index a9196050dc..ca979f4137 100644
> --- a/target/hppa/translate.c
> +++ b/target/hppa/translate.c
> @@ -1805,11 +1805,17 @@ static bool do_dbranch(DisasContext *ctx, int64_t disp,
>  
>      if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) {
>          install_link(ctx, link, false);
> -        ctx->iaoq_n = dest;
> -        ctx->iaoq_n_var = NULL;
>          if (is_n) {
> +            if (use_nullify_skip(ctx)) {
> +                nullify_set(ctx, 0);
> +                gen_goto_tb(ctx, 0, dest, dest + 4);
> +                ctx->base.is_jmp = DISAS_NORETURN;
> +                return true;
> +            }
>              ctx->null_cond.c = TCG_COND_ALWAYS;
>          }
> +        ctx->iaoq_n = dest;
> +        ctx->iaoq_n_var = NULL;
>      } else {
>          nullify_over(ctx);
>  
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index a9196050dc..ca979f4137 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1805,11 +1805,17 @@  static bool do_dbranch(DisasContext *ctx, int64_t disp,
 
     if (ctx->null_cond.c == TCG_COND_NEVER && ctx->null_lab == NULL) {
         install_link(ctx, link, false);
-        ctx->iaoq_n = dest;
-        ctx->iaoq_n_var = NULL;
         if (is_n) {
+            if (use_nullify_skip(ctx)) {
+                nullify_set(ctx, 0);
+                gen_goto_tb(ctx, 0, dest, dest + 4);
+                ctx->base.is_jmp = DISAS_NORETURN;
+                return true;
+            }
             ctx->null_cond.c = TCG_COND_ALWAYS;
         }
+        ctx->iaoq_n = dest;
+        ctx->iaoq_n_var = NULL;
     } else {
         nullify_over(ctx);