dcavalca / rpms / qemu

Forked from rpms/qemu a year ago
Clone

Blame 0004-target-ppc-Fix-lxvw4x-lxvh8x-and-lxvb16x.patch

8a7ac9
From: Anton Blanchard <anton@ozlabs.org>
8a7ac9
Date: Fri, 24 May 2019 07:53:45 +0100
8a7ac9
Subject: [PATCH] target/ppc: Fix lxvw4x, lxvh8x and lxvb16x
8a7ac9
8a7ac9
During the conversion these instructions were incorrectly treated as
8a7ac9
stores. We need to use set_cpu_vsr* and not get_cpu_vsr*.
8a7ac9
8a7ac9
Fixes: 8b3b2d75c7c0 ("introduce get_cpu_vsr{l,h}() and set_cpu_vsr{l,h}() helpers for VSR register access")
8a7ac9
Signed-off-by: Anton Blanchard <anton@ozlabs.org>
8a7ac9
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
8a7ac9
Tested-by: Greg Kurz <groug@kaod.org>
8a7ac9
Reviewed-by: Greg Kurz <groug@kaod.org>
8a7ac9
Message-Id: <20190524065345.25591-1-mark.cave-ayland@ilande.co.uk>
8a7ac9
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
8a7ac9
(cherry picked from commit 2a1224359008e23b051b7b45be4789afa0269f8c)
8a7ac9
---
8a7ac9
 target/ppc/translate/vsx-impl.inc.c | 13 +++++++------
8a7ac9
 1 file changed, 7 insertions(+), 6 deletions(-)
8a7ac9
8a7ac9
diff --git a/target/ppc/translate/vsx-impl.inc.c b/target/ppc/translate/vsx-impl.inc.c
8a7ac9
index 489b2436e4..1df688cc32 100644
8a7ac9
--- a/target/ppc/translate/vsx-impl.inc.c
8a7ac9
+++ b/target/ppc/translate/vsx-impl.inc.c
8a7ac9
@@ -102,8 +102,7 @@ static void gen_lxvw4x(DisasContext *ctx)
8a7ac9
     }
8a7ac9
     xth = tcg_temp_new_i64();
8a7ac9
     xtl = tcg_temp_new_i64();
8a7ac9
-    get_cpu_vsrh(xth, xT(ctx->opcode));
8a7ac9
-    get_cpu_vsrl(xtl, xT(ctx->opcode));
8a7ac9
+
8a7ac9
     gen_set_access_type(ctx, ACCESS_INT);
8a7ac9
     EA = tcg_temp_new();
8a7ac9
 
8a7ac9
@@ -126,6 +125,8 @@ static void gen_lxvw4x(DisasContext *ctx)
8a7ac9
         tcg_gen_addi_tl(EA, EA, 8);
8a7ac9
         tcg_gen_qemu_ld_i64(xtl, EA, ctx->mem_idx, MO_BEQ);
8a7ac9
     }
8a7ac9
+    set_cpu_vsrh(xT(ctx->opcode), xth);
8a7ac9
+    set_cpu_vsrl(xT(ctx->opcode), xtl);
8a7ac9
     tcg_temp_free(EA);
8a7ac9
     tcg_temp_free_i64(xth);
8a7ac9
     tcg_temp_free_i64(xtl);
8a7ac9
@@ -185,8 +186,6 @@ static void gen_lxvh8x(DisasContext *ctx)
8a7ac9
     }
8a7ac9
     xth = tcg_temp_new_i64();
8a7ac9
     xtl = tcg_temp_new_i64();
8a7ac9
-    get_cpu_vsrh(xth, xT(ctx->opcode));
8a7ac9
-    get_cpu_vsrl(xtl, xT(ctx->opcode));
8a7ac9
     gen_set_access_type(ctx, ACCESS_INT);
8a7ac9
 
8a7ac9
     EA = tcg_temp_new();
8a7ac9
@@ -197,6 +196,8 @@ static void gen_lxvh8x(DisasContext *ctx)
8a7ac9
     if (ctx->le_mode) {
8a7ac9
         gen_bswap16x8(xth, xtl, xth, xtl);
8a7ac9
     }
8a7ac9
+    set_cpu_vsrh(xT(ctx->opcode), xth);
8a7ac9
+    set_cpu_vsrl(xT(ctx->opcode), xtl);
8a7ac9
     tcg_temp_free(EA);
8a7ac9
     tcg_temp_free_i64(xth);
8a7ac9
     tcg_temp_free_i64(xtl);
8a7ac9
@@ -214,14 +215,14 @@ static void gen_lxvb16x(DisasContext *ctx)
8a7ac9
     }
8a7ac9
     xth = tcg_temp_new_i64();
8a7ac9
     xtl = tcg_temp_new_i64();
8a7ac9
-    get_cpu_vsrh(xth, xT(ctx->opcode));
8a7ac9
-    get_cpu_vsrl(xtl, xT(ctx->opcode));
8a7ac9
     gen_set_access_type(ctx, ACCESS_INT);
8a7ac9
     EA = tcg_temp_new();
8a7ac9
     gen_addr_reg_index(ctx, EA);
8a7ac9
     tcg_gen_qemu_ld_i64(xth, EA, ctx->mem_idx, MO_BEQ);
8a7ac9
     tcg_gen_addi_tl(EA, EA, 8);
8a7ac9
     tcg_gen_qemu_ld_i64(xtl, EA, ctx->mem_idx, MO_BEQ);
8a7ac9
+    set_cpu_vsrh(xT(ctx->opcode), xth);
8a7ac9
+    set_cpu_vsrl(xT(ctx->opcode), xtl);
8a7ac9
     tcg_temp_free(EA);
8a7ac9
     tcg_temp_free_i64(xth);
8a7ac9
     tcg_temp_free_i64(xtl);