diff mbox

[v3,08/15] target/sh4: fold ctx->bstate = BS_BRANCH into gen_conditional_jump

Message ID 20170510182636.17791-9-aurelien@aurel32.net (mailing list archive)
State New, archived
Headers show

Commit Message

Aurelien Jarno May 10, 2017, 6:26 p.m. UTC
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
---
 target/sh4/translate.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Philippe Mathieu-Daudé May 12, 2017, 11:59 p.m. UTC | #1
On 05/10/2017 03:26 PM, Aurelien Jarno wrote:
> Reviewed-by: Richard Henderson <rth@twiddle.net>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  target/sh4/translate.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 8cee7d333f..a4c7a0895b 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -279,6 +279,7 @@ static void gen_conditional_jump(DisasContext * ctx,
>      gen_goto_tb(ctx, 0, ifnott);
>      gen_set_label(l1);
>      gen_goto_tb(ctx, 1, ift);
> +    ctx->bstate = BS_BRANCH;
>  }
>
>  /* Delayed conditional jump (bt or bf) */
> @@ -1158,9 +1159,7 @@ static void _decode_opc(DisasContext * ctx)
>  	return;
>      case 0x8b00:		/* bf label */
>  	CHECK_NOT_DELAY_SLOT
> -	    gen_conditional_jump(ctx, ctx->pc + 2,
> -				 ctx->pc + 4 + B7_0s * 2);
> -	ctx->bstate = BS_BRANCH;
> +        gen_conditional_jump(ctx, ctx->pc + 2, ctx->pc + 4 + B7_0s * 2);
>  	return;
>      case 0x8f00:		/* bf/s label */
>  	CHECK_NOT_DELAY_SLOT
> @@ -1170,9 +1169,7 @@ static void _decode_opc(DisasContext * ctx)
>  	return;
>      case 0x8900:		/* bt label */
>  	CHECK_NOT_DELAY_SLOT
> -	    gen_conditional_jump(ctx, ctx->pc + 4 + B7_0s * 2,
> -				 ctx->pc + 2);
> -	ctx->bstate = BS_BRANCH;
> +        gen_conditional_jump(ctx, ctx->pc + 4 + B7_0s * 2, ctx->pc + 2);
>  	return;
>      case 0x8d00:		/* bt/s label */
>  	CHECK_NOT_DELAY_SLOT
>
diff mbox

Patch

diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 8cee7d333f..a4c7a0895b 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -279,6 +279,7 @@  static void gen_conditional_jump(DisasContext * ctx,
     gen_goto_tb(ctx, 0, ifnott);
     gen_set_label(l1);
     gen_goto_tb(ctx, 1, ift);
+    ctx->bstate = BS_BRANCH;
 }
 
 /* Delayed conditional jump (bt or bf) */
@@ -1158,9 +1159,7 @@  static void _decode_opc(DisasContext * ctx)
 	return;
     case 0x8b00:		/* bf label */
 	CHECK_NOT_DELAY_SLOT
-	    gen_conditional_jump(ctx, ctx->pc + 2,
-				 ctx->pc + 4 + B7_0s * 2);
-	ctx->bstate = BS_BRANCH;
+        gen_conditional_jump(ctx, ctx->pc + 2, ctx->pc + 4 + B7_0s * 2);
 	return;
     case 0x8f00:		/* bf/s label */
 	CHECK_NOT_DELAY_SLOT
@@ -1170,9 +1169,7 @@  static void _decode_opc(DisasContext * ctx)
 	return;
     case 0x8900:		/* bt label */
 	CHECK_NOT_DELAY_SLOT
-	    gen_conditional_jump(ctx, ctx->pc + 4 + B7_0s * 2,
-				 ctx->pc + 2);
-	ctx->bstate = BS_BRANCH;
+        gen_conditional_jump(ctx, ctx->pc + 4 + B7_0s * 2, ctx->pc + 2);
 	return;
     case 0x8d00:		/* bt/s label */
 	CHECK_NOT_DELAY_SLOT