[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PULL 39/49] target/ppc: decode target register in VSX_VECTOR
From: |
David Gibson |
Subject: |
[Qemu-ppc] [PULL 39/49] target/ppc: decode target register in VSX_VECTOR_LOAD_STORE_LENGTH at translation time |
Date: |
Tue, 2 Jul 2019 16:08:47 +1000 |
From: Mark Cave-Ayland <address@hidden>
Signed-off-by: Mark Cave-Ayland <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
target/ppc/helper.h | 8 ++---
target/ppc/mem_helper.c | 6 ++--
target/ppc/translate/vsx-impl.inc.c | 47 +++++++++++++++--------------
3 files changed, 30 insertions(+), 31 deletions(-)
diff --git a/target/ppc/helper.h b/target/ppc/helper.h
index a5e12a3933..7ed9effff2 100644
--- a/target/ppc/helper.h
+++ b/target/ppc/helper.h
@@ -279,10 +279,10 @@ DEF_HELPER_3(stvebx, void, env, avr, tl)
DEF_HELPER_3(stvehx, void, env, avr, tl)
DEF_HELPER_3(stvewx, void, env, avr, tl)
#if defined(TARGET_PPC64)
-DEF_HELPER_4(lxvl, void, env, tl, tl, tl)
-DEF_HELPER_4(lxvll, void, env, tl, tl, tl)
-DEF_HELPER_4(stxvl, void, env, tl, tl, tl)
-DEF_HELPER_4(stxvll, void, env, tl, tl, tl)
+DEF_HELPER_4(lxvl, void, env, tl, vsr, tl)
+DEF_HELPER_4(lxvll, void, env, tl, vsr, tl)
+DEF_HELPER_4(stxvl, void, env, tl, vsr, tl)
+DEF_HELPER_4(stxvll, void, env, tl, vsr, tl)
#endif
DEF_HELPER_4(vsumsws, void, env, avr, avr, avr)
DEF_HELPER_4(vsum2sws, void, env, avr, avr, avr)
diff --git a/target/ppc/mem_helper.c b/target/ppc/mem_helper.c
index 87632ccf53..6f4ffa3661 100644
--- a/target/ppc/mem_helper.c
+++ b/target/ppc/mem_helper.c
@@ -415,9 +415,8 @@ STVE(stvewx, cpu_stl_data_ra, bswap32, u32)
#define VSX_LXVL(name, lj) \
void helper_##name(CPUPPCState *env, target_ulong addr, \
- target_ulong xt_num, target_ulong rb) \
+ ppc_vsr_t *xt, target_ulong rb) \
{ \
- ppc_vsr_t *xt = &env->vsr[xt_num]; \
ppc_vsr_t t; \
uint64_t nb = GET_NB(rb); \
int i; \
@@ -446,9 +445,8 @@ VSX_LXVL(lxvll, 1)
#define VSX_STXVL(name, lj) \
void helper_##name(CPUPPCState *env, target_ulong addr, \
- target_ulong xt_num, target_ulong rb) \
+ ppc_vsr_t *xt, target_ulong rb) \
{ \
- ppc_vsr_t *xt = &env->vsr[xt_num]; \
target_ulong nb = GET_NB(rb); \
int i; \
\
diff --git a/target/ppc/translate/vsx-impl.inc.c
b/target/ppc/translate/vsx-impl.inc.c
index 5cf053e7f2..e853ee1386 100644
--- a/target/ppc/translate/vsx-impl.inc.c
+++ b/target/ppc/translate/vsx-impl.inc.c
@@ -344,29 +344,30 @@ VSX_VECTOR_STORE(stxv, st_i64, 0)
VSX_VECTOR_STORE(stxvx, st_i64, 1)
#ifdef TARGET_PPC64
-#define VSX_VECTOR_LOAD_STORE_LENGTH(name) \
-static void gen_##name(DisasContext *ctx) \
-{ \
- TCGv EA, xt; \
- \
- if (xT(ctx->opcode) < 32) { \
- if (unlikely(!ctx->vsx_enabled)) { \
- gen_exception(ctx, POWERPC_EXCP_VSXU); \
- return; \
- } \
- } else { \
- if (unlikely(!ctx->altivec_enabled)) { \
- gen_exception(ctx, POWERPC_EXCP_VPU); \
- return; \
- } \
- } \
- EA = tcg_temp_new(); \
- xt = tcg_const_tl(xT(ctx->opcode)); \
- gen_set_access_type(ctx, ACCESS_INT); \
- gen_addr_register(ctx, EA); \
- gen_helper_##name(cpu_env, EA, xt, cpu_gpr[rB(ctx->opcode)]); \
- tcg_temp_free(EA); \
- tcg_temp_free(xt); \
+#define VSX_VECTOR_LOAD_STORE_LENGTH(name) \
+static void gen_##name(DisasContext *ctx) \
+{ \
+ TCGv EA; \
+ TCGv_ptr xt; \
+ \
+ if (xT(ctx->opcode) < 32) { \
+ if (unlikely(!ctx->vsx_enabled)) { \
+ gen_exception(ctx, POWERPC_EXCP_VSXU); \
+ return; \
+ } \
+ } else { \
+ if (unlikely(!ctx->altivec_enabled)) { \
+ gen_exception(ctx, POWERPC_EXCP_VPU); \
+ return; \
+ } \
+ } \
+ EA = tcg_temp_new(); \
+ xt = gen_vsr_ptr(xT(ctx->opcode)); \
+ gen_set_access_type(ctx, ACCESS_INT); \
+ gen_addr_register(ctx, EA); \
+ gen_helper_##name(cpu_env, EA, xt, cpu_gpr[rB(ctx->opcode)]); \
+ tcg_temp_free(EA); \
+ tcg_temp_free_ptr(xt); \
}
VSX_VECTOR_LOAD_STORE_LENGTH(lxvl)
--
2.21.0
- [Qemu-ppc] [PULL 21/49] xics/spapr: Drop unused function declaration, (continued)
- [Qemu-ppc] [PULL 21/49] xics/spapr: Drop unused function declaration, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 27/49] ppc: Introduce kvmppc_set_reg_tb_offset() helper, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 26/49] xics/kvm: Add proper rollback to xics_kvm_init(), David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 19/49] hw/ppc/prep: Drop useless CONFIG_KVM ifdefery, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 34/49] target/ppc: introduce GEN_VSX_HELPER_X2_AB macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 35/49] target/ppc: introduce GEN_VSX_HELPER_X1 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 37/49] target/ppc: introduce GEN_VSX_HELPER_R2 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 45/49] ppc/xive: Force the Physical CAM line value to group mode, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 44/49] spapr/xive: simplify spapr_irq_init_device() to remove the emulated init, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 31/49] target/ppc: introduce GEN_VSX_HELPER_X3 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 39/49] target/ppc: decode target register in VSX_VECTOR_LOAD_STORE_LENGTH at translation time,
David Gibson <=
- [Qemu-ppc] [PULL 36/49] target/ppc: introduce GEN_VSX_HELPER_R3 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 33/49] target/ppc: introduce GEN_VSX_HELPER_X2 macro to fpu_helper.c, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 32/49] target/ppc: introduce separate generator and helper for xscvqpdp, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 40/49] target/ppc: decode target register in VSX_EXTRACT_INSERT at translation time, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 30/49] target/ppc: introduce separate VSX_CMP macro for xvcmp* instructions, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 46/49] ppc/xive: Make the PIPR register readonly, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 49/49] spapr/xive: Add proper rollback to kvmppc_xive_connect(), David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 48/49] ppc/xive: Fix TM_PULL_POOL_CTX special operation, David Gibson, 2019/07/02
- [Qemu-ppc] [PULL 47/49] ppc/pnv: Rework cache watch model of PnvXIVE, David Gibson, 2019/07/02
- Re: [Qemu-ppc] [Qemu-devel] [PULL 00/49] ppc-for-4.1 queue 20190702, no-reply, 2019/07/02