diff mbox

[11/14] target/sh4: generate fences for SH4

Message ID 20170501221046.9369-12-aurelien@aurel32.net
State New
Headers show

Commit Message

Aurelien Jarno May 1, 2017, 10:10 p.m. UTC
synco is a SH4-A only instruction.

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

Comments

Philippe Mathieu-Daudé May 2, 2017, 12:58 p.m. UTC | #1
On 05/01/2017 07:10 PM, Aurelien Jarno wrote:
> synco is a SH4-A only instruction.
>
> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

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

> ---
>  target/sh4/translate.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 7de459c9a5..c226be9718 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -1570,10 +1570,11 @@ static void _decode_opc(DisasContext * ctx)
>  	else
>  	    break;
>      case 0x00ab:		/* synco */
> -	if (ctx->features & SH_FEATURE_SH4A)
> -	    return;
> -	else
> -	    break;
> +        if (ctx->features & SH_FEATURE_SH4A) {
> +            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
> +            return;
> +        }
> +        break;
>      case 0x4024:		/* rotcl Rn */
>  	{
>  	    TCGv tmp = tcg_temp_new();
>
diff mbox

Patch

diff --git a/target/sh4/translate.c b/target/sh4/translate.c
index 7de459c9a5..c226be9718 100644
--- a/target/sh4/translate.c
+++ b/target/sh4/translate.c
@@ -1570,10 +1570,11 @@  static void _decode_opc(DisasContext * ctx)
 	else
 	    break;
     case 0x00ab:		/* synco */
-	if (ctx->features & SH_FEATURE_SH4A)
-	    return;
-	else
-	    break;
+        if (ctx->features & SH_FEATURE_SH4A) {
+            tcg_gen_mb(TCG_MO_ALL | TCG_BAR_SC);
+            return;
+        }
+        break;
     case 0x4024:		/* rotcl Rn */
 	{
 	    TCGv tmp = tcg_temp_new();